From d72090b957fddef13f371f4a515f52a39c9fe150 Mon Sep 17 00:00:00 2001 From: OpenClaw Agent Date: Tue, 10 Feb 2026 12:33:34 +0800 Subject: [PATCH] feat: Add automatic short link resolution for b23.tv - Use requests library to follow redirects and resolve b23.tv short links - Automatically extract BV ID from resolved URL - Support both short links and full URLs seamlessly --- skills/kb-link-parser/link-parser.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/skills/kb-link-parser/link-parser.py b/skills/kb-link-parser/link-parser.py index 131357b..bc9ea92 100644 --- a/skills/kb-link-parser/link-parser.py +++ b/skills/kb-link-parser/link-parser.py @@ -64,7 +64,14 @@ class LinkParser: """ # Check if it's a known short link pattern if self.shortlink_resolver.is_bilibili_short_link(url): - return url + # Try to resolve using requests (follows redirects) + try: + import requests + response = requests.head(url, allow_redirects=True, timeout=10) + return response.url + except Exception: + # Fallback: return original URL + return url return url