fix heatmap extraction

This commit is contained in:
grqx_wsl 2024-10-23 20:45:03 +13:00
parent 43c6c434ae
commit 6f5a908dff

View file

@ -74,11 +74,8 @@ class BilibiliBaseIE(InfoExtractor):
query={'cid': cid})
if not isinstance(heatmap_json, dict):
return
try:
duration = self._parse_json(heatmap_json['debug'])['max_time']
except Exception:
duration = None
step_sec = heatmap_json.get('step_sec', {int})
duration = self._parse_json(heatmap_json['debug']).get('max_time')
step_sec = traverse_obj(heatmap_json, ('step_sec', {int}))
heatmap_data = traverse_obj(heatmap_json, ('events', 'default', {list}))
if not step_sec or not heatmap_data:
return