Un serveur permettant de récupérer à quelle manga on s'est arrêté d'une licence. Un script se chargera de récupérer automatiquement les derniers mangas à jour à l'aide du site MangaDex
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 2 недеља
пре 2 недеља
пре 2 недеља
пре 2 недеља
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import sqlite3, sys
  2. from database import *
  3. conn = sqlite3.connect('database.db')
  4. cursor = conn.cursor()
  5. def get_last_read(uid, mid):
  6. cursor.execute("SELECT chap FROM readings WHERE uid = '{}' AND mid = '{}';".format(uid, mid) )
  7. rows = cursor.fetchall()
  8. return rows[0][0]
  9. def chapter_read_manual(uid, mid, chap):
  10. username = get_dbusername(uid)
  11. title = get_dbtitle(mid)
  12. print("User : %s" % str(username))
  13. print("Manga : %s" % str(mid))
  14. print("Chapter : %s" % str(chap))
  15. rows = cursor.fetchall()
  16. print("Last Chap: %s " % get_last_read(uid, mid) )
  17. if str(get_last_read(uid, mid)) == str(chap) :
  18. print("Vous avez deja lu ce chapitre")
  19. else :
  20. print("Vous n'avez pas vu le chapitre {} du manga {}".format(chap, title))
  21. cursor.execute("UPDATE readings SET chap = '{}' WHERE mid = '{}' AND uid = '{}';".format(chap, mid, uid) )
  22. conn.commit()
  23. def main():
  24. uid = input("UserID : ")
  25. mid = input("MangaID : ")
  26. chap = input("Chap : ")
  27. chapter_read_manual(uid, mid, chap)
  28. if __name__ == '__main__':
  29. main()