jensb89 / Netflix-to-Trakt-Import

Synchronize/Import the viewing history from Netflix to trakt.tv
97 stars 21 forks source link

Error after processing through many #27

Open justkorix opened 1 year ago

justkorix commented 1 year ago

Was going great but errored out after a while, not sure what happened

Traceback (most recent call last):
  File "/Users/kori/Netflix-to-Trakt-Import/netflix2trakt.py", line 95, in <module>
    tmdbResult = tmdbSeason.details(tv_id=showId, season_num=season.number, append_to_response="translations")
  File "/Users/kori/Library/Python/3.9/lib/python/site-packages/tmdbv3api/objs/season.py", line 29, in details
    return AsObj(
  File "/Users/kori/Library/Python/3.9/lib/python/site-packages/tmdbv3api/as_obj.py", line 9, in __init__
    raise TMDbException(entries["status_message"])
jensb89 commented 1 year ago

Do you use the latest version? I have fixed a similar bug lately.

If yes, do you know at which series/movie it fails. Then I can try to reproduce and debug.

justkorix commented 1 year ago

Yeah it's the latest version, not sure where it's getting knocked out. If you can tell me where I can grab the log I'd be happy to upload it for you to see where the error is coming in

jensb89 commented 1 year ago

There should be a file "Netflix2TraktImportLog.log" in the folder.

Additionally, you could set TMDB-DEBUG to True in the config.py file for more infos in that log file.

Or alternatively you could simply send me your csv file (or part of it) here so I could try to reproduce the error with that. Thanks!

Nackophilz commented 1 year ago

Same problem here

When this is a big file he cant process trough all (maybe a limitation of api call on TMDB ? )

Nackophilz commented 1 year ago

This is definitely because of large CSV file.

I add to the python script a function to parse one CSV file into one CSV file of 500 lines max (as many as i need)

then loop on each new csv file to work

And voila ! :)

justkorix commented 1 year ago

Any chance I could snag that script? Would love to get the rest added to Trakt!

ahknight commented 1 year ago

When I ran into this error it's because it was searching for season "None" and on line 95 it was calling tmdbSeason.details outside of a try block. I added the try block (mirroring the one above it for tmdbSeason.details on line 72) and it skipped over an entry in the CSV that looked like:

ShowName: NameOfFirstHalf / NameOfSecondHalf

It should probably default to searching on season 1 if season is None.

jensb89 commented 1 year ago

Thanks for the updates @all.

A few thoughts on this:

For now, it seems the best thing is to split large files into separate smaller files, until the above mentioned fix is ready :)

SawkeeReemo commented 11 months ago

https://hastebin.com/share/ilocahifuc.java

Having this problem as well. It's happening so often, that this is sort of unusable at the moment. NetflixViewingHistory.csv

SawkeeReemo commented 10 months ago

Quick update: Since I had over 10 years worth of Netflix history to import, I switched to grabbing the more recent stuff first and copying that into a new CSV. I was able to get through most of it, which is good enough for me right now, but if I can help provide more data in any way to help you squash this bug, I'd be happy to. Great script you've written here, must be a pain to parse all this out.

jensb89 commented 10 months ago

Thanks for the updates @SawkeeReemo. Yes, splitting into smaller CSVs is the solution here currently. It's good to know that it works for you and the code is helpful to many people. In general the code still works fine for files that are not too large. There are still some open points. For example, checking if the same entry was already uploaded would be a nice feature to avoid double entries in trakt. The large file problem is another. However, some of these require a bigger code change and more testing. I hope to find some time for that soon. Still, any help here is appreciated :)