manga-dlp/manga-dlp.py

53 lines
1.3 KiB
Python
Raw Normal View History

import subprocess
2022-05-16 16:09:17 +02:00
import sys
from mangadlp.input import get_args
2022-06-21 21:32:25 +02:00
MDLP_VERSION = "2.1.6"
2022-05-16 16:09:17 +02:00
def get_input():
2022-06-21 17:22:43 +02:00
print(f"manga-dlp version: {MDLP_VERSION}")
2022-05-16 16:09:17 +02:00
print("Enter details of the manga you want to download:")
while True:
try:
url_uuid = str(input("Url or UUID: "))
readlist = str(input("List with links (optional): "))
language = str(input("Language: ")) or "en"
list_chapters = str(input("List chapters? y/N: "))
if list_chapters.lower() != "y" or list_chapters.lower() != "yes":
chapters = str(input("Chapters: "))
2022-05-16 16:09:17 +02:00
except KeyboardInterrupt:
sys.exit(1)
2022-05-16 16:09:17 +02:00
except:
continue
else:
break
args = [
"python3",
"manga-dlp.py",
"-l",
language,
"-c",
chapters,
]
2022-05-16 16:09:17 +02:00
if url_uuid:
args.append("-u")
args.append(url_uuid)
2022-05-16 16:09:17 +02:00
if readlist:
args.append("--read")
args.append(readlist)
if list_chapters.lower() == "y" or list_chapters.lower() == "yes":
args.append("--list")
2022-05-16 16:09:17 +02:00
# start script again with the arguments
subprocess.call(args)
2021-12-19 17:20:34 +01:00
2022-05-04 19:17:12 +02:00
if __name__ == "__main__":
2022-05-16 16:09:17 +02:00
if len(sys.argv) > 1:
get_args()
else:
get_input()