|
|
|
@@ -6,7 +6,8 @@ conn = sqlite3.connect('database.db') |
|
|
|
cursor = conn.cursor() |
|
|
|
|
|
|
|
def main(): |
|
|
|
print("Pas de fonction Main") |
|
|
|
#print("Pas de fonction Main") |
|
|
|
update_manga(31477) |
|
|
|
|
|
|
|
def update_manga(id): |
|
|
|
url = get_url(id) |
|
|
|
@@ -17,14 +18,16 @@ def update_manga(id): |
|
|
|
rows = cursor.fetchall() |
|
|
|
# Last_chapt est le dernier chapitre sauvegardé |
|
|
|
last_chapt = str(rows[0][0]) |
|
|
|
|
|
|
|
new_chapt = get_last_chap(url) |
|
|
|
print("Mise a jour de %s" % get_title(url)) |
|
|
|
print("Le dernier chapitre est %s" % last_chapt) |
|
|
|
print("Le dernier chapitre enregistre est %s" % get_last_chap(url)) |
|
|
|
print("Le dernier chapitre sur mangadex est %s" % new_chapt) |
|
|
|
|
|
|
|
if int(last_chapt) == int(get_last_chap(url)) : |
|
|
|
if int(last_chapt) == int(new_chapt) : |
|
|
|
print("Nous sommes a jour") |
|
|
|
else : |
|
|
|
print("Pas a jour ! Le dernier chapitre est %s " ) |
|
|
|
print("Pas a jour ! Le dernier chapitre est %s " % ) |
|
|
|
cursor.execute("UPDATE manga SET chap = '{}' WHERE id = '{}'".format(get_last_chap(url), get_id(url))) |
|
|
|
conn.commit() |
|
|
|
|
|
|
|
|