2022-05-25 20:10:43 +02:00
|
|
|
import subprocess
|
2022-05-16 16:09:17 +02:00
|
|
|
import sys
|
|
|
|
|
2022-05-25 20:10:43 +02:00
|
|
|
from mangadlp.input import get_args
|
|
|
|
|
2022-05-20 20:56:40 +02:00
|
|
|
mangadlp_version = "2.1.2"
|
2022-05-16 16:09:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
def get_input():
|
2022-05-25 22:25:04 +02:00
|
|
|
print(f"manga-dlp version: {mangadlp_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): "))
|
2022-05-25 20:10:43 +02:00
|
|
|
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:
|
2022-05-25 20:10:43 +02:00
|
|
|
sys.exit(1)
|
2022-05-16 16:09:17 +02:00
|
|
|
except:
|
|
|
|
continue
|
|
|
|
else:
|
|
|
|
break
|
2022-05-25 20:10:43 +02:00
|
|
|
|
|
|
|
args = [
|
|
|
|
"python3",
|
|
|
|
"manga-dlp.py",
|
|
|
|
"-l",
|
|
|
|
language,
|
|
|
|
"-c",
|
|
|
|
chapters,
|
|
|
|
]
|
2022-05-16 16:09:17 +02:00
|
|
|
if url_uuid:
|
2022-05-25 20:10:43 +02:00
|
|
|
args.append("-u")
|
|
|
|
args.append(url_uuid)
|
2022-05-16 16:09:17 +02:00
|
|
|
if readlist:
|
2022-05-25 20:10:43 +02:00
|
|
|
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
|
2022-05-25 20:10:43 +02:00
|
|
|
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()
|