Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[weibo][error] An unexpected error occurred: KeyError - 'playback_list' #2792

Closed
valdearg opened this issue Jul 30, 2022 · 1 comment
Closed
Labels

Comments

@valdearg
Copy link

With one of the Weibo users I'm hitting an error with most likely a certain post:

Command I'm running is: gallery-dl https://weibo.com/u/2909128931 --verbose

gallery-dl happily downloads lots of posts, but then hits a post it doesn't like:

[gallery-dl][debug] Python 3.10.0 - Windows-10-10.0.19044-SP0
[gallery-dl][debug] requests 2.26.0 - urllib3 1.26.7
[gallery-dl][debug] Starting DownloadJob for 'https://weibo.com/u/2909128931'
[weibo][debug] Using WeiboUserExtractor for 'https://weibo.com/u/2909128931'
[weibo][debug] Using WeiboFeedExtractor for 'https://weibo.com/u/2909128931?tabtype=feed'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): weibo.com:443
[urllib3.connectionpool][debug] https://weibo.com:443 "GET /ajax/statuses/mymblog?uid=2909128931&feature=0 HTTP/1.1" 200 None
[weibo][debug] Using download archive 'archive.sqlite3'
# G:\Scripts\gallery-dl\Weibo\coser优雅 (2909128931)\4796342553024269_01.jpg
# G:\Scripts\gallery-dl\Weibo\coser优雅 (2909128931)\4796342553024269_02.jpg
# G:\Scripts\gallery-dl\Weibo\coser优雅 (2909128931)\4796342553024269_03.jpg
<snipped lots of successful downloads>
# G:\Scripts\gallery-dl\Weibo\coser优雅 (2909128931)\4409545658754086_09.jpg
[weibo][error] An unexpected error occurred: KeyError - 'playback_list'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[weibo][debug]
Traceback (most recent call last):
  File "C:\Python\Python310\lib\site-packages\gallery_dl\job.py", line 77, in run
    for msg in extractor:
  File "C:\Python\Python310\lib\site-packages\gallery_dl\extractor\weibo.py", line 71, in items
    for num, file in enumerate(files, 1):
  File "C:\Python\Python310\lib\site-packages\gallery_dl\extractor\weibo.py", line 106, in _files_from_status
    media = max(page_info["media_info"]["playback_list"],
KeyError: 'playback_list'
@mikf
Copy link
Owner

mikf commented Jul 31, 2022

Fixed in commit 0f5826e by simply ignoring an apparent video without playback_list.

Post 4409545658754086 does have 9 pictures as well as a video with download URLs, but none of them seem to be functional and it also isn't shown on the webpage, so I guess this is fine.

  "page_info": {
    "type": "5",
    "page_id": "10012099948",
    "object_type": "movie",
    "page_title": "阿丽塔:战斗天使",
    "page_pic": "http://mu1.sinaimg.cn/square.180/weiyinyue.music.sina.com.cn/movie_poster/99948.jpg",
    "type_icon": "",
    "page_url": "sinaweibo://radar?tabid=radar_movie&callback_id=10012099948&mark_id=999_reallog_mark_ad%253A999%257CWeiboADNatural",
    "object_id": "1022:10012099948",
    "object_category": "video",
    "media_info": {
      "name": "阿丽塔:战斗天使",
      "stream_url": "http://gslb.miaopai.com/stream/5FUEMKNTxwsP~0P1f~9mgORyQ3Geu8qNx6NgiA__.mp4?yx=&refer=weibo_app&vend=weibo&label=mp4_hd&mpflag=16&tags=weibocard",
      "stream_url_hd": "http://gslb.miaopai.com/stream/5FUEMKNTxwsP~0P1f~9mgORyQ3Geu8qNx6NgiA__.mp4?yx=&refer=weibo_app&vend=weibo&label=mp4_hd&mpflag=16&tags=weibocard",
      "h5_url": "https://weibo.com/p/10012099948?mark_id=999_reallog_mark_ad%253A999%257CWeiboADNatural",
      "mp4_sd_url": "http://gslb.miaopai.com/stream/5FUEMKNTxwsP~0P1f~9mgORyQ3Geu8qNx6NgiA__.mp4?yx=&refer=weibo_app&vend=weibo&label=mp4_hd&mpflag=16&tags=weibocard",
      "mp4_hd_url": "http://gslb.miaopai.com/stream/5FUEMKNTxwsP~0P1f~9mgORyQ3Geu8qNx6NgiA__.mp4?yx=&refer=weibo_app&vend=weibo&label=mp4_hd&mpflag=16&tags=weibocard",
      "h265_mp4_hd": "",
...

@mikf mikf closed this as completed Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants