Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit 5f24244

Browse files
committed
Added updated requirements file and fixed no volume bug (mangafox)
1 parent 22b87f9 commit 5f24244

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

comic_scraper/comic_scraper.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,23 @@ def manga_extract_chapters(self):
120120
else:
121121
chapters[chapter_num] = Chapter(
122122
self, chapter_num, volume_num, chapter_link)
123+
124+
if (not chapters) and links:
125+
# Maybe the manga has no volume (try this out)
126+
for link in links:
127+
chapter_link = urljoin(urlscheme.scheme
128+
+ "://" + urlscheme.netloc,
129+
'/'.join(link.split('/')[:-1]))
130+
matched_groups = re.search('c([\d \.]+)', chapter_link)
131+
if matched_groups:
132+
volume_num = 1
133+
chapter_num = float(matched_groups.group(1))
134+
if chapter_num in chapters:
135+
continue
136+
else:
137+
chapters[chapter_num] = Chapter(
138+
self, chapter_num, volume_num, chapter_link)
139+
123140
return chapters
124141

125142
def comic_extract_chapters(self):
@@ -370,7 +387,7 @@ def main():
370387
"-rt", "--retries", default=10,
371388
help="Number of retries before giving up")
372389
parser.add_argument(
373-
"-f", "--format", default='cbz',
390+
"-f", "--format", default='pdf',
374391
help="File format of the downloaded file, supported 'pdf' and 'cbz'")
375392

376393
args = parser.parse_args()

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@ certifi==2017.7.27.1
33
chardet==3.0.4
44
futures==3.1.1
55
idna==2.6
6+
img2pdf==0.2.4
7+
olefile==0.44
8+
Pillow==4.3.0
69
requests==2.18.4
710
urllib3==1.22

0 commit comments

Comments
 (0)