From c25905641e8176171411dff09e6910175b28e8cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 26 Nov 2022 12:00:17 +0100 Subject: [PATCH] [weibo] fix bug with empty 'playback_list' (#3301) --- gallery_dl/extractor/weibo.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gallery_dl/extractor/weibo.py b/gallery_dl/extractor/weibo.py index 55cee141..dc4d818c 100644 --- a/gallery_dl/extractor/weibo.py +++ b/gallery_dl/extractor/weibo.py @@ -106,6 +106,9 @@ class WeiboExtractor(Extractor): key=lambda m: m["meta"]["quality_index"]) except KeyError: pass + except ValueError: + info = status["page_info"]["media_info"] + yield {"url": info.get("stream_url_hd") or info["stream_url"]} else: yield media["play_info"].copy() @@ -375,6 +378,13 @@ class WeiboStatusExtractor(WeiboExtractor): ("https://weibo.com/2909128931/4409545658754086", { "count": 9, }), + # empty 'playback_list' (#3301) + ("https://weibo.com/1501933722/4142890299009993", { + "pattern": r"https://f\.us\.sinaimg\.cn/004zstGKlx07dAHg4ZVu010f01" + r"000OOl0k01\.mp4\?label=mp4_hd&template=template_7&ori" + r"=0&ps=1CwnkDw1GXwCQx.+&KID=unistore,video", + "count": 1, + }), ("https://m.weibo.cn/status/4339748116375525"), ("https://m.weibo.cn/5746766133/4339748116375525"), )