cecobask / imdb-trakt-sync

Automatic sync from IMDb to Trakt (watchlist, lists, ratings and history) using GitHub actions.
MIT License
90 stars 209 forks source link

Cant get your imdb-trakt sync repo to run #2

Closed Sky-Blaster closed 2 years ago

Sky-Blaster commented 2 years ago

I created the Trakt Api-App with the recommended "urn:ietf:wg:oauth:2.0:oob" url and get a Code like one if i'm about to add a new device. I added this code to the reqbin.com/veotsc62 Snippet and got an access token which I added in the template of the branch secret action (also I added all other Values from IBMD and Trakt). I'm totally new to github and only got here, because I wanted to sync my imdb records with the one of trakt. :-)

Im always getting an sync error: Process completed with exit code 1.

Currently I'm out of options and would kindly ask for some help.

I'm not sure this is the right way, or place to do so, but i didn't find a "contact" form of any kind.

Thanks in advance Sky

cecobask commented 2 years ago

Hey @Sky-Blaster ,

I took a look at your GitHub Actions sync job runs. All of them are failing for the same reason. Here's one of the latest runs: On line 14 you can see the following:

2022/08/11 18:51:40 error scraping imdb profile: user id not found

To fix that issue do the following:

  1. Log in to your IMDB account
  2. Copy the values of 2 cookies named at-main and ubid-main(domain: .imdb.com), using your favourite browser. For Google Chrome you'd open Developer Tools -> Application -> Cookies -> https://www.imdb.com imdb cookies
  3. Open your fork of the imdb-trakt-sync repository
  4. From Settings -> Secrets -> Actions either create new secrets or update existing secrets
  5. You need to create these two repository secrets for IMDB to work:
    IMDB_COOKIE_AT_MAIN
    IMDB_COOKIE_UBID_MAIN
  6. If you don't want to wait until the sync job is triggered automatically to test whether it works, you can trigger it manually by opening your fork of imdb-trakt-sync and follow this path Actions -> sync -> Run workflow

I hope this was helpful and you get it to work after following these instructions! 🫡

Sky-Blaster commented 2 years ago

Hi Dimov,

thanks for coming back to me so quick. I did all this steps yesterday several times and again just now. Nothing changes [image: image.png] Do you have any other ideas how to solve this?

Thanks Alex

Am Do., 11. Aug. 2022 um 22:39 Uhr schrieb Tsvetoslav Dimov < @.***>:

Hey Sky,

I took a look at your GitHub Actions sync job runs. All of them are failing for the same reason. Here's one of the latest runs https://github.com/Sky-Blaster/imdb-trakt-sync/runs/7793761051: On line 14 you can see the following:

2022/08/11 18:51:40 error scraping imdb profile: user id not found

To fix that issue do the following:

  1. Log in to your IMDB account
  2. Copy the values of 2 cookies named at-main and ubid-main(domain: . imdb.com), using your favourite browser. For Google Chrome you'd open Developer Tools -> Application -> Cookies -> https://www.imdb.com [image: imdb cookies] https://user-images.githubusercontent.com/32335835/184236362-01815c80-3fd4-422e-ba5f-47e81137bcf0.png
  3. Open your fork of the imdb-trakt-sync repository
  4. From Settings -> Secrets -> Actions either create new secrets or update existing secrets
  5. You need to create these two repository secrets for IMDB to work:

IMDB_COOKIE_AT_MAIN

IMDB_COOKIE_UBID_MAIN

  1. If you don't want to wait until the sync job is triggered automatically to test whether it works, you can trigger it manually by opening your fork of imdb-trakt-sync and follow this path Actions -> sync -> Run workflow

I hope this was helpful and you get it to work after following these instructions! 🫡

— Reply to this email directly, view it on GitHub https://github.com/cecobask/imdb-trakt-sync/issues/2#issuecomment-1212471060, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2PHLZRHO2SAJSYDA7CFTBDVYVQITANCNFSM56H3BFCA . You are receiving this because you authored the thread.Message ID: @.***>

Sky-Blaster commented 2 years ago

Hi Again,

I'm trying this now from Chrome and Firefox and get different ubid-main values and also different at-main values. Shouldn't they be the same?

Best Alex

Am Do., 11. Aug. 2022 um 22:39 Uhr schrieb Tsvetoslav Dimov < @.***>:

Hey Sky,

I took a look at your GitHub Actions sync job runs. All of them are failing for the same reason. Here's one of the latest runs https://github.com/Sky-Blaster/imdb-trakt-sync/runs/7793761051: On line 14 you can see the following:

2022/08/11 18:51:40 error scraping imdb profile: user id not found

