summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSergey M․ <[email protected]>2021-05-16 20:48:24 +0700
committerSergey M․ <[email protected]>2021-05-16 20:48:24 +0700
commit8536dcafd82380c006a25409bdc2c3dc0d14195c (patch)
treea4e65156cef09525b74c646654e4f5c54bdc55d1
parent552b1399110360232bf1bf2ba5ed50cb8b30e818 (diff)
downloadyoutube-dl-8536dcafd82380c006a25409bdc2c3dc0d14195c.tar.gz
youtube-dl-8536dcafd82380c006a25409bdc2c3dc0d14195c.zip
[vk] Add support for sibnet embeds (closes #9500)
-rw-r--r--youtube_dl/extractor/vk.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/youtube_dl/extractor/vk.py b/youtube_dl/extractor/vk.py
index 00ec006c4..6b3513ee0 100644
--- a/youtube_dl/extractor/vk.py
+++ b/youtube_dl/extractor/vk.py
@@ -300,6 +300,13 @@ class VKIE(VKBaseIE):
'only_matching': True,
}]
+ @staticmethod
+ def _extract_sibnet_urls(webpage):
+ # https://help.sibnet.ru/?sibnet_video_embed
+ return [unescapeHTML(mobj.group('url')) for mobj in re.finditer(
+ r'<iframe\b[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//video\.sibnet\.ru/shell\.php\?.*?\bvideoid=\d+.*?)\1',
+ webpage)]
+
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('videoid')
@@ -408,6 +415,10 @@ class VKIE(VKBaseIE):
if odnoklassniki_url:
return self.url_result(odnoklassniki_url, OdnoklassnikiIE.ie_key())
+ sibnet_urls = self._extract_sibnet_urls(info_page)
+ if sibnet_urls:
+ return self.url_result(sibnet_urls[0])
+
m_opts = re.search(r'(?s)var\s+opts\s*=\s*({.+?});', info_page)
if m_opts:
m_opts_url = re.search(r"url\s*:\s*'((?!/\b)[^']+)", m_opts.group(1))