From c5398e6af59394a8870622458dff0aa9aeb6cb1e Mon Sep 17 00:00:00 2001 From: Administrator Date: Wed, 29 Apr 2020 10:27:18 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'notification.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notification.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/notification.py b/notification.py index 0fbd5e0..074c3c9 100644 --- a/notification.py +++ b/notification.py @@ -5,18 +5,19 @@ import logging import requests import json -from bot import login_beta, user_id, token_bot, client_id +from bot import user_id, token_bot, client_id +from betaseries import login_beta, create_api from telegram.ext import Updater, CommandHandler #Love Is War / Une serie pour tester le programme. thetvdb_id= '354198' -def create_api(choice): - if choice == 'latest' : - base_url = 'https://api.betaseries.com/episodes/latest?' - API = base_url + 'token=' + token + '&client_id=' + client_id + '&thetvdb_id=' + thetvdb_id - return API +# def create_api(choice): + # if choice == 'latest' : + # base_url = 'https://api.betaseries.com/episodes/latest?' + # API = base_url + 'token=' + token + '&client_id=' + client_id + '&thetvdb_id=' + thetvdb_id + # return API def check_latest(): API = create_api('latest') @@ -26,10 +27,7 @@ def check_latest(): show = request.json() episode = show['episode'] - ###Recuperation du titre title = episode['show'] - - print("Titre de la serie : ", str(title['title'])) # print("Episode : ", data[episode], " Saison : ", data[season] ) @@ -50,9 +48,6 @@ def main(): print("Pour arreter le script : CTRL+Z") check_latest() - # while 1 : - # #print(démarrage boucle) - # print("Boucle") print("Erreur ! Fin de la boucle")