dbr/tvdb_api

allow multiple values for 'language' language='de, en'

kasi45 opened this issue · 2 comments

Hello,
i like your project very much!

if you change their sourcecode a little bit, then it would be possible to pass multiple values for 'Accept-Language' in the header.

for lang in language.split(','):
    if lang not in self.config['valid_languages']:
        raise ValueError(
            "Invalid language %s, options are: %s"
            % (lang, self.config['valid_languages'])
        )

greetings
kasi45

dbr commented

Hmm, are you sure this works? The API docs say

https://api.thetvdb.com/swagger

TheTVDB API v3

Language selection is done via the Accept-Language header. At the moment, you may only pass one language abbreviation in the header at a time. Valid language abbreviations can be found at the /languages route..

Either way pull request #78 will remove that valid-language check stuff (instead deferring to letting TheTVDB itself error if passed something invalid), so this may work once those changes are merged

dbr commented

Closing - with the upcoming tvdb_api==3.1 release the validation of language has been removed and deferred to thetvdb.com itself - when it starts supporting comma separated languages, this should work:

>>> t = tvdb_api.Tvdb(..., language='en,fr')