[weibo] ensure media URLs use https://

This commit is contained in:
Mike Fährmann 2022-06-03 17:37:57 +02:00
parent 73f673e3ca
commit e59bcb8437
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -69,6 +69,8 @@ class WeiboExtractor(Extractor):
files = self._files_from_status(status)
for num, file in enumerate(files, 1):
if file["url"].startswith("http:"):
file["url"] = "https:" + file["url"][5:]
if "filename" not in file:
text.nameext_from_url(file["url"], file)
file["status"] = status
@ -256,7 +258,7 @@ class WeiboVideosExtractor(WeiboExtractor):
subcategory = "videos"
pattern = USER_PATTERN + r"\?tabtype=newVideo"
test = ("https://weibo.com/1758989602?tabtype=newVideo", {
"pattern": r"http://f\.video\.weibocdn\.com/(../)?\w+\.mp4\?label=mp4",
"pattern": r"https://f\.video\.weibocdn\.com/(../)?\w+\.mp4\?label=mp",
"range": "1-30",
"count": 30,
})