dbr / tvnamer

Automatic TV episode file renamer, uses data from thetvdb.com via tvdb_api
https://pypi.python.org/pypi/tvnamer/
The Unlicense
907 stars 115 forks source link

Error: apikey argument is now required #182

Closed CWSpear closed 4 years ago

CWSpear commented 4 years ago

I'm getting an error when trying to run:

####################
# Starting tvnamer
# Found 92 episodes
Traceback (most recent call last):
  File "/usr/local/bin/tvnamer", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/tvnamer/main.py", line 449, in main
    tvnamer(paths = sorted(args))
  File "/usr/local/lib/python2.7/dist-packages/tvnamer/main.py", line 351, in tvnamer
    cache=cache,
  File "/usr/local/lib/python2.7/dist-packages/tvdb_api.py", line 681, in __init__
    raise ValueError("apikey argument is now required - an API key can be easily registered at https://thetvdb.com/api-information")
ValueError: apikey argument is now required - an API key can be easily registered at https://thetvdb.com/api-information

I see you added an API key ~3 months ago, but that doesn't seem to be released, at least in pip (it's not the version I get when I pip install tvnamer).

It also seems like we maybe should have a way to define an API key in the config, so we can use our own API key and not have to rely on a centralized one.

dbr commented 4 years ago

Ah, I didn't think of that - the current tvnamer wont work with the new tvdb_api version, but will pick it up because of the >= requirement..

I might need to release a patch version of the old tvnamer with the requirement pinned to the older tvdb_api which had the default key

dbr commented 4 years ago

Being able to use your own API key is a good idea also; I've split that into a separate ticket #183

dbr commented 4 years ago

I've released tvnamer 2.5.1 which should address this:

(tvntest) [dbr@slate:~]$ pip install tvnamer==2.5.0
(tvntest) [dbr@slate:~]$ touch lost.s01e01.avi
(tvntest) [dbr@slate:~]$ tvnamer lost.s01e01.avi
[...snip...]
ValueError: apikey argument is now required - an API key can be easily registered at https://thetvdb.com/api-information
(tvntest) [dbr@slate:~]$ pip install --upgrade tvnamer
[...snip...]
Successfully installed tvdb-api-2.0 tvnamer-2.5.1
(tvntest) [dbr@slate:~]$ tvnamer lost.s01e01.avi
[...snip...]
####################
Old filename: lost.s01e01.avi
New filename: Lost - [01x01] - Pilot (1).avi
Rename?
([y]/n/a/q)
CWSpear commented 4 years ago

Awesome, thanks!

dbr commented 4 years ago

No worries, oh and thanks for the report!