fix bug of cover.webp.webp

This commit is contained in:
ricterz 2025-02-25 23:51:13 +08:00
parent 8a7be0e33d
commit 6789b2b363
2 changed files with 5 additions and 2 deletions

View File

@ -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)

View File

@ -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'}):