etc~ scripts and random things |
| git clone https://github.com/djnnvx/etc.git |
| log | files | refs | archive |
| commit 09ab94e0c83b8592aad108e11dbec0d0a3a52aef
parent b515a1dea3841e4b2015e1dd110ba00087697804 Author: djnn <[email protected]> Date: Thu, 8 Oct 2026 00:24:18 +0900 fix(scrape): tiny bugfix Diffstat:
|
| 1 file changed, 2 insertions(+), 2 deletions(-) |
diff --git a/scrape/scrape.py b/scrape/scrape.py @@ -100,8 +100,8 @@ def links(sess, url, pat=None): def _name(url): - n = os.path.basename(urlparse(url).path) or hashlib.sha256(url.encode()).hexdigest()[:16] - return n + p = urlparse(url).path.strip("/") + return p.replace("/", "_") or hashlib.sha256(url.encode()).hexdigest()[:16] def grab(sess, urls, outdir): |