Skip to content

Commit

Permalink
Fix for #30
Browse files Browse the repository at this point in the history
Fix for #30
  • Loading branch information
Xonshiz committed Aug 23, 2017
1 parent cd258bc commit 9d287df
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@
- Fix for #34 [2017.07.24]
- Fix for #36 [2017.07.24]
- Fix for #37 [2017.07.24]
- Fix for #30 [2017.08.23]
- Fix for #30 [2017.08.23]
- Fix for #30 (mangahere.co) [2017.08.23]
2 changes: 1 addition & 1 deletion comic_dl/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

__version__ = "2017.08.23"
__version__ = "2017.08.23.b"
13 changes: 12 additions & 1 deletion comic_dl/sites/mangaHere.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def single_chapter(self, comic_url, comic_name, download_directory, conversion,
cookies=cookies_main)

image_link_finder = source_new.findAll('section', {'class': 'read_img'})

for link in image_link_finder:
x = link.findAll('img')
for a in x:
Expand All @@ -64,7 +65,17 @@ def single_chapter(self, comic_url, comic_name, download_directory, conversion,
if image_link in ['http://www.mangahere.co/media/images/loading.gif']:
pass
else:
file_name = "0" + str(chapCount) + ".jpg"
# file_name = "0" + str(chapCount) + ".jpg"
if len(str(chapCount)) < len(str(last_page_number)):
number_of_zeroes = len(str(last_page_number)) - len(str(chapCount))
# If a chapter has only 9 images, we need to avoid 0*0 case.
if len(str(number_of_zeroes)) == 0:
file_name = str(chapCount) + ".jpg"
else:
file_name = "0" * int(number_of_zeroes) + str(chapCount) + ".jpg"
else:
file_name = str(chapCount) + ".jpg"

logging.debug("Image Link : %s" % image_link)
globalFunctions.GlobalFunctions().downloader(image_link, file_name, chapter_url, directory_path,
log_flag=self.logging)
Expand Down
3 changes: 2 additions & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@
- Fix for #34 [2017.07.24]
- Fix for #36 [2017.07.24]
- Fix for #37 [2017.07.24]
- Fix for #30 [2017.08.23]
- Fix for #30 [2017.08.23]
- Fix for #30 (mangahere.co) [2017.08.23]

0 comments on commit 9d287df

Please sign in to comment.