From c895f53e221600b53264612c88fb9b705ed21abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Mon, 5 Jan 2026 22:29:34 +0800 Subject: [PATCH] fix: #803 --- store/xhs/__init__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/store/xhs/__init__.py b/store/xhs/__init__.py index 0200b9d..08e9850 100644 --- a/store/xhs/__init__.py +++ b/store/xhs/__init__.py @@ -60,13 +60,20 @@ def get_video_url_arr(note_item: Dict) -> List: if note_item.get('type') != 'video': return [] + video_dict = note_item.get('video') + if not video_dict: + return [] + videoArr = [] - originVideoKey = note_item.get('video').get('consumer').get('origin_video_key') + consumer = video_dict.get('consumer', {}) + originVideoKey = consumer.get('origin_video_key', '') if originVideoKey == '': - originVideoKey = note_item.get('video').get('consumer').get('originVideoKey') + originVideoKey = consumer.get('originVideoKey', '') # Fallback with watermark if originVideoKey == '': - videos = note_item.get('video').get('media').get('stream').get('h264') + media = video_dict.get('media', {}) + stream = media.get('stream', {}) + videos = stream.get('h264') if type(videos).__name__ == 'list': videoArr = [v.get('master_url') for v in videos] else: