mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
11.85k stars 975 forks source link

[Bug/feature request] Weibo hidden videos #2146

Closed pxssy closed 1 year ago

pxssy commented 2 years ago

Example

https://weibo.com/5643044717/KkuDZ4jAA is a post with 9 images

gallery-dl https://weibo.com/5643044717/KkuDZ4jAA downloads 9 images, as expected.

except, somehow when viewed with a mobile, there are "live" videos embedded behind those 9 images. and the metadata json files agree.

{ "category": "weibo", "extension": "jpg", "filename": "96f8e68ely1grkheaqwblj222o3401ky", "height": 3072, "num": 9, "pid": "96f8e68ely1grkheaqwblj222o3401ky", "status": { "ad_state": 1, "alchemy_params": { "ug_red_envelope": false }, "attitudes_count": 453, "bid": "KkuDZ4jAA", "bmiddle_pic": "http://wx4.sinaimg.cn/bmiddle/96f8e68ely1grkhedchpnj21gw1yjwxs.jpg", "buttons": [ { "name": "关注", "params": { "uid": 2532894350 }, "sub_type": 0, "type": "follow" } ], "can_edit": false, "can_reprint": false, "cardid": "star_091", "category": "weibo", "comments_count": 39, "content_auth": 0, "created_at": "Wed Jun 16 22:35:46 +0800 2021", "darwin_tags": [], "date": "2021-06-16 14:35:46", "expire_time": 1623896671, "favorited": false, "hide_flag": 0, "id": "4648843591028616", "isLongText": false, "is_paid": false, "live_photo": [ "https://video.weibo.com/media/play?livephoto=https%3A%2F%2Flivephoto.us.sinaimg.cn%2F000DdFqgjx07NvAUS2ju0f0f0100eJlc0k01.mov", "https://video.weibo.com/media/play?livephoto=https%3A%2F%2Flivephoto.us.sinaimg.cn%2F0041zpgcjx07NvAUYPTO0f0f0100egQG0k01.mov", "https://video.weibo.com/media/play?livephoto=https%3A%2F%2Flivephoto.us.sinaimg.cn%2F000hMXBUjx07NvAULAqI0f0f0100zviL0k01.mov" ], "mark": "999_reallog_mark_ad:999|WeiboADNatural", "mblog_vip_type": 0, "mblogtype": 0, "mid": "4648843591028616", "mlevel": 0, "more_info_type": 0, "new_comment_style": 0, "number_display_strategy": { "apply_scenario_flag": 3, "display_text": "100万+", "display_text_min_number": 1000000 }, "ok": 1, "original_pic": "https://wx4.sinaimg.cn/large/96f8e68ely1grkhedchpnj21gw1yjwxs.jpg", "pending_approval_count": 0, "picStatus": "3:1,4:1,5:1,6:1,7:1,8:1", "pic_ids": [ "96f8e68ely1grkhedchpnj21gw1yjwxs", "96f8e68ely1grkheew27wj22c0340kjm", "96f8e68ely1grkhe5p6kvj22c0340e82", "96f8e68ely1grkhesq80fj20u00mi1hf", "96f8e68ely1grkhefot2kj20c10brgmk", "96f8e68ely1grkhe9mx3bj221d340npd", "96f8e68ely1grkhe820hkj222o340u0y", "96f8e68ely1grkhe6q4qoj21wg2toe81", "96f8e68ely1grkheaqwblj222o3401ky" ], "pic_num": 9, "pic_types": "0,0,0,0,0,0,0,0,0", "pic_video": "0:000DdFqgjx07NvAUS2ju0f0f0100eJlc0k01,1:0041zpgcjx07NvAUYPTO0f0f0100egQG0k01,2:000hMXBUjx07NvAULAqI0f0f0100zviL0k01", "reposts_count": 45, "reprint_cmt_count": 0, "reprint_type": 0, "reward_exhibition_type": 0, "scheme": "https://weibo.cn/appurl?scheme=sinaweibo%3A%2F%2Fdetail%3Fmblogid%3D4648843591028616%26luicode%3D20000061%26lfid%3D4648843591028616&luicode=20000061&lfid=4648843591028616", "show_additional_indication": 0, "source": "iPhone XS", "status_title": "CP28 这次cp好累诶 累爆了...", "subcategory": "status", "text": "<a href=\"https://m.weibo.cn/p/index?extparam=CP28&containerid=100808d3bf5fde591fe54852d945b0713148e8&luicode=20000061&lfid=4648843591028616\" data-hide=\"\"><span class=\"surl-text\">CP28
<span class=\"url-icon\"><img alt=[二哈] src=\"https://h5.sinaimg.cn/m/emoticon/icon/others/d_erha-139d0e07bd.png\" style=\"width:1em; height:1em;\" />这次cp好累诶 累爆了<span class=\"url-icon\"><img alt=[泪] src=\"https://h5.sinaimg.cn/m/emoticon/icon/default/d_lei-4cdf6ee412.png\" style=\"width:1em; height:1em;\" /> 还带了套德意志的礼服想拍拍场照(战神
本来以为想要不可燃物老师的周边无料都没戏了 没想到展商入口就在同人馆哈哈哈 不可燃物的周边我到手了<span class=\"url-icon\"><img alt=[嘻嘻] src=\"https://h5.sinaimg.cn/m/emoticon/icon/default/d_xixi-643ef6e48d.png\" style=\"width:1em; height:1em;\" /><span class=\"url-icon\"><img alt=[嘻嘻] src=\"https://h5.sinaimg.cn/m/emoticon/icon/default/d_xixi-643ef6e48d.png\" style=\"width:1em; height:1em;\" /><span class=\"url-icon\"><img alt=[嘻嘻] src=\"https://h5.sinaimg.cn/m/emoticon/icon/default/d_xixi-643ef6e48d.png\" style=\"width:1em; height:1em;\" /> ", "textLength": 203, "thumbnail_pic": "https://wx4.sinaimg.cn/thumbnail/96f8e68ely1grkhedchpnj21gw1yjwxs.jpg", "tipScheme": "https://weibo.cn/appurl?scheme=sinaweibo%3A%2F%2Fdetail%3Fmblogid%3D4648843591028616%26luicode%3D20000061%26lfid%3D4648843591028616&luicode=20000061&lfid=4648843591028616", "user": { "avatar_hd": "https://wx4.sinaimg.cn/orj480/96f8e68ely8grc63i9q4fj20u00u0wgl.jpg", "badge": { "dzwbqlx_2016": 1, "follow_whitelist_video": 1, "hongbao_2020": 2, "hongbaofei_2019": 1, "hongbaofeifuniu_2021": 1, "hongbaofeijika_2021": 1, "league_badge": 1, "lol_gm_2017": 1, "lol_s8": 1, "panda": 1, "qixi_2018": 1, "suishoupai_2018": 1, "travel_2017": 1, "unread_pool": 1, "unread_pool_ext": 1, "user_name_certificate": 1, "vpick_2020": 1, "wenda_v2": 1 }, "close_blue_v": false, "cover_image_phone": "https://wx2.sinaimg.cn/crop.0.0.640.640.640/96f8e68ely1gsgoxl8rx2j20v90v9jx7.jpg", "description": "哔哩哔哩直播间:22863368 企鹅粉丝1群: 648393949 2群:497264586", "follow_count": 662, "follow_me": false, "followers_count": "61万", "followers_count_str": "61万", "following": false, "gender": "f", "id": 2532894350, "like": false, "like_me": false, "mbrank": 7, "mbtype": 12, "profile_image_url": "https://tvax4.sinaimg.cn/crop.0.0.1080.1080.180/96f8e68ely8grc63i9q4fj20u00u0wgl.jpg?KID=imgbed,tva&Expires=1640730525&ssig=LY8GAmW0N2", "profile_url": "https://m.weibo.cn/u/2532894350?uid=2532894350&luicode=20000061&lfid=4648843591028616", "screen_name": "天夫人", "statuses_count": 6044, "urank": 48, "verified": false, "verified_type": -1 }, "version": 2, "visible": { "list_id": 0, "type": 0 } }, "subcategory": "status", "url": "https://wx3.sinaimg.cn/large/96f8e68ely1grkheaqwblj222o3401ky.jpg", "width": 2048 }

