The Wayback Machine - https://web.archive.org/web/20201128184828/https://github.com/pymedusa/tvdbv2
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

readme.md

medusa-name-logo-green-snakes

A tvdb version2 API client, generated using swagger's codegen

Usage

  • For ease of demonstration i've configured the following variables before going into the API's methods.
base_url = 'https://api.thetvdb.com'
client_id = 'username' # (optional! Only required for the /user routes)
client_secret = 'pass' # (optional! Only required for the /user routes)
apikey = "0629B785CE550C8D"
  • Import the tvdbapiv2 package
import tvdbapiv2
  • Setup the authentication string thats needed later:
authentication_string = {"apikey":apikey, "username":"", "userpass":""}
  • Create a unauthenticated client instance:
unauthenticated_client = tvdbapiv2.ApiClient(base_url)
  • Create an AuthenticationApi object instance
auth_api = tvdbapiv2.AuthenticationApi(unauthenticated_client)
  • Get the Bearer token using the authentication_string
access_token = auth_api.login_post(authentication_string)
  • Setup the authenticated client instance:
auth_client = tvdbapiv2.ApiClient(base_url, 'Authorization', 'Bearer ' + access_token.token)
  • Now your able to use the API's query endpoints like:
tvdbapiv2.SearchApi(auth_client).search_series_get(name='Breaking Bad')
tvdbapiv2.SeriesApi(auth_client).series_id_get(80379)

About

A tvdbv2 swagger python client, build using swagger codegen

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.