-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
time data error from ViewingActivity #30
Comments
Just a quick answer as I'm currently only on mobile. It seems the csv from you has more entries than the normal one you get when you can still login (not inactive). Yours has username and device information. The script currently does not support that. Some regex expressions need to be adapted for that. I guess one could implement a option for that kind of csv files as well. Should not be super hard to do, maybe I find some time at the weekend |
I got this error too, i really really hope it gets fixed as im slowly syncing and its painful. |
Could you please? :p |
If someone can provide me with a sample csv from an export of an inactive account that contains a few entries (both series and movies would be good) then I can try to implement a version for that. |
ok i just randomly took some movies and tv shows throughout my history. Hope it helps: |
Thanks @KalleIstKool , I try to implement a version for that as soon as possible. |
Follow-up question: Has the file a header (like Username, date, ...) with a description of the fields? That would be helpful to parse the data :) |
thank you so much for your help :) it actually has a header: |
Ok, so here is a sample code that would read the data from the file:
For testing replace the code in netflix2trakt.py that starts at the csvReader line with the above code (line 34). A few things to note:
However, the above code should already work for most use cases, here is the output from the script when you replace the code in netflix2trakt (set CSV_DATETIME_FORMAT = "%Y-%m-%d" in the config):
We can see that Transformers is added twice to trakt due to the different dates. Maybe a filter to skip everything below 5min would be useful. However, one could also start a movie on one day and watch half of it and finish the next half the next day. The previous Netflix log would just export 1 row for it, here it would be two. These are harder to filter out and definitely require more code. Good ideas are welcome :) I will integrate the above code into the main repo at some point as well with a config option labeled as experimental. It should already work for a lot of the entries. Feel free to try it already and give some feedback :) |
ViewingActivity.csv |
@Pleasant-exe Thanks, above mentioned code (previous comment) should work for you as well. In your csv we have the same problem of multiple starts of one episode. By omitting the time info as done in my sample code and setting 20:15 as the default it should work for your file because the different starts are at the same day and would be ignored. @Pleasant-exe + @KalleIstKool : You can also try the script and set "TRAKT_API_DRY_RUN = True" in the config. This way you will see more of what would be added to Trakt without actually sending it. |
i noticed you pushed an update, is that this? |
hey, it lists all shows but ends with
|
I updated to the latest version with your code above and got the following
Without modify
With my previous comment it was the older version with the code you mentioned above . |
The latest update was regarding a different issue. The "skipping track sync" output indicates that you set the TRAKT_DRY_RUN to true. This is the expected behavior then, it's for testing purposes without the need to send the final data. If you set it to false it should already work. I will look into your errors with the new code and will link related commits here. I'm quite busy currently, so it might take a few days, but there will be a option in the config eventually :) |
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 -
The text was updated successfully, but these errors were encountered: