jensb89 / Netflix-to-Trakt-Import

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

Error #3

Closed marcusmuller closed 3 years ago

marcusmuller commented 3 years ago

I have configured all API keys and placed the CSV files in the folder, however I am getting this error and I don't know what it is.

C:\Users\mmcar\Downloads\Netflix-to-Trakt-Import-master>python netflix2trakt.py Traceback (most recent call last): File "C:\Users\mmcar\Downloads\Netflix-to-Trakt-Import-master\netflix2trakt.py", line 29, in for row in csvReader: File "C:\Users\mmcar\AppData\Local\Programs\Python\Python39\lib\csv.py", line 111, in next row = next(self.reader) File "C:\Users\mmcar\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 5102: character maps to

benjick commented 2 years ago

How did you solve this? I have it too

RileyXX commented 2 years ago

I also had this error. It's because there's a character or characters in the netflix history csv file you downloaded that are corrupting the script. This probably could be fixed by editing some of the .py files for character error handling.

What I did was I made a copy of the netflix history .csv file and opened up both .csv files in notepad++. Then I copied over small/large batches to the new file in notepad and saved it then ran the script until I eventually isolated the character that was giving me this error. For me it was the character "Á" in one of my shows titles. My netflix viewing history file was quite large and I only had one character that was giving me problems but someone else might have several.

Also, I ran into another error, something about TMDB not found or something for one of my shows that was hanging up the script. I had to run small/large batches of my netflix history file until eventually I isolated the shows/movies that were giving me problems in both cases. Took me a while but I got it done eventually. Script overall was great but could use a couple improvements. I may submit a pull request at some point to help out.

jensb89 commented 2 years ago

Thanks for opening the issue and all the help here already.

@RileyXX already found the issue, thanks for providing the steps to work around the error.

I think this is an error I could check against in the code and either ignore these titles or convert the wrong characters. I will look into this when I have some time and will try to provide a patch, so it will not affect future users :) For now, the steps provided by @RileyXX are a good workaround! Also, the Netflix2TraktImportLog.log might help to identify the problematic titles more quickly.