jensb89 / trakt---letterboxd-import

Import Letterboxd movie list (diary) into trakt.tv
86 stars 16 forks source link

Error with codecs? #26

Open vrooms-leucine0i opened 2 months ago

vrooms-leucine0i commented 2 months ago

Hello I am sorry but I am dumb when it comes to computer codes. I tried running this and got this error:

Traceback (most recent call last):
  File "C:\Users\K\Downloads\letterboxd-06_force_damage-2024-05-13-02-54-utc\py-trakt-letterboxd-import-python3.py", line 209, in <module>
    data = get_data_letterboxd(letterboxd_file[0],use_diary_file)
  File "C:\Users\K\Downloads\letterboxd-06_force_damage-2024-05-13-02-54-utc\py-trakt-letterboxd-import-python3.py", line 123, in get_data_letterboxd
    print([row[1],row[2],row[7]+' 20:15',imdbid,row[4]])
  File "C:\Users\K\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2153' in position 14: character maps to <undefined>

Not sure what this means or why it stopped

jensb89 commented 2 months ago

Can you please try the changes from here and see if it works with that? https://github.com/jensb89/trakt---letterboxd-import/pull/25/files

vrooms-leucine0i commented 2 months ago

Same error. It starts to run and then stops again

jensb89 commented 2 months ago

Ok, it's one title in your csv file with a strange encoding probably.

Do you know at which point it stops? Can you post that line here, or upload the file? Then I can have a look later

jensb89 commented 2 months ago

Quick workaround would also be to just delete that one line from the csv.

vrooms-leucine0i commented 2 months ago

Think I found the issue - it was with Naked Gun 33 1/3 - it didn't like the 1/3 unicode.

vrooms-leucine0i commented 2 months ago

No issue when trying watched.csv, but when I tried the diary, it didn't import everything even though it listed all the entries. This time I get error:

Traceback (most recent call last):
  File "C:\Users\K\Downloads\letterboxd-06_force_damage-2024-05-13-02-54-utc\py-trakt-letterboxd-import-python3.py", line 235, in <module>
    send_data(movie_data,token,use_diary_file)
  File "C:\Users\K\Downloads\letterboxd-06_force_damage-2024-05-13-02-54-utc\py-trakt-letterboxd-import-python3.py", line 147, in send_data
    f = urllib2.urlopen(req)
  File "C:\Users\K\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Users\K\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 525, in open
    response = meth(req, response)
  File "C:\Users\K\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 634, in http_response
    response = self.parent.error(
  File "C:\Users\K\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 563, in error
    return self._call_chain(*args)
  File "C:\Users\K\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
  File "C:\Users\K\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 429: Too Many Requests
vrooms-leucine0i commented 2 months ago

The above error was when trying the new changes from this comment