xbgmsharp / trakt

Import CSV to Trakt.tv list and Export Trakt.tv list into CSV

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

{Bug} Error in export script while exporting collection

hmoghani opened this issue · comments

I encountered an error while I was trying to export my tv-shows collection into a csv file:

(trakt) $ python3 export_trakt.py -o collection.csv -f trakt -l collection -V
Options: Namespace(config='config.ini', output='collection.csv', format='trakt', type='movies', list='collection', userlist=None, listid=None, clean=False, dup=False, sortorder='desc', verbose=True)
Config file: config.ini
Config: <configparser.ConfigParser object at 0x103062cd0>
Trakt, skipped access token refresh, token is less than 30 days, only 0:15:37.121335
Trakt: {'client_id': 'xxxx', 'client_secret': 'xxxx', 'access_token': 'xxxx', 'refresh_token': 'xxxx', 'baseurl': 'https://api-v2launch.trakt.tv'}
Authorization header: Bearer xxxx
trakt-api-key header: xxxx
https://api-v2launch.trakt.tv/sync/collection/movies?page=1&limit=1000
Traceback (most recent call last):
  File "/Users/xxx/git/trakt/export_trakt.py", line 605, in <module>
    main()
  File "/Users/xxx/git/trakt/export_trakt.py", line 460, in main
    export_data = api_get_list(options, 1)
  File "/Users/xxx/git/trakt/export_trakt.py", line 233, in api_get_list
    if int(r.headers['X-Pagination-Page-Count']) == 0:
  File "/Users/xxx/git/trakt/trakt/lib/python3.9/site-packages/requests/structures.py", line 54, in __getitem__
    return self._store[key.lower()][1]
KeyError: 'x-pagination-page-count'