Skip to content

Commit

Permalink
Possible fix for CSV encoding (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
L11K authored Mar 13, 2024
1 parent d721a28 commit 7d4a3e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ python -m pip install -r requirements.txt

Create a new file named `config.json` in the same directory of `TimeToTrakt.py`, using the below JSON contents (replace the values with your own).

Use forward slash or double backslash for `GDPR_WORKSPACE_PATH` if you encounter `json.decoder.JSONDecodeError: Invalid \escape: line 4 column 31 (char 206)`, as seen [here](https://github.com/lukearran/TvTimeToTrakt/issues/18) and [here](https://github.com/lukearran/TvTimeToTrakt/issues/39).

```
{
"CLIENT_ID": "YOUR_CLIENT_ID",
Expand Down
6 changes: 4 additions & 2 deletions TimeToTrakt.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@

# Setup logger
logging.basicConfig(
format="%(asctime)s [%(levelname)7s] :: %(message)s",
format="%(asctime)s [%(levelname)s] :: %(message)s",
encoding='utf-8',
level=logging.INFO,
datefmt="%Y-%m-%d %H:%M:%S",
# datefmt="%x %X", #Uncomment for locale date and time, if preffered
)

# Adjust this value to increase/decrease your requests between episodes.
Expand Down Expand Up @@ -82,7 +84,7 @@ def init_trakt_auth() -> bool:


def process_watched_shows() -> None:
with open(WATCHED_SHOWS_PATH, newline="") as csvfile:
with open(WATCHED_SHOWS_PATH, newline="", encoding="UTF-8") as csvfile:
reader = csv.DictReader(csvfile, delimiter=",")
total_rows = len(list(reader))
csvfile.seek(0, 0)
Expand Down

0 comments on commit 7d4a3e1

Please sign in to comment.