To fix that issue do the following:

  1. Log in to your IMDB account
  2. Copy the values of 2 cookies named at-main and ubid-main(domain: . imdb.com), using your favourite browser. For Google Chrome you'd open Developer Tools -> Application -> Cookies -> https://www.imdb.com [image: imdb cookies] https://user-images.githubusercontent.com/32335835/184236362-01815c80-3fd4-422e-ba5f-47e81137bcf0.png
  3. Open your fork of the imdb-trakt-sync repository
  4. From Settings -> Secrets -> Actions either create new secrets or update existing secrets
  5. You need to create these two repository secrets for IMDB to work:

IMDB_COOKIE_AT_MAIN

IMDB_COOKIE_UBID_MAIN

  1. If you don't want to wait until the sync job is triggered automatically to test whether it works, you can trigger it manually by opening your fork of imdb-trakt-sync and follow this path Actions -> sync -> Run workflow

I hope this was helpful and you get it to work after following these instructions! 🫡

— Reply to this email directly, view it on GitHub https://github.com/cecobask/imdb-trakt-sync/issues/2#issuecomment-1212471060, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2PHLZRHO2SAJSYDA7CFTBDVYVQITANCNFSM56H3BFCA . You are receiving this because you authored the thread.Message ID: @.***>

cecobask commented 2 years ago

Hey @Sky-Blaster,

I updated the app to enable users to optionally pass their IMDb user id as environment variable (a.k.a. GitHub repository secret). You can see the latest changes in this commit https://github.com/cecobask/imdb-trakt-sync/commit/6907f4fadba0faf6f47ee2441a07073115f391ac. What you need to do is:

  1. Open your fork of imdb-trakt-sync repository
  2. You'll see a warning message similar to this: This branch is 1 commit behind cecobask:main.
  3. Click on Sync fork -> Update branch
  4. From Settings -> Secrets -> Actions create new repository secret with name IMDB_USER_ID and value similar to ur90652269, but it has to be your own user id
  5. If you don't want to wait until the sync job is triggered automatically to test whether it works, you can trigger it manually by following this path Actions -> sync -> Run workflow
cecobask commented 2 years ago

Hi Again, I'm trying this now from Chrome and Firefox and get different ubid-main values and also different at-main values. Shouldn't they be the same? Best Alex Am Do., 11. Aug. 2022 um 22:39 Uhr schrieb Tsvetoslav Dimov < @.***>:

The values differ between Chrome and Firefox because these cookies represent unique user sessions. Logging in to the same website (for example www.imdb.com) from different browsers or devices will yield a different session (new cookie values). Here's more info about the concept of cookies: https://www.cookieyes.com/blog/session-cookies/

Sky-Blaster commented 2 years ago

I added the UserID as described and it is still not working, still the same error. I really don't understand it and I'm almost desperate. The Imdb Account lasts for 13 Years now and I can't think of any more ideas how to fix this. Any more Ideas from your side? Thanks in advance Sky

Sky-Blaster commented 2 years ago

is there something I have to install first in my github environment? Is there more to do, regarding "Configure your GitHub repository secrets using the env.example file as reference" except to change all the parameters to fit mine? Or is there actually something to "configure"? Has the secret to have a special name?

cecobask commented 2 years ago

That's odd, I expected this to fix the issue for you since you'll be passing your ID manually, so it's certain that it exists. The if statement that I added checks whether your IMDB_USER_ID repository secret exists. And does one of the following:

If you synced your fork (I checked and you have) and added a repository secret with the name IMDB_USER_ID and a valid value (this I cannot verify, because these values are only visible to you), you shouldn't even get to the code that returns this error. The GitHub environment already has everything set up in advance. All the setup you needed to do was included in the README.md and .env files.

Please, double check the IMDB_USER_ID secret exists (capital letters and underscores between words) and points to your actual IMDb user ID. If nothing else works, we can sync up on Google Meet, Zoom, or equivalent and I'll try to help figure it out.

cecobask commented 2 years ago

Hey @Sky-Blaster, just a thought I had after we ended the meeting:

The main use of imdb-trakt-sync is one-directional sync between IMDb and Trakt, with the source of truth being IMDb. The way it works is by fetching data from the IMDb website (exporting to CSV files, web scraping) and then using the Trakt API (which they've made publicly available) to add, delete or update any out-of-sync entries.

IMDb's API for modification of user movie data is only accessible to people that work on their product - employees. What they provide is an API for retrieval of movie data, which is not tied to any user account (such as movie cast, genres, etc). This is of no real value to a use case where you want to sync data to IMDb from Trakt. Unfortunately, until they decide to publish their user movie data API for public use, nothing can be done to make the sync from Trakt to IMDb possible.

If one day they provide this API for public use, I will be sure to update imdb-trakt-sync to make use of this. IMDb has been around for a very long time and if by now they haven't made their API public, I'm not feeling too optimistic they will ever do it.