ctrl-f "live_photo" and ctrl-f "https://video.weibo.com/"

Those are not downloaded right now. I think it was a recent thing. Please include them as well.

kawing-chiu commented 2 years ago

@mikf Can we have an option to download these livephotos into a separate folder? Because many image viewers don't support livephotos, it's quite annoying to mix them with normal photos in one folder.

Hrxn commented 2 years ago

Not sure, if it's possible to to identify those downloads by file extension, then yes.

Should be doable with the classify postprocessor, which can be used like this:

{
            "name": "classify",
            "mapping":
            {
                "Pictures" : ["jpg", "jpeg", "png", "webp", "avif", "heif", "heic", "jxl", "bmp", "tif", "tiff", "jpe", "jxr", "j2k", "jp2", "hdr", "exr", "jfif", "jfi", "jif"],
                "Anims"    : ["gif", "apng", "mng"],
                "Clips"    : ["mp4", "mkv", "webm", "flv", "ogv", "wmv", "avi", "mpg", "mpeg", "3gp", "vob", "ts"],
                "Music"    : ["mp3", "aac", "flac", "ogg", "m4a", "wma", "wav", "mka", "ape", "mpc", "alac", "oga"],
                "Archives" : ["zip", "rar", "7z", "tar", "gz", "bz2", "ace", "xz", "lz"],
                "Graphics" : ["svg", "ps"],
                "Documents": ["txt", "html", "htm", "md", "markdown", "pdf", "json"],
                "Other"    : ["swf"]
            }
}

(This is the entire postprocessor object which defines said postprocessor, you can use it wherever postprocessors can be placed)