Support for #11
Read the Changelog for more information and also do check the ReadMe for updated commands.
This commit is contained in:
parent
d171c79883
commit
1694932d1d
1
.gitignore
vendored
1
.gitignore
vendored
@ -67,3 +67,4 @@ Temporary Items
|
||||
*.spec
|
||||
comic_dl/Logo.ico
|
||||
comic_dl/build/__main__/warn__main__.txt
|
||||
*.old
|
||||
|
@ -35,4 +35,5 @@
|
||||
- Downloader now prints file size, internet speed [2017.06.12]
|
||||
- Added Support for [ac.qq.com](http://ac.qq.com) [2017.06.15]
|
||||
- Fix for #23 [2017.06.30]
|
||||
- Custom Download Location Support Added (#20) [2017.06.30]
|
||||
- Custom Download Location Support Added (#20) [2017.06.30]
|
||||
- Support to download only selected chapters (range) [2017.07.06]
|
@ -139,9 +139,12 @@ Currently, the script supports these arguments :
|
||||
-v,--verbose Enables Verbose logging.
|
||||
--sorting Sorts the download order.(VALUES = asc, ascending,old,new,desc,descending,latest,new)
|
||||
-dd,--download-directory Specifies custom download location for the comics/manga.
|
||||
-rn,--range Selects the range of Chapters to download (Default = All) [ Ex : --range 1-10 (This will download first 10 episodes of a series)]
|
||||
```
|
||||
#### Note :
|
||||
Some websites like bato.to don't let you view some pages if you're not logged in. You'll have to create an account and pass the login information to the script via `-p` and `-u` arguments.
|
||||
1.) Some websites like bato.to don't let you view some pages if you're not logged in. You'll have to create an account and pass the login information to the script via `-p` and `-u` arguments.
|
||||
|
||||
2.) Since omgbeaupeep is uh... well, you just need to pass the absolute chapter numbers in the range section for that. For eg : Check out [Richie Rich](http://www.omgbeaupeep.com/comics/Richie_Rich/647/). If you want to download first 600 episodes, you would pass : --range 001-600. Just check the URLs for those chapters and pass accordingly.
|
||||
|
||||
## Youtube Tutorial
|
||||
[![Check The YouTube Tutorial](https://img.youtube.com/vi/TmQYhLHEZxA/0.jpg)](https://www.youtube.com/watch?v=TmQYhLHEZxA)
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
__version__ = "2017.06.30"
|
||||
__version__ = "2017.07.06"
|
@ -19,6 +19,7 @@ class ComicDL(object):
|
||||
parser.add_argument('--version', action='store_true', help='Shows version and exits.')
|
||||
parser.add_argument('-s', '--sorting', nargs=1, help='Decides downloading order of chapters.')
|
||||
parser.add_argument('-dd', '--download-directory', nargs=1, help='Decides the download directory of the comics/manga.')
|
||||
parser.add_argument('-rn', '--range', nargs=1, help='Specifies the range of chapters to download.', default='All')
|
||||
|
||||
required_args = parser.add_argument_group('Required Arguments :')
|
||||
required_args.add_argument('-i', '--input', nargs=1, help='Inputs the URL to anime.')
|
||||
@ -56,10 +57,12 @@ class ComicDL(object):
|
||||
args.sorting = ["ascending"]
|
||||
if not args.download_directory:
|
||||
args.download_directory = [os.getcwd()]
|
||||
if type(args.range) == list:
|
||||
args.range = args.range[0]
|
||||
|
||||
start_time = time.time()
|
||||
honcho.Honcho().checker(comic_url=str(args.input[0]).strip(), current_directory=os.getcwd(),
|
||||
sorting_order=args.sorting[0], logger=logger, download_directory=args.download_directory[0])
|
||||
sorting_order=args.sorting[0], logger=logger, download_directory=args.download_directory[0], chapter_range=args.range)
|
||||
end_time = time.time()
|
||||
total_time = end_time - start_time
|
||||
print("Total Time Taken To Complete : %s" % total_time)
|
||||
|
@ -18,7 +18,7 @@ import globalFunctions
|
||||
|
||||
|
||||
class Honcho(object):
|
||||
def checker(self, comic_url, download_directory, **kwargs):
|
||||
def checker(self, comic_url, download_directory, chapter_range, **kwargs):
|
||||
|
||||
user_name = kwargs.get("username")
|
||||
password = kwargs.get("password")
|
||||
@ -37,7 +37,7 @@ class Honcho(object):
|
||||
|
||||
if domain in fool_slide:
|
||||
foolSlide.FoolSlide(manga_url=comic_url, logger=logging, current_directory=current_directory,
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory)
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory, chapter_range=chapter_range)
|
||||
return 0
|
||||
elif domain in ["www.readcomiconline.to", "readcomiconline.to"]:
|
||||
readcomicOnlineto.ReadComicOnlineTo(manga_url=comic_url, logger=logging,
|
||||
@ -45,27 +45,27 @@ class Honcho(object):
|
||||
return 0
|
||||
elif domain in ["www.comic.naver.com", "comic.naver.com"]:
|
||||
comicNaver.ComicNaver(manga_url=comic_url, logger=logging, current_directory=current_directory,
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory)
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory, chapter_range=chapter_range)
|
||||
return 0
|
||||
elif domain in ["www.mangahere.co", "mangahere.co"]:
|
||||
mangaHere.MangaHere(manga_url=comic_url, logger=logging, current_directory=current_directory,
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory)
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory, chapter_range=chapter_range)
|
||||
return 0
|
||||
elif domain in ["www.raw.senmanga.com", "raw.senmanga.com"]:
|
||||
rawSenManga.RawSenaManga(manga_url=comic_url, logger=logging, current_directory=current_directory,
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory)
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory, chapter_range=chapter_range)
|
||||
return 0
|
||||
elif domain in ["www.mangafox.me", "mangafox.me"]:
|
||||
mangaFox.MangaFox(manga_url=comic_url, logger=logging, current_directory=current_directory,
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory)
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory, chapter_range=chapter_range)
|
||||
return 0
|
||||
elif domain in ["www.omgbeaupeep.com", "omgbeaupeep.com"]:
|
||||
omgBeauPeep.OmgBeauPeep(manga_url=comic_url, logger=logging, current_directory=current_directory,
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory)
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory, chapter_range=chapter_range)
|
||||
return 0
|
||||
elif domain in ["www.ac.qq.com", "ac.qq.com"]:
|
||||
acQQ.AcQq(manga_url=comic_url, logger=logging, current_directory=current_directory,
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory)
|
||||
sorting_order=sorting, log_flag=log_flag, download_directory=download_directory, chapter_range=chapter_range)
|
||||
return 0
|
||||
elif domain in ["www.kissmanga.com", "kissmanga.com"]:
|
||||
# kissManga.KissManga(manga_url = comic_url, logger = logging, current_directory = current_directory, sorting_order = sorting)
|
||||
|
@ -9,7 +9,7 @@ Original code for ac.qq.com : https://github.com/abcfy2/getComic/
|
||||
"""
|
||||
|
||||
class AcQq(object):
|
||||
def __init__(self, manga_url, download_directory, **kwargs):
|
||||
def __init__(self, manga_url, download_directory, chapter_range, **kwargs):
|
||||
current_directory = kwargs.get("current_directory")
|
||||
self.logging = kwargs.get("log_flag")
|
||||
self.sorting = kwargs.get("sorting_order")
|
||||
@ -18,7 +18,7 @@ class AcQq(object):
|
||||
self.single_chapter(manga_url, self.comic_name, download_directory)
|
||||
else:
|
||||
self.full_series(comic_url=manga_url, comic_name=self.comic_name, sorting=self.sorting,
|
||||
download_directory=download_directory)
|
||||
download_directory=download_directory, chapter_range=chapter_range)
|
||||
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ class AcQq(object):
|
||||
globalFunctions.GlobalFunctions().downloader(image_link, file_name, comic_url, directory_path,
|
||||
log_flag=self.logging)
|
||||
|
||||
def full_series(self, comic_url, comic_name, sorting, download_directory, **kwargs):
|
||||
def full_series(self, comic_url, comic_name, sorting, download_directory, chapter_range, **kwargs):
|
||||
chapter_list = "http://m.ac.qq.com/GetData/getChapterList?id=" + str(comic_name)
|
||||
source, cookies = globalFunctions.GlobalFunctions().page_downloader(manga_url=chapter_list)
|
||||
content_json = json.loads(str(source))
|
||||
@ -82,6 +82,15 @@ class AcQq(object):
|
||||
all_links.append(chapter_url)
|
||||
|
||||
logging.debug("all_links : %s" % all_links)
|
||||
if chapter_range != "All":
|
||||
# -1 to shift the episode number accordingly to the INDEX of it. List starts from 0 xD!
|
||||
starting = int(str(chapter_range).split("-")[0]) - 1
|
||||
ending = int(str(chapter_range).split("-")[1])
|
||||
indexes = [x for x in range(starting, ending)]
|
||||
# [::-1] in sub_list in beginning to start this from the 1st episode and at the last, it is to reverse the list again, becasue I'm reverting it again at the end.
|
||||
all_links = [all_links[::-1][x] for x in indexes][::-1]
|
||||
else:
|
||||
all_links = all_links
|
||||
|
||||
if str(sorting).lower() in ['new', 'desc', 'descending', 'latest']:
|
||||
for chap_link in all_links:
|
||||
|
@ -8,14 +8,14 @@ import logging
|
||||
|
||||
|
||||
class ComicNaver(object):
|
||||
def __init__(self, manga_url, download_directory, **kwargs):
|
||||
def __init__(self, manga_url, download_directory, chapter_range, **kwargs):
|
||||
|
||||
current_directory = kwargs.get("current_directory")
|
||||
self.logging = kwargs.get("log_flag")
|
||||
self.sorting = kwargs.get("sorting_order")
|
||||
self.comic_name = self.name_cleaner(manga_url)
|
||||
if "list.nhn" in manga_url:
|
||||
self.full_series(manga_url, self.comic_name, self.sorting, download_directory)
|
||||
self.full_series(manga_url, self.comic_name, self.sorting, download_directory, chapter_range=chapter_range)
|
||||
|
||||
elif "detail.nhn" in manga_url:
|
||||
self.single_chapter(manga_url, self.comic_name, download_directory)
|
||||
@ -53,7 +53,7 @@ class ComicNaver(object):
|
||||
file_name = "0" + str(image_list.index(link)) + ".jpg" # 0 for #18 (Leading 0s)
|
||||
globalFunctions.GlobalFunctions().downloader(link, file_name, comic_url, directory_path, log_flag=self.logging)
|
||||
|
||||
def full_series(self, comic_url, comic_name, sorting, download_directory, **kwargs):
|
||||
def full_series(self, comic_url, comic_name, sorting, download_directory, chapter_range, **kwargs):
|
||||
source, cookies = globalFunctions.GlobalFunctions().page_downloader(manga_url=comic_url)
|
||||
# print(source)
|
||||
|
||||
@ -66,6 +66,17 @@ class ComicNaver(object):
|
||||
all_links.append(chapter_url)
|
||||
logging.debug("All Links : %s" % all_links)
|
||||
|
||||
# Uh, so the logic is that remove all the unnecessary chapters beforehand and then pass the list for further operations.
|
||||
if chapter_range != "All":
|
||||
# -1 to shift the episode number accordingly to the INDEX of it. List starts from 0 xD!
|
||||
starting = int(str(chapter_range).split("-")[0]) - 1
|
||||
ending = int(str(chapter_range).split("-")[1])
|
||||
indexes = [x for x in range(starting, ending)]
|
||||
# [::-1] in sub_list in beginning to start this from the 1st episode and at the last, it is to reverse the list again, becasue I'm reverting it again at the end.
|
||||
all_links = [all_links[::-1][x] for x in indexes][::-1]
|
||||
else:
|
||||
all_links = all_links
|
||||
|
||||
if str(sorting).lower() in ['new', 'desc', 'descending', 'latest']:
|
||||
for chap_link in all_links:
|
||||
self.single_chapter(comic_url=chap_link, comic_name=comic_name, download_directory=download_directory)
|
||||
|
@ -9,7 +9,7 @@ import logging
|
||||
|
||||
|
||||
class FoolSlide(object):
|
||||
def __init__(self, manga_url, download_directory, **kwargs):
|
||||
def __init__(self, manga_url, download_directory, chapter_range, **kwargs):
|
||||
|
||||
current_directory = kwargs.get("current_directory")
|
||||
self.logging = kwargs.get("log_flag")
|
||||
@ -18,7 +18,7 @@ class FoolSlide(object):
|
||||
self.manga_name = self.name_cleaner(manga_url)
|
||||
|
||||
if "/reader/series/" in manga_url:
|
||||
self.full_manga(manga_url=manga_url, comic_name=self.manga_name, sorting=self.sorting, download_directory=download_directory)
|
||||
self.full_manga(manga_url=manga_url, comic_name=self.manga_name, sorting=self.sorting, download_directory=download_directory, chapter_range=chapter_range)
|
||||
elif "/reader/read/" in manga_url:
|
||||
self.single_chapter(manga_url, self.manga_name, download_directory)
|
||||
|
||||
@ -69,7 +69,7 @@ class FoolSlide(object):
|
||||
|
||||
return anime_name
|
||||
|
||||
def full_manga(self, manga_url, comic_name, sorting, download_directory, **kwargs):
|
||||
def full_manga(self, manga_url, comic_name, sorting, download_directory, chapter_range, **kwargs):
|
||||
source, cookies = globalFunctions.GlobalFunctions().page_downloader(manga_url=manga_url)
|
||||
# print(source)
|
||||
chapter_text = source.findAll('div', {'class': 'title'})
|
||||
@ -82,6 +82,17 @@ class FoolSlide(object):
|
||||
all_links.append(url)
|
||||
logging.debug("All Links : %s" % all_links)
|
||||
|
||||
# Uh, so the logic is that remove all the unnecessary chapters beforehand and then pass the list for further operations.
|
||||
if chapter_range != "All":
|
||||
# -1 to shift the episode number accordingly to the INDEX of it. List starts from 0 xD!
|
||||
starting = int(str(chapter_range).split("-")[0]) - 1
|
||||
ending = int(str(chapter_range).split("-")[1])
|
||||
indexes = [x for x in range(starting, ending)]
|
||||
# [::-1] in sub_list in beginning to start this from the 1st episode and at the last, it is to reverse the list again, becasue I'm reverting it again at the end.
|
||||
all_links = [all_links[::-1][x] for x in indexes][::-1]
|
||||
else:
|
||||
all_links = all_links
|
||||
|
||||
if str(sorting).lower() in ['new', 'desc', 'descending', 'latest']:
|
||||
for chap_link in all_links:
|
||||
self.single_chapter(chapter_url=chap_link, comic_name=comic_name, download_directory=download_directory)
|
||||
|
@ -9,7 +9,7 @@ import time
|
||||
|
||||
|
||||
class MangaFox(object):
|
||||
def __init__(self, manga_url, download_directory, **kwargs):
|
||||
def __init__(self, manga_url, download_directory, chapter_range, **kwargs):
|
||||
|
||||
current_directory = kwargs.get("current_directory")
|
||||
self.logging = kwargs.get("log_flag")
|
||||
@ -18,7 +18,7 @@ class MangaFox(object):
|
||||
url_split = str(manga_url).split("/")
|
||||
|
||||
if len(url_split) is 6:
|
||||
self.full_series(comic_url=manga_url, comic_name=self.comic_name, sorting=self.sorting, download_directory=download_directory)
|
||||
self.full_series(comic_url=manga_url, comic_name=self.comic_name, sorting=self.sorting, download_directory=download_directory, chapter_range=chapter_range)
|
||||
else:
|
||||
self.single_chapter(manga_url, self.comic_name, download_directory)
|
||||
|
||||
@ -68,12 +68,23 @@ class MangaFox(object):
|
||||
|
||||
return 0
|
||||
|
||||
def full_series(self, comic_url, comic_name, sorting, download_directory, **kwargs):
|
||||
def full_series(self, comic_url, comic_name, sorting, download_directory, chapter_range, **kwargs):
|
||||
source, cookies = globalFunctions.GlobalFunctions().page_downloader(manga_url=comic_url)
|
||||
|
||||
all_links = re.findall(r"href=\"(.*?)\" title=\"Thanks for", str(source))
|
||||
logging.debug("All Links : %s" % all_links)
|
||||
|
||||
# Uh, so the logic is that remove all the unnecessary chapters beforehand and then pass the list for further operations.
|
||||
if chapter_range != "All":
|
||||
# -1 to shift the episode number accordingly to the INDEX of it. List starts from 0 xD!
|
||||
starting = int(str(chapter_range).split("-")[0]) - 1
|
||||
ending = int(str(chapter_range).split("-")[1])
|
||||
indexes = [x for x in range(starting, ending)]
|
||||
# [::-1] in sub_list in beginning to start this from the 1st episode and at the last, it is to reverse the list again, becasue I'm reverting it again at the end.
|
||||
all_links = [all_links[::-1][x] for x in indexes][::-1]
|
||||
else:
|
||||
all_links = all_links
|
||||
|
||||
if str(sorting).lower() in ['new', 'desc', 'descending', 'latest']:
|
||||
for chap_link in all_links:
|
||||
self.single_chapter(comic_url=str(chap_link), comic_name=comic_name)
|
||||
|
@ -8,7 +8,7 @@ import logging
|
||||
|
||||
|
||||
class MangaHere(object):
|
||||
def __init__(self, manga_url, download_directory, **kwargs):
|
||||
def __init__(self, manga_url, download_directory, chapter_range, **kwargs):
|
||||
|
||||
current_directory = kwargs.get("current_directory")
|
||||
self.logging = kwargs.get("log_flag")
|
||||
@ -18,7 +18,7 @@ class MangaHere(object):
|
||||
url_split = str(manga_url).split("/")
|
||||
|
||||
if len(url_split) is 6:
|
||||
self.full_series(comic_url=manga_url, comic_name=self.comic_name, sorting=self.sorting, download_directory=download_directory)
|
||||
self.full_series(comic_url=manga_url, comic_name=self.comic_name, sorting=self.sorting, download_directory=download_directory, chapter_range=chapter_range)
|
||||
else:
|
||||
self.single_chapter(manga_url, self.comic_name, download_directory)
|
||||
|
||||
@ -72,7 +72,7 @@ class MangaHere(object):
|
||||
|
||||
return anime_name
|
||||
|
||||
def full_series(self, comic_url, comic_name, sorting, download_directory, **kwargs):
|
||||
def full_series(self, comic_url, comic_name, sorting, download_directory, chapter_range,**kwargs):
|
||||
source, cookies = globalFunctions.GlobalFunctions().page_downloader(manga_url=comic_url)
|
||||
|
||||
all_links = re.findall(r"class=\"color_0077\" href=\"(.*?)\"", str(source))
|
||||
@ -87,6 +87,17 @@ class MangaHere(object):
|
||||
|
||||
logging.debug("All Links : %s" % all_links)
|
||||
|
||||
# Uh, so the logic is that remove all the unnecessary chapters beforehand and then pass the list for further operations.
|
||||
if chapter_range != "All":
|
||||
# -1 to shift the episode number accordingly to the INDEX of it. List starts from 0 xD!
|
||||
starting = int(str(chapter_range).split("-")[0]) - 1
|
||||
ending = int(str(chapter_range).split("-")[1])
|
||||
indexes = [x for x in range(starting, ending)]
|
||||
# [::-1] in sub_list in beginning to start this from the 1st episode and at the last, it is to reverse the list again, becasue I'm reverting it again at the end.
|
||||
chapter_links = [chapter_links[::-1][x] for x in indexes][::-1]
|
||||
else:
|
||||
chapter_links = chapter_links
|
||||
|
||||
if str(sorting).lower() in ['new', 'desc', 'descending', 'latest']:
|
||||
for chap_link in chapter_links:
|
||||
self.single_chapter(comic_url=str(chap_link), comic_name=comic_name, download_directory=download_directory)
|
||||
|
@ -8,13 +8,20 @@ import logging
|
||||
|
||||
|
||||
class OmgBeauPeep(object):
|
||||
def __init__(self, manga_url, download_directory, **kwargs):
|
||||
def __init__(self, manga_url, download_directory, chapter_range, **kwargs):
|
||||
|
||||
current_directory = kwargs.get("current_directory")
|
||||
self.logging = kwargs.get("log_flag")
|
||||
self.sorting = kwargs.get("sorting_order")
|
||||
self.comic_name = self.name_cleaner(manga_url)
|
||||
self.single_chapter(manga_url, self.comic_name, download_directory)
|
||||
|
||||
# Since this website doesn't seem to have a dedicated page for series, I need to make a function just for the sake of range, huh. *sigh*
|
||||
# You need to pass the ABSOLUTE chapter number for this website though. Otherwise, it'll generate wrong links to chapter and won't download anything.
|
||||
# Please spare me such hard work.
|
||||
if chapter_range != "All":
|
||||
self.range_maker(manga_url=manga_url, chapter_range=chapter_range, download_directory=download_directory)
|
||||
else:
|
||||
self.single_chapter(manga_url, self.comic_name, download_directory)
|
||||
|
||||
def name_cleaner(self, url):
|
||||
initial_name = str(url).split("/")[4].strip()
|
||||
@ -49,3 +56,12 @@ class OmgBeauPeep(object):
|
||||
logging.debug("Chapter Url : %s" % chapter_url)
|
||||
logging.debug("Image Link : %s" % image_link)
|
||||
globalFunctions.GlobalFunctions().downloader(image_link, file_name, chapter_url, directory_path, log_flag=self.logging)
|
||||
|
||||
def range_maker(self, manga_url, chapter_range, download_directory):
|
||||
starting = int(str(chapter_range).split("-")[0])
|
||||
ending = int(str(chapter_range).split("-")[1])
|
||||
for comic_chapter in range(starting, ending):
|
||||
chapter_number = str(manga_url).split("/")[5].strip()
|
||||
# Dirty Hack, 'cause I'm a HackerMan! (Dumb Joke)
|
||||
new_url = str(manga_url).replace(str(chapter_number), str(comic_chapter))
|
||||
self.single_chapter(new_url, self.comic_name, download_directory)
|
@ -8,7 +8,7 @@ import logging
|
||||
|
||||
|
||||
class RawSenaManga(object):
|
||||
def __init__(self, manga_url, download_directory, **kwargs):
|
||||
def __init__(self, manga_url, download_directory, chapter_range, **kwargs):
|
||||
current_directory = kwargs.get("current_directory")
|
||||
self.logging = kwargs.get("log_flag")
|
||||
self.sorting = kwargs.get("sorting_order")
|
||||
@ -16,7 +16,7 @@ class RawSenaManga(object):
|
||||
url_split = str(manga_url).split("/")
|
||||
|
||||
if len(url_split) is 5:
|
||||
self.full_series(comic_url=manga_url, comic_name=self.comic_name, sorting=self.sorting, download_directory=download_directory)
|
||||
self.full_series(comic_url=manga_url, comic_name=self.comic_name, sorting=self.sorting, download_directory=download_directory, chapter_range=chapter_range)
|
||||
else:
|
||||
self.single_chapter(manga_url, self.comic_name, download_directory)
|
||||
|
||||
@ -62,7 +62,7 @@ class RawSenaManga(object):
|
||||
cookies=cookies_main, log_flag=self.logging)
|
||||
return 0
|
||||
|
||||
def full_series(self, comic_url, comic_name, sorting, download_directory, **kwargs):
|
||||
def full_series(self, comic_url, comic_name, sorting, download_directory, chapter_range, **kwargs):
|
||||
series_name_raw = str(comic_url).split("/")[3].strip()
|
||||
source, cookies = globalFunctions.GlobalFunctions().page_downloader(manga_url=comic_url)
|
||||
# a href="/Flying-Witch-Ishizuka-Chihiro/34/1"
|
||||
@ -71,6 +71,17 @@ class RawSenaManga(object):
|
||||
all_links = list(re.findall(link_regex, str(source)))
|
||||
logging.debug("All Links : %s" % all_links)
|
||||
|
||||
# Uh, so the logic is that remove all the unnecessary chapters beforehand and then pass the list for further operations.
|
||||
if chapter_range != "All":
|
||||
# -1 to shift the episode number accordingly to the INDEX of it. List starts from 0 xD!
|
||||
starting = int(str(chapter_range).split("-")[0]) - 1
|
||||
ending = int(str(chapter_range).split("-")[1])
|
||||
indexes = [x for x in range(starting, ending)]
|
||||
# [::-1] in sub_list in beginning to start this from the 1st episode and at the last, it is to reverse the list again, becasue I'm reverting it again at the end.
|
||||
all_links = [all_links[::-1][x] for x in indexes][::-1]
|
||||
else:
|
||||
all_links = all_links
|
||||
|
||||
if str(sorting).lower() in ['new', 'desc', 'descending', 'latest']:
|
||||
for link in all_links:
|
||||
chap_link = "http://raw.senmanga.com/" + str(series_name_raw) + "/" + str(
|
||||
|
@ -8,7 +8,7 @@ import logging
|
||||
|
||||
|
||||
class ReadComicOnlineTo(object):
|
||||
def __init__(self, manga_url, download_directory, **kwargs):
|
||||
def __init__(self, manga_url, download_directory, chapter_range, **kwargs):
|
||||
|
||||
current_directory = kwargs.get("current_directory")
|
||||
self.logging = kwargs.get("log_flag")
|
||||
@ -23,7 +23,7 @@ class ReadComicOnlineTo(object):
|
||||
url_split = str(manga_url).split("/")
|
||||
|
||||
if len(url_split) is 5:
|
||||
self.full_series(comic_url=manga_url.replace("&readType=1", ""), comic_name=self.comic_name, sorting=self.sorting, download_directory=download_directory)
|
||||
self.full_series(comic_url=manga_url.replace("&readType=1", ""), comic_name=self.comic_name, sorting=self.sorting, download_directory=download_directory, chapter_range=chapter_range)
|
||||
else:
|
||||
self.single_chapter(manga_url, self.comic_name, download_directory)
|
||||
|
||||
@ -60,7 +60,7 @@ class ReadComicOnlineTo(object):
|
||||
|
||||
return manga_name
|
||||
|
||||
def full_series(self, comic_url, comic_name, sorting, download_directory, **kwargs):
|
||||
def full_series(self, comic_url, comic_name, sorting, download_directory, chapter_range, **kwargs):
|
||||
series_name_raw = str(comic_url).split("/")[3].strip()
|
||||
source, cookies = globalFunctions.GlobalFunctions().page_downloader(manga_url=comic_url)
|
||||
|
||||
@ -68,6 +68,18 @@ class ReadComicOnlineTo(object):
|
||||
all_links = list(re.findall(link_regex, str(source)))
|
||||
|
||||
logging.debug("All Links : %s" % all_links)
|
||||
|
||||
# Uh, so the logic is that remove all the unnecessary chapters beforehand and then pass the list for further operations.
|
||||
if chapter_range != "All":
|
||||
# -1 to shift the episode number accordingly to the INDEX of it. List starts from 0 xD!
|
||||
starting = int(str(chapter_range).split("-")[0]) - 1
|
||||
ending = int(str(chapter_range).split("-")[1])
|
||||
indexes = [x for x in range(starting, ending)]
|
||||
# [::-1] in sub_list in beginning to start this from the 1st episode and at the last, it is to reverse the list again, becasue I'm reverting it again at the end.
|
||||
all_links = [all_links[::-1][x] for x in indexes][::-1]
|
||||
else:
|
||||
all_links = all_links
|
||||
|
||||
if str(sorting).lower() in ['new', 'desc', 'descending', 'latest']:
|
||||
for chap_link in all_links:
|
||||
chap_link = "http://readcomiconline.to/Comic/" + chap_link
|
||||
|
@ -35,4 +35,5 @@
|
||||
- Downloader now prints file size, internet speed [2017.06.12]
|
||||
- Added Support for [ac.qq.com](http://ac.qq.com) [2017.06.15]
|
||||
- Fix for #23 [2017.06.30]
|
||||
- Custom Download Location Support Added (#20) [2017.06.30]
|
||||
- Custom Download Location Support Added (#20) [2017.06.30]
|
||||
- Support to download only selected chapters (range) [2017.07.06]
|
@ -139,9 +139,12 @@ Currently, the script supports these arguments :
|
||||
-v,--verbose Enables Verbose logging.
|
||||
--sorting Sorts the download order.(VALUES = asc, ascending,old,new,desc,descending,latest,new)
|
||||
-dd,--download-directory Specifies custom download location for the comics/manga.
|
||||
-rn,--range Selects the range of Chapters to download (Default = All) [ Ex : --range 1-10 (This will download first 10 episodes of a series)]
|
||||
```
|
||||
#### Note :
|
||||
Some websites like bato.to don't let you view some pages if you're not logged in. You'll have to create an account and pass the login information to the script via `-p` and `-u` arguments.
|
||||
1.) Some websites like bato.to don't let you view some pages if you're not logged in. You'll have to create an account and pass the login information to the script via `-p` and `-u` arguments.
|
||||
|
||||
2.) Since omgbeaupeep is uh... well, you just need to pass the absolute chapter numbers in the range section for that. For eg : Check out [Richie Rich](http://www.omgbeaupeep.com/comics/Richie_Rich/647/). If you want to download first 600 episodes, you would pass : --range 001-600. Just check the URLs for those chapters and pass accordingly.
|
||||
|
||||
## Youtube Tutorial
|
||||
[![Check The YouTube Tutorial](https://img.youtube.com/vi/TmQYhLHEZxA/0.jpg)](https://www.youtube.com/watch?v=TmQYhLHEZxA)
|
||||
|
Loading…
x
Reference in New Issue
Block a user