mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-23 03:02:50 +01:00
[weibo] prevent exception for missing 'playback_list' (#2792)
This commit is contained in:
parent
7d1a95ada6
commit
0f5826e884
@ -99,12 +99,13 @@ class WeiboExtractor(Extractor):
|
|||||||
else:
|
else:
|
||||||
yield pic["largest"].copy()
|
yield pic["largest"].copy()
|
||||||
|
|
||||||
if "page_info" in status:
|
if "page_info" in status and self.videos:
|
||||||
page_info = status["page_info"]
|
try:
|
||||||
if "media_info" not in page_info or not self.videos:
|
media = max(status["page_info"]["media_info"]["playback_list"],
|
||||||
return
|
|
||||||
media = max(page_info["media_info"]["playback_list"],
|
|
||||||
key=lambda m: m["meta"]["quality_index"])
|
key=lambda m: m["meta"]["quality_index"])
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
yield media["play_info"].copy()
|
yield media["play_info"].copy()
|
||||||
|
|
||||||
def _status_by_id(self, status_id):
|
def _status_by_id(self, status_id):
|
||||||
@ -366,6 +367,10 @@ class WeiboStatusExtractor(WeiboExtractor):
|
|||||||
"pattern": r"https://g\.us\.sinaimg.cn/o0/qNZcaAAglx07Wuf921CM0104"
|
"pattern": r"https://g\.us\.sinaimg.cn/o0/qNZcaAAglx07Wuf921CM0104"
|
||||||
r"120005tc0E010\.mp4\?label=gif_mp4",
|
r"120005tc0E010\.mp4\?label=gif_mp4",
|
||||||
}),
|
}),
|
||||||
|
# missing 'playback_list' (#2792)
|
||||||
|
("https://weibo.com/2909128931/4409545658754086", {
|
||||||
|
"count": 9,
|
||||||
|
}),
|
||||||
("https://m.weibo.cn/status/4339748116375525"),
|
("https://m.weibo.cn/status/4339748116375525"),
|
||||||
("https://m.weibo.cn/5746766133/4339748116375525"),
|
("https://m.weibo.cn/5746766133/4339748116375525"),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user