Giter Site home page Giter Site logo

netflix-to-trakt-import's People

Contributors

dboute avatar dotwee avatar gregorysprenger avatar jensb89 avatar precupstefan avatar ricky avatar yo-han avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

netflix-to-trakt-import's Issues

no tmdbv3api?

from tmdbv3api import TV, Movie, Season, TMDb
ModuleNotFoundError: No module named 'tmdbv3api'

Type Error

Hi,

First of all thanks for this! I've followed all the steps and changed my CSV. Because it was in Dutch (my country), even did a search for special characters and changed it. But i'm getting this type error and I can't seem to fix the problem. Good to know that i'm working from terminal at my macOS Ventura.

Traceback (most recent call last):
File "/Users/myname/Documents/Netflix-to-Trakt-Import-master/netflix2trakt.py", line 46, in
netflixHistory.addEntry(entry, watchedAt)
File "/Users/myname/Documents/Netflix-to-Trakt-Import-master/NetflixTvShow.py", line 69, in addEntry
self.addTvShowEntry(showName, seasonNumber, episodeTitle, entryDate)
File "/Users/myname/Documents/Netflix-to-Trakt-Import-master/NetflixTvShow.py", line 140, in addTvShowEntry
episode.addWatchedDate(watchedDate)
File "/Users/myname/Documents/Netflix-to-Trakt-Import-master/NetflixTvShow.py", line 215, in addWatchedDate
time = datetime.datetime.strptime(watcheddate + "20:15", config.CSV_DATETIME_FORMAT + "%h:%m:%s")
~~~~~~~~~~~~^~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

ValueError: time data '01/07/2023 20:15' does not match format '%d/%m/%y %H:%M'

First off, thanks for providing this tool.

I got the Title,Date csv and was trying to kick off the process after getting the API's set up, but i'm running in an issue with the date format.

First error was
"ValueError: time data '01/07/2023 20:15' does not match format '%d.%m.%y %H:%M'"
as the Netflix csv had "/".

I tried two things, one was to reformat the document with dots, which still resulted in the following error:
"ValueError: time data '01.07.2023 20:15' does not match format '%d.%m.%y %H:%M'"

Then I tried to change the format in the config.py, which still throws an error.
Any ideas what to try next?

python netflix2trakt.py
Traceback (most recent call last):
  File "C:\Users\Coding\Netflix-to-Trakt-Import-master\NetflixTvShow.py", line 215, in addWatchedDate
    time = datetime.datetime.strptime(watchedDate + " 20:15", config.CSV_DATETIME_FORMAT + " %H:%M")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '01/07/2023 20:15' does not match format '%d/%m/%y %H:%M'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Coding\Netflix-to-Trakt-Import-master\netflix2trakt.py", line 46, in <module>
    netflixHistory.addEntry(entry, watchedAt)
  File "C:\Users\Coding\Netflix-to-Trakt-Import-master\NetflixTvShow.py", line 69, in addEntry
    self.addTvShowEntry(showName, seasonNumber, episodeTitle, entryDate)
  File "C:\Users\Coding\Netflix-to-Trakt-Import-master\NetflixTvShow.py", line 140, in addTvShowEntry
    episode.addWatchedDate(watchedDate)
  File "C:\Users\Coding\Netflix-to-Trakt-Import-master\NetflixTvShow.py", line 219, in addWatchedDate
    time = datetime.datetime.strptime(watchedDate + " 20:15", "%m.%d.%y %H:%M")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '01.07.2023 20:15' does not match format '%m.%d.%y %H:%M'

Not syncing to trakt?

Running on windows, I think I have everything setup right, but Trakt itself is not updating. I was never prompted to give a pin for the app, so possibly thats part of the problem. When I run the python script, I get this at the end (after listing a bunch of movies/shows as found and not found)

