Skip to content

A tvdbv2 swagger python client, build using swagger codegen

License

Notifications You must be signed in to change notification settings

pymedusa/tvdbv2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Stars

Watchers

Forks

Packages

No packages published

Languages