Jump to content

Metadata using Items and ItemID


Go to solution Solved by adminExitium,

Recommended Posts

Posted (edited)

Hello,

A beginer question here, my goal is to change metadata using a bash-script

But first i want to test the API with curl:
curl "server:8096/Items?searchTerm=somemovie&IncludeItemTypes=Movie&Recursive=true&api_key=xxxxxxxxxxxxxxxxxx"
This is working, so i can search the and get the id for a movie

 

Next i wanted to get metadata based on the id:
curl -s "http://server:8096/Items/303030?api_key=xxxxxxxxxxxxxxxxxxx"
get File '/Items/303030' not found

Here is where i need feedback, is this wrong?

 

Last step i want to change this two using jq inthe bash-script

.MetadataLanguage = "sv"

.PreferredMetadataLanguage = "sv"



 

Edited by Jaha
Wrong script in text
Posted
Quote

e

 

Next i wanted to get some metadata from based on the id:
curl -s "http://server:8096/Items/303030?api_key=xxxxxxxxxxxxxxxxxxx"
get File '/Items/303030' not found

Here is where i need feedback, is this wrong?

Hi, one easy way to see what's wrong is to use the browser debugger to monitor what the emby metadata sends for the same operation, and then just match that.

  • Thanks 1
  • Solution
adminExitium
Posted

Items/<ItemId> is not a valid API. You need to use either /Items?Ids=<Id> for partial item response but with support for multiple items at once or /Users/<User>/Items/<Id> for the full item response but with support for only a single item at a time.

  • Thanks 2
Posted

Thanks for reply, <User> (USER_ID) in the endpoint did the trick.

Get metadata to file:

curl -s -H "X-Emby-Token: YOUR_API_KEY" \ "HOST/Users/USER_ID/Items/303030" > metadata.json

Post metadata back after being updated:

curl -X POST "HOST/Items/ITEM_ID" -H "Content-Type: application/json" -H "X-Emby-Token: YOUR_API_KEY" --data-binary "@metadata.json"
  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...