Traceback (most recent call last):
  File "C:\XXXX\Netflix-To-Trakt\netflix2trakt.py", line 87, in <module>
    tmdbResult = tmdbSeason.details(tv_id=showId, season_num=season.number, append_to_response="translations")
  File "C:\Users\XXXX\AppData\Local\Programs\Python\Python310\lib\site-packages\tmdbv3api\objs\season.py", line 29, in details
    return AsObj(
  File "C:\Users\XXXX\AppData\Local\Programs\Python\Python310\lib\site-packages\tmdbv3api\as_obj.py", line 9, in __init__
    raise TMDbException(entries["status_message"])
tmdbv3api.exceptions.TMDbException: The resource you requested could not be found.

Program runs without errors, Trakt not updated

This is exactly what I'm looking for, Much appreciated!

So I gave it a try and I seem to have gotten it to work partially.
I updated the config.py with all the necessary information, brought in the NetflixViewingHistory.csv to the same folder then ran "netflix2trakt.py" via python.

The command window ran and listed all the found and unfound movies.
I checked trakt and the found movies unfortunately didn't update. I did get the following errors at the end of the script:

File "C:\Program Files\Netflix-to-Trakt-Import\netflix2trakt.py", line 140, in
res = tmdbMovie.search(movie.name)
File "C:\Users\CaptainWiggles\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\tmdbv3api\objs\movie.py", line 222, in search
self._call(
File "C:\Users\CaptainWiggles\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\tmdbv3api\tmdb.py", line 177, in _call
raise TMDbException(json["errors"])
tmdbv3api.exceptions.TMDbException: ['query must be provided']

The Netflix2TraktImportLog.log is actually populated correctly. I've changed the config file as per the Canada comment with it being Y-M-D.
Sample below:

INFO:root:Added show Chef's Table season 3 episode Ivan Orkin
INFO:root:Added show School of Chocolate season 1 episode The Best in Class Is...
INFO:root:No Tmdb ID found for Street Food: Asia : Season 1: Bangkok, Thailand
INFO:root:Searching Headspace Guide to Meditation
INFO:root:Found Tmdb ID for Headspace Guide to Meditation : Season 1: How to Get Started (TMDB ID 2551407)

No errors other than the Traceback comments I listed in the previous comment.

Next I wanted to list the not found items. I am on windows and I 'grep' is not a recognized command. would there be a work around for this?

Check if entry has already been logged in Trakt

This script will not check if an entry has already been logged, so beware that if you run on the same CSV file again, it will happily progress the same entries again.

Improvement could be to check if an entry with the name, date and time has already been logged.

[IMPROVEMENT] Netflix2trakt.py

Hey !

I add some problem with the script, because my CSV file is maybe .. To oversize (since 2015 >>)

So i have to add this two little thing :

1- Correct the accent, just for the view :
pip insttall ftfy (update requirement.txt)

On line 14 add :
from ftfy import fix_text
After line 39 :
entry = row["Title"]
entry = fix_text(entry)

2- Open the csv file in utf8 encoding, with oversize file , that could be a problem to the script to read correcly without this :
So replace -> with open(config.VIEWING_HISTORY_FILENAME, mode="r") as csvFile:
With -> open(config.VIEWING_HISTORY_FILENAME, mode="r", encoding="utf-8") as csvFile:

And you're ready to go

Error after processing through many

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"])

Error

Hello,
While running I am encountering the following error

Traceback (most recent call last): File "netflix2trakt.py", line 31, in <module> for row in csvReader: File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\csv.py", line 111, in __next__ row = next(self.reader) File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python38\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 5486: character maps to <undefined>

Error

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

[New feature] Partial sync

A partial sync for very large CSVs would be a great addition and reduce possible errors when sending the data to trakt.

can't import into trakt

it gives me this, after I authorized in web browser:

Adding epsiode to trakt:
Traceback (most recent call last):
  File "C:\Users\XXXXX\Desktop\Netflix-to-Trakt-Import-master\netflix2trakt.py", line 222, in <module>
    time = datetime.datetime.strptime(watchedTime + " 20:15", config.CSV_DATETIME_FORMAT + " %H:%M")
  File "C:\Users\XXXXX\AppData\Local\Programs\Python\Python310\lib\_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "C:\Users\XXXXX\AppData\Local\Programs\Python\Python310\lib\_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '29/07/2022 20:15' does not match format '%d.%m.%y %H:%M'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\XXXXX\Desktop\Netflix-to-Trakt-Import-master\netflix2trakt.py", line 226, in <module>
    time = datetime.datetime.strptime(watchedTime + " 20:15", config.CSV_DATETIME_FORMAT + " %H:%M")
  File "C:\Users\XXXXX\AppData\Local\Programs\Python\Python310\lib\_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "C:\Users\XXXXX\AppData\Local\Programs\Python\Python310\lib\_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '29.07.2022 20:15' does not match format '%d.%m.%y %H:%M'

please help

Fantastic!

Sorry, I just wanted to say thank-you, this is fantastic and worked like a charm!

time data '12.04.2022 20:15' does not match format

Hi, trying to import my data and being told the date format is incorrect. The data in my spreadsheet looks like this:

Title,Date
"Seinfeld: Season 9: The Bookstore","12/04/2022"
"Jimmy Savile: A British Horror Story: Limited Series: Part 2","12/04/2022"
"Jimmy Savile: A British Horror Story: Limited Series: Part 1","11/04/2022"

It's d, m, y. The error says:

ValueError: time data '12.04.2022 20:15' does not match format '%d.%m.%y %H:%M'

From what I can tell it should? Is there something I can edit in the config to fix it? Thanks!

e: I changed the y in the date format to Y and that fixed it.

Error message when trying to import

Traceback (most recent call last):
File "C:\Users[user]\Desktop\Netflix-to-Trakt-Import-master\netflix2trakt.py", line 69, in
tmp = tmdbSeason.details(tv_id=showId, season_num=i, append_to_response="translations")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users[user]\AppData\Local\Programs\Python\Python311\Lib\site-packages\tmdbv3api\objs\season.py", line 29, in details
return AsObj(
^^^^^^
File "C:\Users[user]\AppData\Local\Programs\Python\Python311\Lib\site-packages\tmdbv3api\as_obj.py", line 9, in init
raise TMDbException(entries["status_message"])
tmdbv3api.exceptions.TMDbException: The resource you requested could not be found.

TMDB SSL Error

Hi, excellent tool and just trying to get this up and running, have filled in the config file, when running the script however see the following errors.

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.themoviedb.org', port=443): Max retries exceeded with url: /3/search/tv?api_key=&query=Gotham&page=1&language=en (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))

I have tried to search this error with no real success, thanks in advance.

datetime error

Hi,
Maybe its because im in Quebec Canada but I cant import my Netflix history on trakt.

The Python error:

Traceback (most recent call last):
  File "D:\Windows\Téléchargements\Netflix-to-Trakt-Import-master\netflix2trakt.py", line 163, in <module>
    time = datetime.datetime.strptime(watchedTime + ' 20:15', '%d.%m.%y %H:%M')
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\lib\_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\lib\_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '2021.12.15 20:15' does not match format '%d.%m.%y %H:%M'

Do you have an idea why ?

My CSV is formatted like that:

Title,Date
"Tiger King: Tiger King 2: Beg Your Pardon","2021-12-15"
"Fate/EXTRA Last Encore: Oblitus Copernican Theory: Praeteritus Limbus Vorago","2021-12-15"
"House of Secrets: The Burari Deaths: Limited Series: 11 Bodies","2021-10-20"
"Squid Game: Season 1: One Lucky Day","2021-10-04"
"Squid Game: Season 1: Front Man","2021-10-04"
"Squid Game: Season 1: VIPS","2021-10-04"
"Squid Game: Season 1: Gganbu","2021-10-04"
"Squid Game: Season 1: A Fair World","2021-10-04"
"Squid Game: Season 1: Stick to the Team","2021-10-03"
"Squid Game: Season 1: The Man with the Umbrella","2021-10-03"
"Squid Game: Season 1: Hell","2021-10-03"
"Squid Game: Season 1: Red Light, Green Light","2021-10-03"

Thank you!

Titles that caused errors

The movies/shows caused the error below, there were more but i stopped notating as there didnt seem to be any rhyme or reason.

  • Jeopardy!: Tournament of Champions: Season 29: Quarterfinal Game 1
  • Homeward Bound: The Incredible Journey
  • David Blaine: What Is Magic?
  • Mystery Diners: Season 8: Bad Credit
  • Mystery Diners: Season 8: Employee Discount
  • Jay-Z: Bloomberg Game Changers

Traceback (most recent call last): File "Netflix-to-Trakt-Import\netflix2trakt.py", line 103, in <module> tmdbResult = tmdbSeason.details(tv_id=showId, season_num=season.number, append_to_response="translations") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "tmdbv3api\objs\season.py", line 29, in details return AsObj( ^^^^^^ File "\tmdbv3api\as_obj.py", line 9, in __init__ raise TMDbException(entries["status_message"]) tmdbv3api.exceptions.TMDbException: The resource you requested could not be found.

time data error from ViewingActivity

i try to import my data from the ViewingActivity.cvs so the one which you get by request your data from netflix after you already canceld. I coulnd't find another .csv file in the files from netflix which contains all the viewingactivity.

it is formated like:
USERNAME,2022-10-17 23:42:00,00:43:26,,DAHMER: Monster: The Jeffrey Dahmer Story: The Good Boy Box (Episode 4),,Netflix Windows App - Cadmium Windows Mobile,00:41:19,Not latest view,DE (Germany)
USERNAME,2022-10-17 23:19:14,00:22:36,,DAHMER: Monster: The Jeffrey Dahmer Story: Doin' A Dahmer (Episode 3),,Netflix Windows App - Cadmium Windows Mobile,00:50:12,00:50:12,DE (Germany)

the programm runs like this:
C:\Users\x\Desktop\watchhistory\Netflix-to-Trakt-Import-master>python netflix2trakt.py
Traceback (most recent call last):
File "C:\Users\x\Desktop\watchhistory\Netflix-to-Trakt-Import-master\NetflixTvShow.py", line 158, in addWatchedDate
time = datetime.datetime.strptime(watchedDate + " 20:15", config.CSV_DATETIME_FORMAT + " %H:%M")
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib_strptime.py", line 352, in _strptime
raise ValueError("unconverted data remains: %s" %
ValueError: unconverted data remains: :34 20:15

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\x\Desktop\watchhistory\Netflix-to-Trakt-Import-master\netflix2trakt.py", line 40, in
netflixHistory.addEntry(entry, watchedAt)
File "C:\Users\x\Desktop\watchhistory\Netflix-to-Trakt-Import-master\NetflixTvShow.py", line 95, in addEntry
self.addMovieEntry(entryTitle, entryDate)
File "C:\Users\x\Desktop\watchhistory\Netflix-to-Trakt-Import-master\NetflixTvShow.py", line 123, in addMovieEntry
movie.addWatchedDate(watchedDate)
File "C:\Users\x\Desktop\watchhistory\Netflix-to-Trakt-Import-master\NetflixTvShow.py", line 162, in addWatchedDate
time = datetime.datetime.strptime(watchedDate + " 20:15", "%m.%d.%y %H:%M")
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2023.02.14.21.31.34 20:15' does not match format '%m.%d.%y %H:%M'

I've tried "%Y-%m-%d", vice versa, with and without capital Y and with dots istead of -

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.