damenootok 0 Posted September 11, 2020 Share Posted September 11, 2020 Hi, it seems that emby doesn't support overriding user-agent variable for remoteimageservice (http://swagger.emby.media/?staticview=true#/RemoteImageService) this is quite important since some website are blocking "script" http client, and it would help substantially if you can override it, probably by additional parameter Thanks Link to comment Share on other sites More sharing options...
Luke 36881 Posted September 11, 2020 Share Posted September 11, 2020 HI, what are you trying to accomplish? Link to comment Share on other sites More sharing options...
damenootok 0 Posted September 12, 2020 Author Share Posted September 12, 2020 some website that i use for getting artist image implement some kind of filter based on user agent, and emby's default user agent is being rejected. I have confirmed that another string of user agent is allowed to curl that resource, hence the request. I'm hitting the Item/{id}/RemoteImage url to add artist / actor's image url via api. Is there any other way to set the artist/actor's image without using the remote image service? Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted September 12, 2020 Share Posted September 12, 2020 yes if you have a local copy of the image you want to upload to emby for the artist Link to comment Share on other sites More sharing options...
damenootok 0 Posted September 12, 2020 Author Share Posted September 12, 2020 (edited) @PenkethBoy which API can i use for that? is it this one?http://swagger.emby.media/?staticview=true#/ImageService/postItemsByIdImagesByType and just post the local image to it as it's body? Edited September 12, 2020 by damenootok Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted September 12, 2020 Share Posted September 12, 2020 (edited) no you dont use swagger for this as its just an interface for the api in a "friendly" gui first you authenticate with an admin user or use the api key option from the dashboard then you need to get the aritst ID - i.e the internal db item id for the artist - easy to do via the api then you need to encode the image as a base64 string and tell emby what the content type is "image/jpeg" or "image/png" then upload the base64 as the body of the POST to $ImageUrl = $embyServerUrl + "/emby/Items/"+ $EmbyArtist.ID + "/Images/Primary?api_key=" + $User.AccessToken where User.accesstoken is either from auth by name or the static api key you got from the dashboard - dont use the swagger one! images/primary could be images/logo images/art etc For a jpg/jpeg file $Result = Invoke-Webrequest -uri $ImageUrl -Method POST -Body $Base64 -ContentType "image/jpeg" Note - the last time i tried it you cant use swagger to uplaod an image - it just errors out - the above was worked out by trial and error a long time ago I have not given you all the answers and the above is for Powershell but you should be able to work it out for you chosen language Edited September 12, 2020 by PenkethBoy Link to comment Share on other sites More sharing options...
damenootok 0 Posted September 12, 2020 Author Share Posted September 12, 2020 okay, i was pasting the swagger url since that seems to be a good resource for api reference. I think i got all the info I needed from your guide, thanks! 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