|
|
|
@@ -5,26 +5,28 @@ import sqlite3 |
|
|
|
conn = sqlite3.connect('database.db') |
|
|
|
cursor = conn.cursor() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
|
print("Pas de fonction Main") |
|
|
|
|
|
|
|
def update_manga(id): |
|
|
|
url = get_url(id) |
|
|
|
# On récupère l'URL |
|
|
|
|
|
|
|
cursor.execute("SELECT chap FROM manga WHERE id = '%s'" % id) |
|
|
|
|
|
|
|
rows = cursor.fetchall() |
|
|
|
# Last_chapt est le dernier chapitre sauvegardé |
|
|
|
last_chapt = str(rows[0][0]) |
|
|
|
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)) |
|
|
|
|
|
|
|
if int(last_chapt) == get_last_chap(url) : |
|
|
|
if int(last_chapt) == int(get_last_chap(url)) : |
|
|
|
print("Nous sommes a jour") |
|
|
|
else : |
|
|
|
print("Pas a jour ! :c ") |
|
|
|
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() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
update_manga(31477) |
|
|
|
if __name__ == '__main__': |
|
|
|
main() |