Jump to content

How to add a RottenTomatoes link to media


Recommended Posts

cptbrainia
Posted

I've been reading around and realize (I think) that we can't change the RottenTomatoes critic rating to the audience score due to cost/info passed along from RT.  However, is there a way to get a link added to the bottom of the media?

Underneath links (in a movie library), there are links to the IMDB page, TheMovieDB page, and Trakt (if it's installed).  Is there any way to add an RT link here?  

Thanks!

 

Happy2Play
Posted

Not unless there is an easy search url to use existing TMDB or IMDB id to get to an item on RT.

Like Trakt links are by tmdbid or imdbid

https://trakt.tv/search/tmdb/767825?id_type=movie
https://trakt.tv/search/imdb/tt12585076?id_type=movie

 

visproduction
Posted

It wouldn't be an easy hack.

Rottentomates links work like this:


Maybe do a delayed .js script to make a link to https://www.rottentomatoes.com/m/{movie name}_{release year}. Search the DOM for <h1> 404 - Not Found</h1>.  If found then try just https://www.rottentomatoes.com/m/{movie name}

If you still get a 404, then change the link CSS class to hidden.

There is probably also some version name change for movies and TV shows that have the same name in the same year.  That would probably break this hack.  Maybe you could search by director to confirm you found the right media page.

cptbrainia
Posted

Thanks for the responses; I appreciate anyone other than me giving it some thought.

Let me preface what I'm about to say with this: I expect that I'm wrong and that I just don't understand yet why I'm wrong.  That being said...

Doing some poking around, couldn't this just be parsed from the rottentomatoes API?

You can view the results for your example below:

https://www.rottentomatoes.com/api/private/v2.0/search?q=vortex

It lists all 15 movies and separates them by year released.  Couldn't emby just pull the URL for the release that matches the year of the media you're viewing?

I'm sure there are some examples where this could get dicey, e.g. maybe a common name where there are two movies with the same name released the same year, but it seems like if you could manually set the link in the metadata or something, that would be workable.

Honestly, I'd take any implementation - even a rough one. I hate the process/steps required to pull an Emby movie up on RottenTomatoes.  Also, as my friend pointed out, Plex provides user ratings.  I don't care about Plex having a feature that Emby doesn't, but I don't like my friend having bragging rights.

visproduction
Posted (edited)

Cpt,

Nice find, but only some of the links go to a media page.  A lot of the links go to 404 - Not found.  RT probably limits their dbase entries to those with some hits.  Or, there is a different API page that is more up to date.  I already tried v.2.1 and v2.01... nothing.  It's a good chance that coding a scraping script might work most of the time with this API link, but it would be nice to find out if there is a more up to date API.  How did you find this one?  Maybe there is discussion further.  It's sort of annoying when you write a script and 2 weeks later the site updates and your script fails.  Obviously, the best answer is to contact the site and work out a deal.  If links appear inside Emby product, then Rotten Tomatoes gets a promotion and traffic, as well.  Sometimes, the company is happy to provide up to date API that will continue to work.

Edited by visproduction
Posted

I'm not sure where that API url came from but the RT API and data are not free and any attempt to "scrape" this data from web pages or discovered urls would be violating their IP.

BillOatman
Posted (edited)

@ebr  Looks like you fill out a proposal form and if they like you, you can use their data.  I have to believe Emby would get approved.

The link is here.

Edited by BillOatman
roaku
Posted
1 hour ago, BillOatman said:

@ebr  Looks like you fill out' a proposal form and if they like you, you can use their data.  I have to believe Emby would get approved.

The link is here.

Being 'liked' by them is comically expensive.

Happy2Play
Posted

From an old post.

Quote

"Thank you for your interest in the Rotten Tomatoes API.

API users have access to our existing API, which provides full access to Rotten Tomatoes Scores and Reviews Snippets (up to 20), for an annual fee which starts at $60,000."

Rotten Tomatoes API? : webdev (reddit.com)

 

cptbrainia
Posted

Do you have any newer source as to the cost/process?  That reddit link is from 6 years ago.  It's quite possible something has changed in that time.

 

 

Happy2Play
Posted
7 minutes ago, cptbrainia said:

Do you have any newer source as to the cost/process?  That reddit link is from 6 years ago.  It's quite possible something has changed in that time.

 

 

Not that I have found.  But would not be surprised if it hasn't changed or went up.  As IMDB is the exact same way wanting $50,000 a year for their Community Ratings.

AWS Marketplace: IMDb Ratings for Movies/TV/OTT (Bulk data) (amazon.com)

BillOatman
Posted

The RT proposal form doesn't show cost, but this line would imply it is not free.

Quote

Unfortunately we cannot support data feed requests for educational or personal purposes at this time.

 

cptbrainia
Posted

They had an email contact form on their website for their business development team.  I went ahead and just asked them directly. Worse comes to worse, they simply ignore me (insert joke here about my wife).

I'll post if I get any response.

  • 3 years later...
Posted (edited)

Now that I'm working on some stuff related to this, I can say that adding a RT link is technically fairly easy doable in Emby without violating anything regarding APIs or website scraping just by querying wikidata sparql API. With the IMDB-ID extracted from Emby DB (wikidata property P345) you can query property P1258 -> Rotten tomatoes slug.

Example Fantastic Four - First steps -> API request
 

SELECT ?rtId WHERE { 
    ?item wdt:P345 "tt10676052" . 
    ?item wdt:P1258 ?rtId . 
} LIMIT 1

Result:
 

m/the_fantastic_four_first_steps

Emby would need just append it to the base URL:
https://www.rottentomatoes.com/m/the_fantastic_four_first_steps

image.png.39c3dfecbde1ee856e653feab2a1d3bb.png

This works 98% of the time for mainstream titles. If you have niche titles, it may be possible that the RT slug is not yet provided by wikidata. But everyone is free to add it by himself.
Generating the link for an item just would need to be throttled or be done on demand and then written to Emby DB when accessing a specific item to not violate wikidata terms for the API. Generate the RT slugs on library scan for hundreds or thousands of items at once would not be a good idea for example 🤓

Quote
  • SPARQL Query Service (query.wikidata.org):
    • Runtime: Max 60 seconds per query.
    • Concurrency: Max 5 concurrent queries per IP address.
    • Results: Large queries may be throttled or capped in result size.

Perhaps @ebrcan elaborate on this regarding Law and Order.

Edited by sh0rty
Posted
5 hours ago, sh0rty said:

Perhaps @ebrcan elaborate on this regarding Law and Order.

I looked but was unable to find the terms of use for this API.  Can you point me to it?

Thanks.

Posted (edited)
1 hour ago, ebr said:

I looked but was unable to find the terms of use for this API.  Can you point me to it?

Thanks.

This is the full limit explanation:

Quote

Query limits

There is a hard query deadline configured which is set to 60 seconds. There are also following limits:

  • One client (user agent + IP) is allowed 60 seconds of processing time each 60 seconds
  • One client is allowed 30 error queries per minute

Clients exceeding the limits above are throttled with HTTP code 429. Use Retry-After header to see when the request can be repeated. If the client ignores 429 responses and continues to produce requests over the limits, it can be temporarily banned from the service. Clients who don’t comply with the User-Agent policy may be blocked completely – make sure to send a good User-Agent header.

Every query will timeout when it takes more time to execute than this configured deadline. You may want to optimize the query or report a problematic query here.

Also note that currently access to the service is limited to 5 parallel queries per IP. The above limits are subject to change depending on resources and usage patterns.

Query limits:
https://www.mediawiki.org/wiki/Wikidata_Query_Service/User_Manual#:~:text=rdf-results-table-,Query limits,30 error queries per minute
https://www.wikidata.org/wiki/Wikidata%3ASPARQL_query_service

Tthe API is relying on the same ToS/ToU like all wikimedia services like wikipedia. Terms of Use:
https://foundation.wikimedia.org/wiki/Policy:Terms_of_Use

As far as I can see, there should be no problem to use the wikidata RT slug in Emby, since the data is licenced under CC0 1.0 (except any RT logo -> RT ToS but Emby doesn't use IMDB etc. logos anyway).

Edited by sh0rty
Posted

Thanks.  The way I read all that, obtaining and displaying the links to RT should not be a problem.  We could not display any content at the end of those links however.

Posted
2 hours ago, ebr said:

 We could not display any content at the end of those links however.

This is clear. But perhaps the wikidata API is considered by the team to show a RT link beside IMDb etc. in the future. Just another small but nice addition. BTW is copyright the reason to not show Logos of the Providers like IMDb, Trakt, TMDb, TVDb on item detail pages?

Posted
3 hours ago, sh0rty said:

BTW is copyright the reason to not show Logos of the Providers like IMDb, Trakt, TMDb, TVDb on item detail pages?

It was really more of a design decision but not having them does help keep us from getting randomly DMCA'd

  • Like 1

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