bluestripe 1 Posted March 22, 2019 Share Posted March 22, 2019 (edited) Hello, I'm a newbie to Emby, this may be an already answered matter. What I'm trying to do: Use locally stored image(.jpg) as actor thumbnail using NFO file without manually uploading image using browser. As far as I know 1. "People" folder is deprecated, and now manually uploaded actor thumbnails are stored in "Library" folder. 2. You can't insert URL in NFO file like this. <actor> <name>Example Name</name> <role>Example Role</role> <type>Actor</type> <thumb>http://example.com/example.jpg</thumb> </actor> 3. You can't insert local image using full path in NFO file like this. <actor> <name>Example Name</name> <role>Example Role</role> <type>Actor</type> <thumb>/mnt/myServer/actors/example.jpg</thumb> </actor> 4. You can' use .actor folder like Kodi. 5. There isn't a way upload actor picture using API. Is this correct understanding? I use self-made scripts to generate custom NFO files of movies, so if there is a way to embed local image in NFO, I would like to know. Also, I believe file path of uploaded pictures are stored in Libray.db. Is there any way to access those information using API etc.? because if it is, I can write a script to replace those pictures with my own pictures with the same file names. Edited March 22, 2019 by bluestripe Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted March 22, 2019 Share Posted March 22, 2019 (edited) Hi Welcome Yes the api can upload/change images for actors as well as other items - if done this way the files are stored in the metadata\library folder and the db gets updated - same as if you did it manually via the web app And yes you can access their path locations - but if you did the above they would already be updated Have a read of this to get you started https://github.com/MediaBrowser/Emby/wiki And also check out Swagger - go to you server dashboard and at the bottom of the page are four links - use the API one and it will take you to Swagger - where amongst other things it allows you to try api calls etc Tip: Turn on debug logging and try doing what you want via the web app - then look at the log and you will see api calls to the server - helps with finding the right call in swagger as there are lots Have fun Edited March 22, 2019 by PenkethBoy Link to comment Share on other sites More sharing options...
bluestripe 1 Posted March 23, 2019 Author Share Posted March 23, 2019 Hi Welcome Yes the api can upload/change images for actors as well as other items - if done this way the files are stored in the metadata\library folder and the db gets updated - same as if you did it manually via the web app And yes you can access their path locations - but if you did the above they would already be updated Have a read of this to get you started https://github.com/MediaBrowser/Emby/wiki And also check out Swagger - go to you server dashboard and at the bottom of the page are four links - use the API one and it will take you to Swagger - where amongst other things it allows you to try api calls etc Tip: Turn on debug logging and try doing what you want via the web app - then look at the log and you will see api calls to the server - helps with finding the right call in swagger as there are lots Have fun I took a look into Swagger and found that I can combine PersonService:Persons/Name RemoteImageService:Items/Id/RemoteImages/Download to apply online images as actor's thumbnail. Thanks. However, I could not find a API to upload local images (whether local images form server posting API, or those from Emby Server.) Is there anyway to that?( file:// doesn't work ) I guess I could set up LAMP to handle the image, but still ...... It would be superb if I could use multipart or base64 string. Link to comment Share on other sites More sharing options...
Solution PenkethBoy 2063 Posted March 23, 2019 Solution Share Posted March 23, 2019 look at the "imageservice" in swagger - to upload an image to you emby server- to change the image for an actor and anything else remoteimages is for d/l from a remote metadata image provider - probably not what you want 1 Link to comment Share on other sites More sharing options...
pünktchen 1241 Posted March 23, 2019 Share Posted March 23, 2019 @@bluestripe look at Emby's plugin catalogue for the "People Backup" plugin. Maybe it fullfills your needs already. Link to comment Share on other sites More sharing options...
bluestripe 1 Posted March 23, 2019 Author Share Posted March 23, 2019 (edited) look at the "imageservice" in swagger - to upload an image to you emby server- to change the image for an actor and anything else remoteimages is for d/l from a remote metadata image provider - probably not what you want I actually suspected ImageService:Items/Id/Images/Type but failed to upload images using Swagger, so I assumed that this API was not meant for uploading images...... Until I found your post!!! https://emby.media/community/index.php?/topic/69300-uploading-and-image-via-api-swagger-error/ This was exactly what I wanted. HUGE Thanks to you! TL;DR For others who want to do the same thing with Linux or WSL or Mac First, you get Person Item ID curl -X GET "${embyServerURL}/emby/Persons/${personName}?api_key=${apiKey}" -H "accept: application/json" make sure to replace ${personName} with actor's name (url encoded string) - If you want to upload internet images curl -X POST "${embyServerURL}/emby/Items/${actorID}/RemoteImages/Download?Type=${type}&ImageUrl=${imageUrl}&api_key=${apiKey}" -H "accept: */*" - If you want to upload local image (jpeg) base64 ${imagePath} | xargs curl -X POST "${embyServerURL}/emby/Items/${actorID}/Images/Type=${type}?api_key=${apiKey}" -H "Content-Type: image/jpeg" --data-binary - If you want to upload local image (png) base64 ${imagePath} | xargs curl -X POST "${embyServerURL}/emby/Items/${actorID}/Images/Type=${type}?api_key=${apiKey}" -H "Content-Type: image/png" --data-binary Edited March 23, 2019 by bluestripe 1 Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted March 23, 2019 Share Posted March 23, 2019 cool - glad you got it working - yes convert to base64 works for me as well One other thing png files work as well for logo's etc but you would also need to change the content type - for anybody reading in the future Link to comment Share on other sites More sharing options...
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