From e59bcb8437c6ec23b19c8bd4a67465df2533b049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 3 Jun 2022 17:37:57 +0200 Subject: [PATCH] [weibo] ensure media URLs use https:// --- gallery_dl/extractor/weibo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/weibo.py b/gallery_dl/extractor/weibo.py index 09825a44..a7068c8b 100644 --- a/gallery_dl/extractor/weibo.py +++ b/gallery_dl/extractor/weibo.py @@ -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, })