mirror of
https://github.com/RicterZ/nhentai.git
synced 2025-04-12 06:23:30 +02:00
fix bug of cover.webp.webp
This commit is contained in:
parent
8a7be0e33d
commit
6789b2b363
@ -111,6 +111,8 @@ def cmd_parser():
|
||||
|
||||
parser.add_option('--no-filename-padding', action='store_true', dest='no_filename_padding',
|
||||
default=False, help='no padding in the images filename, such as \'001.jpg\'')
|
||||
parser.add_option('--only-meta', action='store_true', dest='only_meta', default=False,
|
||||
help='only download doujinshi metadata')
|
||||
|
||||
# generate options
|
||||
parser.add_option('--html', dest='html_viewer', action='store_true',
|
||||
@ -188,7 +190,6 @@ def cmd_parser():
|
||||
|
||||
if any([args.cookie, args.useragent, args.language]):
|
||||
sys.exit(0)
|
||||
# -- end set config
|
||||
|
||||
if args.proxy is not None:
|
||||
proxy_url = urlparse(args.proxy)
|
||||
|
@ -165,7 +165,9 @@ def doujinshi_parser(id_, counter=0):
|
||||
doujinshi_cover = html.find('div', attrs={'id': 'cover'})
|
||||
# img_id = re.search('/galleries/([0-9]+)/cover.(jpg|png|gif|webp)$',
|
||||
# doujinshi_cover.a.img.attrs['data-src'])
|
||||
img_id = re.search(r'/galleries/(\d+)/cover\.\w+$', doujinshi_cover.a.img.attrs['data-src'])
|
||||
|
||||
# fix cover.webp.webp
|
||||
img_id = re.search(r'/galleries/(\d+)/cover(.webp)?\.\w+$', doujinshi_cover.a.img.attrs['data-src'])
|
||||
|
||||
ext = []
|
||||
for i in html.find_all('div', attrs={'class': 'thumb-container'}):
|
||||
|
Loading…
x
Reference in New Issue
Block a user