anacrolix / imdbrt

Show RT rating on IMDB pages
https://chrome.google.com/webstore/detail/dhmlipoakdghhhemjmefopbcdcobiphp
4 stars 3 forks source link

Not Working #16

Closed KurtzPT closed 7 years ago

KurtzPT commented 7 years ago

Gets stuck at "Checking Rotten Tomatoes..." in every movie page.

Chrome: Version 57.0.2987.21 beta (64-bit)

spreadred commented 7 years ago

I have the same issue.

Chrome: Version 56.0.2924.87 (32-bit)

anacrolix commented 7 years ago

Do you guys have adblockers?

spreadred commented 7 years ago

I have both UBlock Origin and the Kaspersky Protection (blocks tracking/data collection, etc) addon. Turning both them off seems to have no effect. While testing various combinations of UBlock/Kaspersky enabled/disabled, I have seen the rotten tomatoes requests succeed twice, most other times it just waits indefinitely.

Is there a way to use the Network Tab in the Developer Console to see what happens to the request from the RottenTomatoes plugin?

EDIT: with both of the aforementioned plugins fully enabled, I was just able to have the RottenTomatoes info successfully load...which would seem to rule out ad-blocking interference?

anacrolix commented 7 years ago

It looks like the service I'm using to get the scores is down. http://www.omdbapi.com/

I'll copy the status message here in case it goes away:

Attention Users!

02/04/17 - Error 503/The service is unavailable! I KNOW! I've been working throughout the night trying to track down the bot/script/attack causing this issue, it's not normal activity as someone decided it was a good idea to open over 50+ concurrent connections and spam 300+ million requests an hour. Unfortunately the majority of features available to me to prevent these sorts of attacks are browser security checks (which are currently enabled so you can read this message) this is only temporary as I'm aware it breaks the majority of API implementations. Sorry for the inconvenience and I'll be working nonstop to get this resolved ASAP.

spreadred commented 7 years ago

Well, that certainly explains the intermittent successes. I had assumed you were using the RottenTomatoes API directly. https://developer.fandango.com/Rotten_Tomatoes

anacrolix commented 7 years ago

Maybe I should.

moviedino commented 7 years ago

i always get the error "No Score Yet..." and "No Audience Rating Yet..." allthough they are available.

example: http://www.imdb.com/title/tt0076759/

imdb

is there a chance to update the plugin?

anacrolix commented 7 years ago

I'm also getting this. Again it looks like omdb is down. I don't have a lot of time to look into it presently, I'll reassess the situation in a while.

spreadred commented 7 years ago

I've forked the plugin. I'm curious to see if using the RottenTomatoes API directly will fix this problem. I don't have much free time either, but perhaps sometime this week I'll get a chance.

konstantinosftw commented 7 years ago

OMDB works because when I click on the "No Score Yet.." it redirects me to the correct RT movie page. It would seem that the extension simply does not grab the right DOM elements to present, probably RT changed its DOM.

spreadred commented 7 years ago

I think he's using the OMDB API, not just scraping DOM elements.

konstantinosftw commented 7 years ago

I see that OMDB provides only a single object property in their .json relevant to RT, {"Source":"Rotten Tomatoes","Value":"91%"}, which is the score of the TOMATOMETER. So I assume he has to be scraping the RT's html code in order to grab "consensus" and all the rest.

spreadred commented 7 years ago

http://www.omdbapi.com/?tomatoes=true&i=tt0133093

That's an example of his API request. It seems that much of the returned JSON information for rottentomatoes has 'N/A' for its value.

So perhaps RT changed their API and OMDB hasn't updated their RT code to reflect that, which explains all the returned "N/A"s.

spreadred commented 7 years ago

In a previous post, I had suggested transitioning to directly using the Rotten Tomatoes API might solve this type of problem. After revisiting their API site, it seems that now API Key requests are only approved on a case-by-case basis and that there is a licensing fee associated with its usage as well.

Pulled from another github issues page:

Rotten Tomatoes is no longer issuing API keys at the time of registration. We will review each application to ensure the usage of our data aligns with Brand Guidelines and Terms of Service and will provision keys if approved. There is now a license fee to access the API details of which will be provided upon application approval. The approval process may take up to 60 days. Thank you for your patience.

spreadred commented 7 years ago

Furthermore, it appears OMDB is closing their API to the public. If you want to continue to use the API, you will have to pay a small monthly fee:

