Added API key for TVDB to the config file
This commit is contained in:
parent
903b9e926c
commit
29ee3d64fd
2 changed files with 11 additions and 6 deletions
|
@ -28,7 +28,8 @@ if not os.path.exists('config'):
|
|||
"acls": {},
|
||||
"api_keys":
|
||||
{
|
||||
"geoip": "INSERT KEY FROM ipinfodb.com HERE",
|
||||
"geoip": "INSERT API KEY FROM ipinfodb.com HERE",
|
||||
"tvdb": "INSERT API KEY FROM thetvdb.com HERE",
|
||||
"bitly_user": "INSERT USERNAME FROM bitly.com HERE",
|
||||
"bitly_api": "INSERT API KEY FROM bitly.com HERE",
|
||||
"mc_user": "INSERT MINECRAFT USERNAME HERE (used to check login servers in mclogin.py)",
|
||||
|
|
|
@ -25,7 +25,7 @@ def get_zipped_xml(*args, **kwargs):
|
|||
return etree.parse(ZipFile(zip_buffer, "r").open(path))
|
||||
|
||||
|
||||
def get_episodes_for_series(seriesname):
|
||||
def get_episodes_for_series(seriesname, api_key):
|
||||
res = {"error": None, "ended": False, "episodes": None, "name": None}
|
||||
# http://thetvdb.com/wiki/index.php/API:GetSeries
|
||||
try:
|
||||
|
@ -84,9 +84,11 @@ def get_episode_info(episode):
|
|||
|
||||
@hook.command
|
||||
@hook.command('tv')
|
||||
def tv_next(inp):
|
||||
def tv_next(inp, bot = None):
|
||||
".tv_next <series> -- get the next episode of <series>"
|
||||
episodes = get_episodes_for_series(inp)
|
||||
|
||||
api_key = bot.config["api_keys"]["tvdb"]
|
||||
episodes = get_episodes_for_series(inp, api_key)
|
||||
|
||||
if episodes["error"]:
|
||||
return episodes["error"]
|
||||
|
@ -130,9 +132,11 @@ def tv_next(inp):
|
|||
|
||||
@hook.command
|
||||
@hook.command('tv_prev')
|
||||
def tv_last(inp):
|
||||
def tv_last(inp, bot = None):
|
||||
".tv_last <series> -- gets the most recently aired episode of <series>"
|
||||
episodes = get_episodes_for_series(inp)
|
||||
|
||||
api_key = bot.config["api_keys"]["tvdb"]
|
||||
episodes = get_episodes_for_series(inp, api_key)
|
||||
|
||||
if episodes["error"]:
|
||||
return episodes["error"]
|
||||
|
|
Reference in a new issue