imdb-importer icon indicating copy to clipboard operation
imdb-importer copied to clipboard

Submitted rating for Movie doesn't lead to a movie effectively submitted

Open FerdinandoLM opened this issue 8 years ago • 6 comments

Submitting seems to not work:

Let's say the movie is "Scanners"

Searching for Scanners Submitting rating for {"title":"Scanners","rating":"4.0"} tt0081455 Submitted rating for Scanners

The output says the rating has been submitted, but it has not.

I tried modifying rating_base from 10 to 5, with or without comma/dot inside rating (4.0, 4,0 and 4), but none of these works.

The cookie is the id part, not de uu part and not session_id or other cookie components.

FerdinandoLM avatar Feb 12 '17 20:02 FerdinandoLM

Hello @FerdinandoLM,

Please try with the changes @ 72b075f0cca4468be5a4da1eda1e36e4b288c295. It is likely that your data-auth is empty (in other words, you are not really logged in based on your id).

The changes I've submitted will notify you if you aren't logged in and it will do a little bit better job of verifying that upon submitting, you are really receiving a success message from the API endpoint.

tomzx avatar Feb 12 '17 23:02 tomzx

ok the new logging system works fine, in fact i get the 403 error now, meaning that i've to check my login method.

Now, my way to get the ID is:

login to imdb, use a cookie editor and get the code inside "id" label only (skipping session_id" and so on.

The thing i noticed is that in your piece of sample id there is no special character, instead in my cookie there is some %0D%0A, encoded carriage return and another character.

example: BCYuXw4zFSNhc1SQ2lzPimvPpfFte_SAqxEe5HYqNEbAX-nxCL5w5QAc0ugVHk55ybbNfr0y5QjU%0D%0AQNYI1xLxsUeJsDNJrlKatu2f9K5hZ_lgGKda11deJKkIMQr2D95vs-aclak3oezsw5PY2u9iKDVa%0D%0ARMmujAi9MOh5_QeCxPOXNn9xnhqwws8weWwuTR5qStZ6%0D%0A

(keeping the exact number of characters and their position. i only scrambled in order to get the cookie invalid.)

FerdinandoLM avatar Feb 12 '17 23:02 FerdinandoLM

Yes, it seems the id format may have slightly changed since I initially wrote the README.md. I retested it an hour ago, with the %0D%0A ending included (similar to your example) and it worked fine.

tomzx avatar Feb 13 '17 00:02 tomzx

So what could be the issue of the 403 error, then?

I just tried to import a cookie containing only the id portion and it logged me correctly on imdb.

FerdinandoLM avatar Feb 13 '17 10:02 FerdinandoLM

Ok kinda solved this.

The issue is not related to the cookie but is related to the account settings.

I created a whole new account on imdb to test the script and it worked fine, so it was obvious that the issue was account-tied. What I did is use the exact same settings of the new account into the old one.

I went to https://www.imdb.com/registration/accountsettings > update your review settings and set it to: location field: empty, the two checkboxes are active.

https://www.imdb.com/preferences/general here i set up title display country to "original" and english to title display. every checkbox in this page is unticked, so disabled.

I saved everything and run the script: it worked.

FerdinandoLM avatar Feb 13 '17 10:02 FerdinandoLM

403 is generally reserved for actions which you tried to accomplish without being logged in or not having the necessary permissions. I would have expected a 400 if the request was invalid.

At this point I'm not too sure how any of the settings you've changed influence whether or not the script works. If you're willing to try out various settings to see which one is important, I'll update the README.md to indicate what is necessary.

tomzx avatar Feb 13 '17 12:02 tomzx