Mike7154 / plex_family_management

14 stars 4 forks source link

Plan to better search from common sense media #1

Closed Mike7154 closed 2 years ago

Mike7154 commented 2 years ago

Currently, I just build and 'guess' the URL from common sense media, which works most of the time. I think instead I can do a search in common sense media. Return the top 2 or 3 URLs from the search query. And load each webpage and match the IMDB id to ensure I got the right one. Currently my script will get the wrong beauty and the beast (cartoon) instead of the live action 2013 version for example.

deathbybandaid commented 2 years ago

Not sure if this old code would help

https://github.com/piplongrun/CSM.bundle/blob/master/Contents/Code/__init__.py

Edit:

Looks like the API URL would look like https://api.commonsense.org/v2/?imdb_id=tt0115341 with a header that contains x-api-key as per https://www.commonsensemedia.org/developers/api

However, I'm not sure how to obtain an API key yet

Mike7154 commented 2 years ago

Yes, this is the way to go. I had contacted them previously about getting a code, but then I told them I wasn't planning on building a tool instead wanted it for personal use and they didn't respond.

Now that I decided to share my tool, I will request an API key again.

deathbybandaid commented 2 years ago

you should keep the json of pulled data out of the repo, in case that is a violation of their service

Mike7154 commented 2 years ago

Yeah, I'll remove the json file. I read through their robots.txt file. I'm not doing anything they don't allow. I also requested another API key. We'll see how it goes. The current method works pretty well for movies, just not TV shows.

deathbybandaid commented 2 years ago

too bad we can't just get a database dump from them

Mike7154 commented 2 years ago

I mean....... Lol I originally uploaded the movie json file so others don't have to get movies I already got. I think they will probably just grant an API key. The question is whether or not they would make users have a paid account to use the tool. Because I doubt they would like me to share code that contains my key. Not quite sure how that will work for a non-webapp.

Mike7154 commented 2 years ago

Closing this issue. It now checks against IMDB. I May consider doing the API in the future, though I'm not sure if API calls require a paid account for the end user or not.