1
0
Fork 0
mirror of https://codeberg.org/polarisfm/youtube-dl.git synced 2024-12-27 01:56:52 +00:00

[extractor/generic:3qsdn] Add support for embeds

This commit is contained in:
Sergey M․ 2016-05-14 23:40:34 +06:00
parent 5c86bfe70f
commit 5d39176f6d
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D
2 changed files with 13 additions and 0 deletions

View file

@ -61,6 +61,7 @@ from .jwplatform import JWPlatformIE
from .digiteka import DigitekaIE
from .instagram import InstagramIE
from .liveleak import LiveLeakIE
from .threeqsdn import ThreeQSDNIE
class GenericIE(InfoExtractor):
@ -1983,6 +1984,11 @@ class GenericIE(InfoExtractor):
if liveleak_url:
return self.url_result(liveleak_url, 'LiveLeak')
# Look for 3Q SDN embeds
threeqsdn_url = ThreeQSDNIE._extract_url(webpage)
if threeqsdn_url:
return self.url_result(self._proto_relative_url(threeqsdn_url), ThreeQSDNIE.ie_key())
def check_video(vurl):
if YoutubeIE.suitable(vurl):
return True

View file

@ -56,6 +56,13 @@ class ThreeQSDNIE(InfoExtractor):
'only_matching': True,
}]
@staticmethod
def _extract_url(webpage):
mobj = re.search(
r'<iframe[^>]+\b(?:data-)?src=(["\'])(?P<url>%s.*?)\1' % ThreeQSDNIE._VALID_URL, webpage)
if mobj:
return mobj.group('url')
def _real_extract(self, url):
video_id = self._match_id(url)