From https://www.patreon.com/posts/api-is-going-10743518

I need to rework all of the goals and rewards due to this change, and I hope the people dependent on this API can afford $1 a month for the time being.

spreadred commented 7 years ago

After contacting Brian who runs the OMDB site, he directed me here for an explanation of the changes to the OMDB API response. It seems due to RT's legal team, he's had to drop many of the details he would have previously returned in the response JSON.

https://www.patreon.com/posts/rating-changes-8417367

anacrolix commented 7 years ago

Thanks for the feedback guys. It looks like the API may have changed a little, but the data I need is still available in the response. I'll update it in the next week, or take a PR if anyone solves it in the meanwhile.

spreadred commented 7 years ago

PR #17 to fix the problem with no overall score displayed. The other fields that were previously used seem to no longer be provided by the OMDB API. I'm not sure if he has a patch in the works to address that, or if due to the changes to the underlying RT API, we will no longer be able to get that more detailed information.

anacrolix commented 7 years ago

I've merged your PR, updated from upstream, and pushed 4.0.2. At least in the meanwhile we can continue to have the RT rating. Let's see where omdbapi ends up.

anacrolix commented 7 years ago

It seems to be taking a while to publish 4.0.2. But I've uploaded it, let me know if it works when it (presumably) arrives.

spreadred commented 7 years ago

Yes, it is working now.

moviedino commented 7 years ago

thanks so much for updating! 👍 RT ratings are back now, but audience score is still not working. also the tomatometer symbols are not grabbed.

spreadred commented 7 years ago

@moviedino I wasn't aware of the tomatometer symbols not being pulled; I'll check this out, it may be related to the API changes as well. As far as your other reports, until the OMDB API gets updated, the only information available to use is just the RT Ratings. We are awaiting the fate of OMDB.

spreadred commented 7 years ago

@moviedino It appears that these images were previously passed as a response from the API request. I'm assuming your'e talking about the icons like "certified fresh" or the splat looking one?

While we could certainly pull these images and store them locally and run our own logic to determine which one to display, with the changes RT has made to their API and terms of use, I'm not sure the legality of using their images. Is this fair use? A safer option would be to make our own images that correspond to those in use by RT and implement those our the extension instead.

spreadred commented 7 years ago

@anacrolix I have submitted a request to Fandango about using the Rotten Tomatoes API directly. I will update when/if I receive a response from them. Using the API directly would give us back access to the more detailed information which is no longer available from OMDB.

moviedino commented 7 years ago

@kaptainkommie correct, i was talking about the tomatometer symbols.

here is an example of the past: unnamed

i checked the RT page, to my humble opinion the symbols can be used. someone only hast to request the usage for the extension.

spreadred commented 7 years ago

@moviedino @anacrolix PR #18 should give us the tomatometer images back, although we should note that the logic is just a simple numeric comparison and doesn't take into account the extra qualifications required to be "certified fresh." Without access to that information, this is the best we can do for now.

moviedino commented 7 years ago

@kaptainkommie awesome 🥇

anacrolix commented 7 years ago

Included in 4.0.2.1.

moviedino commented 7 years ago

looks like the extension (again) is not working anymore 😢

spreadred commented 7 years ago

Looks like OMDB is requiring the use of an API key now.

The request made in the usual way: http://www.omdbapi.com/?tomatoes=true&i=tt0133093

Returns: {"Response":"False","Error":"No API key provided."}

I never did hear back from Rotten Tomatoes about my inquiry into getting an API key for them.

spreadred commented 7 years ago

Access to the OMDB API is now $1/month for 100,000 requests per day.

https://www.patreon.com/bePatron?u=5038490

EDIT: I went ahead and purchased one for our use. We'll see how this goes. $12/year isn't much, but by including the key in the source code, someone could come along and use it for other purposes. I'm not sure how to work around this flaw. Obviously we don't want each user to have to purchase their own key.

spreadred commented 7 years ago

@anacrolix Patch #19 fixes this issue, for now.

anacrolix commented 7 years ago

It's a shame we don't get all the old data points with the API key

spreadred commented 7 years ago

Yes. I've asked on OMDB's Patreon page about those extra data points, so have other people. We haven't gotten any response from Brian who runs OMDB yet. He had previously mentioned it was Rotten Tomatoes fault, maybe he's working to resolve it.