|
|
|
@@ -166,18 +166,25 @@ def to_see(thetvdb_id): |
|
|
|
print(u"Vous etes à jour") |
|
|
|
return False |
|
|
|
|
|
|
|
def seen(thetvdb_id): |
|
|
|
def seen(thetvdb_id, mode): |
|
|
|
# Permet de mettre un episode en 'vu' sur betaseries |
|
|
|
print(u"Ajout d'un episode à la liste des vu") |
|
|
|
file_path = 'latest/' + thetvdb_id + '.json' |
|
|
|
|
|
|
|
with open(file_path) as json_file: |
|
|
|
data = json.load(json_file) |
|
|
|
if data['seen'] == True : |
|
|
|
send_message('Episode deja vu') |
|
|
|
return |
|
|
|
API = create_api('seen', None) |
|
|
|
API += str(data['id']) |
|
|
|
|
|
|
|
if mode == 'latest' : |
|
|
|
file_path = 'latest/' + thetvdb_id + '.json' |
|
|
|
|
|
|
|
with open(file_path) as json_file: |
|
|
|
data = json.load(json_file) |
|
|
|
if data['seen'] == True : |
|
|
|
send_message('Episode deja vu') |
|
|
|
return |
|
|
|
API += str(data['id']) |
|
|
|
|
|
|
|
if mode == 'watched' : |
|
|
|
API += str(thetvdb_id) |
|
|
|
|
|
|
|
|
|
|
|
print(API) |
|
|
|
request = requests.post(API) |
|
|
|
if str(request) == '<Response [400]>' : |
|
|
|
@@ -247,8 +254,7 @@ def what_2see(): |
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
|
path = "series/102261.json" |
|
|
|
print(get_ep_code_series(path)) |
|
|
|
print("Nothing to do here") |
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
|