From 4d7a2102db6465bef169d679f4cbffc9b7aa41e9 Mon Sep 17 00:00:00 2001 From: ucmao <294323976@qq.com> Date: Wed, 16 Sep 2026 10:37:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=96=E9=9F=B3=E5=85=A8=E9=87=8Fcookie?= =?UTF-8?q?=E9=98=B2=E6=8A=A5=E9=94=99=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/parsers/douyin_parser.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/parsers/douyin_parser.py b/src/parsers/douyin_parser.py index 349fef4..0428c19 100644 --- a/src/parsers/douyin_parser.py +++ b/src/parsers/douyin_parser.py @@ -115,8 +115,10 @@ class DouyinParser(BaseParser): return raw_val = m.group(1).strip() try: - decoded_bytes = base64.b64decode(urllib.parse.unquote(raw_val)) - info = json.loads(decoded_bytes.decode('utf-8')) + decoded_str = base64.b64decode(urllib.parse.unquote(raw_val)).decode('utf-8', errors='ignore') + if '%' in decoded_str: + decoded_str = urllib.parse.unquote(decoded_str) + info = json.loads(decoded_str) ua = info.get('userAgent') if ua and isinstance(ua, str): self.signer.user_agent = ua