From 2ee8bacfd47eb0c63e1c48e0452a4b61afb5cc0a Mon Sep 17 00:00:00 2001 From: NobeKanai Date: Mon, 29 Apr 2024 09:20:53 +0800 Subject: [PATCH] fix: image link may be a relative link bump to version v0.7.2 --- dvtag/scrape.py | 3 ++- setup.cfg | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dvtag/scrape.py b/dvtag/scrape.py index e1a5aa1..a8ad667 100644 --- a/dvtag/scrape.py +++ b/dvtag/scrape.py @@ -1,6 +1,7 @@ import json import re from html import unescape +from urllib.parse import urljoin from .doujinvoice import DoujinVoice from .utils import create_request_session @@ -36,7 +37,7 @@ def scrape(workno: str) -> DoujinVoice: raise ParsingError(f"no work name found", workno) if m := re.search(r"\"og:image\"[\s\S]*?content=\"(.+?)\"", html): - image_url = m.group(1) + image_url = urljoin("https://www.dlsite.com", m.group(1)) else: raise ParsingError(f"no cover image url found", workno) diff --git a/setup.cfg b/setup.cfg index b882b4f..af8709e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = dvtag -version = 0.7.1 +version = 0.7.2 author = Nobe Kanai author_email = nobekanai@gmail.com description = A tool for tagging your doujin voice library.