mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-21 18:22:30 +01:00
[weibo] simplify 'livephoto' extraction (#6471)
continuation of 396b52aef7
fixes wrong 'filename' and 'extension' values
when 'ssig' query parameter contains "%2F"
This commit is contained in:
parent
cb09273670
commit
f7246f025f
@ -126,15 +126,7 @@ class WeiboExtractor(Extractor):
|
|||||||
|
|
||||||
elif pic_type == "livephoto" and self.livephoto:
|
elif pic_type == "livephoto" and self.livephoto:
|
||||||
append(pic["largest"].copy())
|
append(pic["largest"].copy())
|
||||||
|
append({"url": pic["video"]})
|
||||||
url = pic["video"]
|
|
||||||
fname, _, ext = (
|
|
||||||
url.rpartition("%2F")[2]
|
|
||||||
if "%2F" in url else
|
|
||||||
text.filename_from_url(url)
|
|
||||||
).rpartition(".")
|
|
||||||
|
|
||||||
append({"url": url, "filename": fname, "extension": ext})
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
append(pic["largest"].copy())
|
append(pic["largest"].copy())
|
||||||
|
@ -231,7 +231,7 @@ __tests__ = (
|
|||||||
"#comment" : "type == livephoto (#2146, #6471)",
|
"#comment" : "type == livephoto (#2146, #6471)",
|
||||||
"#category": ("", "weibo", "status"),
|
"#category": ("", "weibo", "status"),
|
||||||
"#class" : weibo.WeiboStatusExtractor,
|
"#class" : weibo.WeiboStatusExtractor,
|
||||||
"#pattern" : r"https://livephoto\.us\.sinaimg\.cn/\w+\.mov\?Expires=\d+&ssig=\w+&KID=unistore,video",
|
"#pattern" : r"https://livephoto\.us\.sinaimg\.cn/\w+\.mov\?Expires=\d+&ssig=[^&#]+&KID=unistore,video",
|
||||||
"#range" : "2,4",
|
"#range" : "2,4",
|
||||||
|
|
||||||
"filename" : {"000yfKhRjx08hBAXxdZ60f0f0100tBPr0k01", "000GEYrCjx08hBAXUFo40f0f0100vS5G0k01"},
|
"filename" : {"000yfKhRjx08hBAXxdZ60f0f0100tBPr0k01", "000GEYrCjx08hBAXUFo40f0f0100vS5G0k01"},
|
||||||
|
Loading…
Reference in New Issue
Block a user