Jaha 2 Posted June 16, 2025 Posted June 16, 2025 (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 June 16, 2025 by Jaha Wrong script in text
Luke 42077 Posted June 16, 2025 Posted June 16, 2025 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. 1
Solution adminExitium 355 Posted June 17, 2025 Solution Posted June 17, 2025 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. 2
Jaha 2 Posted June 22, 2025 Author Posted June 22, 2025 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" 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now