Jump to content

Stumped trying to get an API key to work with Powershell for Movies reporting


Recommended Posts

FatherSaint
Posted

I am having issues with the Reports plugin as I try to find my old movies that are 720p or even worse to upgrade. It has often wrongly identified the resolutions, usually showing 1080p as 720p...

So, anyway, I've been using Co-Pilot to create reporting based using the API key that I created specifically for this. I should mention that I first tried the API key that was already with the same error.

My Lifetime license appears to be fully installed and everything is happy in that regard.

ERROR OCCURRED: Access token is invalid or expired.

The C:\Reports path has full permissions and I'm executing the .PS1 file from within Powershell, which is running as Administrator.

After a lot of back and forth, Co-Pilot thinks that the issue is related to network binding of some sort, causing the key to be rejected.

Any thoughts would be much appreciated. I've attached the script here as a .TXT file, in case that helps.

EmbyReportingPowershell.txt

FatherSaint
Posted

Honestly, I thought it was more likely something in the script, even though Co-Pilot didn't agree. LOL

I'll read that now, thank you!

 

FatherSaint
Posted (edited)

PLAN B: Tiny Media Manager can apparently export the list that I need. I have it installed and running right now.

Unfortunately, I had done what the page shows. It doesn't make sense to me, especially since I am the ONLY configured user and so presumably the Admin by default.

Co-Pilot decided at some point that instead of using localhost the script should use the IP address instead.

Maybe I'll just have to manually do this, which would be a stinker, but the Reports plugin might give me some good info.

Edited by FatherSaint
Update
Posted

Have you tried api_key instead of ApiKey in the URL?

  • Thanks 1
FatherSaint
Posted

This is ALL Co-Pilot, I don't know what I'm doing when it comes to scripts and programming.

That's a good catch, I didn't see it but do now that you ask about it. I just tried that way and still got the error.

Unless Tiny Media Manager doesn't give me a proper report, I'm not going to pursue this.

Thank you for posting!

Posted (edited)

I ran the query against my instance with api_key and it accepted it. I ran the exact script with my own variable too and it worked, I just changed the api_key name I mentioned. You should be able to manually run a curl with the path looking like this:

EDIT: Could be HTTP instead as well, I used "https://path.to.my.emby" for the variable, but "http://ip.address:port" should work too.

Quote

curl "https://<INSTANCE ADDRESS>/Items?IncludeItemTypes=Movie&Recursive=true&Fields=MediaStreams&api_key=<APIKEYGOESHERE>"

image.png.0b26b6162d67a65213715bbe65806553.png

image.png.0cfce80e89b9d909e980da1d0491aced.png

Edited by Lessaj

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...