Skip to content
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

Unable to import Trakt list from csv (AttributeError: csv_time) #2

Closed
ExDominatus opened this issue Jun 14, 2021 · 9 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@ExDominatus
Copy link

ExDominatus commented Jun 14, 2021

Hi there, first time using the script, and I'm fairly sure I did everything correctly but am still unable to add movies to a list. Authentication, and exporting are confirmed working.

Goal: Create trakt list (not watchlist) from list of imdb ids in a csv, formatted like below:

imdb
tt0044486
tt0064904
tt0081617
tt0082533
tt0082118

I was originally trying with https://github.com/xbgmsharp/trakt, but came here from your comment on this issue: xbgmsharp/trakt#9. In your instructions, I was unsure what this means, since there was no example csv given:

The following command will import all movies in m.csv to a custom user list using the trakt id columns specified in m.csv

What trakt ids am I specific? trakt movie ids?

Is this possible with imdb ids? Or am I misunderstanding? The goal is to move over lists from an external service which provides imdb/tmdb ids into Trakt.

While running the script with the below command, I get this error:

python3 import_trakt.py -c config.ini -f imdb -i listofmovies.csv -t movies -u

Traceback (most recent call last):
File "import_trakt.py", line 515, in
main()
File "import_trakt.py", line 436, in main
row_time = myid[options.csv_time]
AttributeError: 'Namespace' object has no attribute 'csv_time'

@ourtv
Copy link

ourtv commented Jun 17, 2021

While trying to import to either standard list or user list I get this error:

Traceback (most recent call last):
File "C:\trakt\import_trakt.py", line 515, in
main()
File "C:\trakt\import_trakt.py", line 398, in main
read_ids = read_csv(options)
File "C:\trakt\import_trakt.py", line 88, in read_csv
return list(reader)
File "C:\Users\Media\AppData\Local\Programs\Python\Python39\lib\csv.py", line 110, in next
self.fieldnames
File "C:\Users\Media\AppData\Local\Programs\Python\Python39\lib\csv.py", line 97, in fieldnames
self._fieldnames = next(self.reader)
File "C:\Users\Media\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 0x81 in position 8173: character maps to

When using a user list it does not matter what list number I give it. It always attempts to use the last list.

@andrewchenk
Copy link
Owner

andrewchenk commented Jun 23, 2021

@ExDominatus
I think the script expects a watched_at or listed_at column from your csv, although this may be incorrect behavior (I don't think user lists require that information). Importing should be entirely possible with imdb ids, although you might get some wrong entries due to trakt having the wrong imdb ids listed.

Are you trying to import to a user list? Also for an example csv, if you can export a csv using this tool that should be a good example csv, since I tested by importing and exporting the same csv. Even if it's not relevant at all, try creating a listed_at column with some dummy value like 2020-05-29T08:44:24.000Z.

I'm working on patching this asap.

@andrewchenk
Copy link
Owner

@ourtv
I believe something is wrong with the csv encoding. Make sure that it's UTF-8.

@andrewchenk andrewchenk self-assigned this Jun 23, 2021
@andrewchenk
Copy link
Owner

andrewchenk commented Jun 23, 2021

@ExDominatus Please let me know if the issue is fixed. Added some csv examples to illustrate what the format should look like.

@andrewchenk andrewchenk reopened this Jun 23, 2021
@andrewchenk andrewchenk added the bug Something isn't working label Jun 23, 2021
@ourtv
Copy link

ourtv commented Jun 28, 2021

@ourtv
I believe something is wrong with the csv encoding. Make sure that it's UTF-8.

I was trying to load a CVS file from an export of collection. I tried importing history and it worked fine but when I try to import collection it errors out. I tried loading it in Note++ changing encoding then changing it back to UTF-8 and saving as a different file but no go.

@andrewchenk
Copy link
Owner

Mind giving me your csv file? I'll take a look because I can't reproduce this error.

@andrewchenk
Copy link
Owner

Closing this issue for now, let me know if it's not resolved.

@ourtv
Copy link

ourtv commented Jul 7, 2021

Sorry for my tardy response but here is the CVS and a screen shot of the creation and attempted import commands in case I am a complete noob.

m.zip

@andrewchenk
Copy link
Owner

andrewchenk commented Jul 18, 2021

@ourtv
No worries, sorry for my tardy response. I'm opening a new issue, I'll look in to this asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants