This repository has been archived on 2020-10-28. You can view files and clone it, but cannot push or open issues/pull-requests.

33 lines
1.4 KiB
Executable File

import mangadex
import argparse
import os
argparser = argparse.ArgumentParser()
argparser.add_argument("url", help="the manga URL. Can be a mangadex chapter (/chapter/) or manga series (/title/) URL.")
argparser.add_argument("-l","--language","--lang", help="the language code to download chapters in. Only relevent to series URLs.", default=None)
argparser.add_argument("-c","--chapterrange", help="the range of chapters to download, in \"start,end\" format. Only relevent to manga series URLs.", default=None)
argparser.add_argument("-g","--group", help="the transation group to download chapters from. This is a group ID not a group name. Only relevent to manga series URLs.", default=None)
argparser.add_argument("-o","--output", help="output directory", default=None)
args = argparser.parse_args()
split_url = args.url.split("/")
if args.chapterrange != None:
csplit = [int(x) for x in args.chapterrange.split(',')]
crange = range(csplit[0],csplit[1]+1)
crange = None
if args.output != None:
for t in range(len(split_url)):
if split_url[t] == "chapter":
if split_url[t] == "title":
g = mangadex.get_chapters(split_url[t+1], args.language,, crange)
for cid in g:
print("DOWNLOADING CHAPTER: " + cid)