alturismo 37 Posted April 5, 2019 Share Posted April 5, 2019 Hi, may im blind but i cannot get a simple refresh via api running i checked the openapi wiki, but all i try is ending with oot@AlsServer:~# curl -X POST "http://192.168.1.2:8096/emby/Library/Refresh" <h1>Length Required</h1>root@AlsServer:~# ^C root@AlsServer:~# may some hints how the command looks ? usecase here as records are still in "season 1" instead "season 01" (2 digits) i made me a script to move them after i made my com cuts (avysynth) and remux (to .mkv) as emby needs some time to update and sometimes a whole day i d like to automize this with an api call. thanks ahead. Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted April 5, 2019 Share Posted April 5, 2019 that api call requires authentication go to swagger (look for the "api" link in the bottom of the server dashboard page) and then look for library service within that list you will find the refresh option that you can test to see what the full url should look like Also prior to that make sure you have the realtime monitor turned on for each library (assuming your OS supports it) - and emby will find new media within a couple of minutes and hopefully the api call will not be necessary Link to comment Share on other sites More sharing options...
alturismo 37 Posted April 5, 2019 Author Share Posted April 5, 2019 thats what i more or less did and always ended up in ... root@AlsServer:~# curl -s "http://192.168.1.2:8096/openapi&api_key=mykeyhere#/LibraryService/postLibraryRefresh" Unable to find the specified file.root@AlsServer:~# ^C root@AlsServer:~# curl -X POST "http://192.168.1.2:8096/emby/Library/Refresh?api_key=mykeyhere"-H "accept: */*" <h1>Length Required</h1>root@AlsServer:~# ^C root@AlsServer:~# thats what i get from the shell ... i replaced my api key now with "mykeyhere" just in case u think its wrong. and yes, i have realtime running and working for new files, but when i move files with script it aint recognizing it ... only after the nightly refresh ... Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted April 5, 2019 Share Posted April 5, 2019 where are you getting the key from? Link to comment Share on other sites More sharing options...
alturismo 37 Posted April 5, 2019 Author Share Posted April 5, 2019 where are you getting the key from? from the swagger site ? Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted April 5, 2019 Share Posted April 5, 2019 No thats not going to work for you either get it by authenticating with a user/pwd or go to dashboard>advanced>security and generate one Link to comment Share on other sites More sharing options...
alturismo 37 Posted April 5, 2019 Author Share Posted April 5, 2019 ok, added it there, took that key now, same result ... root@AlsServer:~# http://192.168.1.2:8096/openapi&api_key=newapikey/LibraryService/postLibraryRefresh [1] 7204 root@AlsServer:~# -bash: http://192.168.1.2:8096/openapi:No such file or directory ^C [1]+ Exit 127 http://192.168.1.2:8096/openapi root@AlsServer:~# curl -X POST "http://192.168.1.2:8096/emby/Library/Refresh?api_key=newapikey"-H "accept: */*" <h1>Length Required</h1>root@AlsServer:~# ^C root@AlsServer:~# http://192.168.1.2:8096/emby/Library/Refresh?api_key=newapikey -bash: http://192.168.1.2:8096/emby/Library/Refresh?api_key=newapikey:No such file or directory root@AlsServer:~# replaced key with newapikey Link to comment Share on other sites More sharing options...
Luke 37099 Posted April 5, 2019 Share Posted April 5, 2019 Have you tried this with the interactive api docs? Link to comment Share on other sites More sharing options...
Happy2Play 8296 Posted April 5, 2019 Share Posted April 5, 2019 (edited) Manually trying to run the curl commands I always get the "<h1>Length Required</h1>" error or something similar. You need to add "-d """ to the command. curl -X POST "http://localhost:8096/emby/Library/Refresh?api_key=YourAPIKey" -H "accept: */*" -d "" or curl -X POST "http://localhost:8096/emby/Library/Refresh?api_key=YourAPIKey" -d "" or curl -X POST "http://localhost:8096/emby/Library/Refresh?api_key=YourAPIKey" -H "Content-Length: 0" Edited April 5, 2019 by Happy2Play Link to comment Share on other sites More sharing options...
alturismo 37 Posted April 5, 2019 Author Share Posted April 5, 2019 (edited) Manually trying to run the curl commands I always get the "<h1>Length Required</h1>" error or something similar. You need to add "-d """ to the command. curl -X POST "http://localhost:8096/emby/Library/Refresh?api_key=YourAPIKey" -H "accept: */*" -d "" or curl -X POST "http://localhost:8096/emby/Library/Refresh?api_key=YourAPIKey" -d "" or curl -X POST "http://localhost:8096/emby/Library/Refresh?api_key=YourAPIKey" -H "Content-Length: 0" ok, now it looks working, what wonders me a little, i only see pictures updating in dashboard (percentage circle), nothing in tvshows and movies, will try now as a record just got done. ### EDIT ### update, worked like a charm, thanks alot Edited April 5, 2019 by alturismo Link to comment Share on other sites More sharing options...
roblav96 1 Posted June 7, 2019 Share Posted June 7, 2019 (edited) Manually trying to run the curl commands I always get the "<h1>Length Required</h1>" error or something similar. You need to add "-d """ to the command. curl -X POST "http://localhost:8096/emby/Library/Refresh?api_key=YourAPIKey" -H "accept: */*" -d "" or curl -X POST "http://localhost:8096/emby/Library/Refresh?api_key=YourAPIKey" -d "" or curl -X POST "http://localhost:8096/emby/Library/Refresh?api_key=YourAPIKey" -H "Content-Length: 0" ok, now it looks working, what wonders me a little, i only see pictures updating in dashboard (percentage circle), nothing in tvshows and movies, will try now as a record just got done. ### EDIT ### update, worked like a charm, thanks alot Might I recommend https://httpie.org/ as a friendly alternative to curl: http POST 'http://localhost:8096/emby/Library/Refresh?api_key=123456789' Edited June 7, 2019 by roblav96 Link to comment Share on other sites More sharing options...
alturismo 37 Posted June 11, 2019 Author Share Posted June 11, 2019 Might I recommend https://httpie.org/ as a friendly alternative to curl: http POST 'http://localhost:8096/emby/Library/Refresh?api_key=123456789' thanks for the tip, as its all working fine here currently no need, but i keep it in mind 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