lukearran / TvTimeToTrakt

A Python script to import TV Time data into Trakt.TV
MIT License
147 stars 17 forks source link

Error executing the script #21

Closed X-static closed 7 months ago

X-static commented 1 year ago

Hi,

I'm having the following error after executing the script:

Traceback (most recent call last):
  File "/home/filipe/TvTimeToTrakt-main/TimeToTrakt.py", line 65, in <module>
    config = getConfiguration()
  File "/home/filipe/TvTimeToTrakt-main/TimeToTrakt.py", line 53, in getConfiguration
    data = json.load(f)
  File "/usr/lib/python3.9/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 5 column 23 (char 264)

Thank you

X-static commented 1 year ago

I was able to run it on my Android phone.

Probably something wrong with my python installation.

myvanity commented 1 year ago

Can you share with me how you managed to do it on Android? Step by step please. Thanks

melintech commented 1 year ago

Hi, I am having a similar problem executing the script but when I try to import my movies

2023-01-20 20:09:14 [   INFO] :: Processing movies.
Traceback (most recent call last):
  File "D:\Files\TV Time Trakt\TvTimeToTrakt-main\TimeToTrakt.py", line 164, in <module>
    start()
  File "D:\Files\TV Time Trakt\TvTimeToTrakt-main\TimeToTrakt.py", line 154, in start
    process_watched_movies()
  File "D:\Files\TV Time Trakt\TvTimeToTrakt-main\TimeToTrakt.py", line 100, in process_watched_movies
    watched_list = [row["movie_name"] for row in reader if row["type"] == "watch"]
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Files\TV Time Trakt\TvTimeToTrakt-main\TimeToTrakt.py", line 100, in <listcomp>
    watched_list = [row["movie_name"] for row in reader if row["type"] == "watch"]
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\redacted\AppData\Local\Programs\Python\Python311\Lib\csv.py", line 111, in __next__
    row = next(self.reader)
          ^^^^^^^^^^^^^^^^^
  File "C:\Users\redacted\AppData\Local\Programs\Python\Python311\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 3446: character maps to <undefined>

By changing the 85th line with:

with open(WATCHED_SHOWS_PATH, newline="", encoding="UTF-8") as csvfile:

it managed to barely work by importing 4 movies. So it seems to be a problem with encoding but I don't have experience with python and programming in general so I don't know how to actually fix it. Thank you.

irmota commented 1 year ago

Hi, I was having the exact same error, and I switched in the json config file, the tvtime path's backslash for a slash like this: "GDPR_WORKSPACE_PATH": "C:/tv-time-personal-data" and it worked for me.

Good luck guys!

MoTem commented 1 year ago

Thanks irmota it worked. This should be added to the main description.

GabriFrz commented 1 year ago

Still having the Issue, is there something that can be done?