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

Commit

Permalink
Added updated requirements file and fixed no volume bug (mangafox)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbstractGeek committed Nov 19, 2017
1 parent 22b87f9 commit 5f24244
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 18 additions & 1 deletion comic_scraper/comic_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5f24244

Please sign in to comment.