From 5f24244f2cb43023cd9ba782b270cd7b9c25af27 Mon Sep 17 00:00:00 2001 From: Dinesh Natesan Date: Sun, 19 Nov 2017 12:07:46 +0530 Subject: [PATCH] Added updated requirements file and fixed no volume bug (mangafox) --- comic_scraper/comic_scraper.py | 19 ++++++++++++++++++- requirements.txt | 3 +++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/comic_scraper/comic_scraper.py b/comic_scraper/comic_scraper.py index 80aa057..b6e2336 100755 --- a/comic_scraper/comic_scraper.py +++ b/comic_scraper/comic_scraper.py @@ -120,6 +120,23 @@ def manga_extract_chapters(self): else: chapters[chapter_num] = Chapter( self, chapter_num, volume_num, chapter_link) + + if (not chapters) and links: + # Maybe the manga has no volume (try this out) + for link in links: + chapter_link = urljoin(urlscheme.scheme + + "://" + urlscheme.netloc, + '/'.join(link.split('/')[:-1])) + matched_groups = re.search('c([\d \.]+)', chapter_link) + if matched_groups: + volume_num = 1 + chapter_num = float(matched_groups.group(1)) + if chapter_num in chapters: + continue + else: + chapters[chapter_num] = Chapter( + self, chapter_num, volume_num, chapter_link) + return chapters def comic_extract_chapters(self): @@ -370,7 +387,7 @@ def main(): "-rt", "--retries", default=10, help="Number of retries before giving up") parser.add_argument( - "-f", "--format", default='cbz', + "-f", "--format", default='pdf', help="File format of the downloaded file, supported 'pdf' and 'cbz'") args = parser.parse_args() diff --git a/requirements.txt b/requirements.txt index b216b75..606f795 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,8 @@ certifi==2017.7.27.1 chardet==3.0.4 futures==3.1.1 idna==2.6 +img2pdf==0.2.4 +olefile==0.44 +Pillow==4.3.0 requests==2.18.4 urllib3==1.22