mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-01-07 17:16:08 +00:00
[twitter:card] Support vine.co embeds (closes #7496)
This commit is contained in:
parent
4479600d57
commit
5f1b2aea80
|
@ -52,6 +52,19 @@ class TwitterCardIE(InfoExtractor):
|
||||||
'uploader': 'OMG! Ubuntu!',
|
'uploader': 'OMG! Ubuntu!',
|
||||||
'uploader_id': 'omgubuntu',
|
'uploader_id': 'omgubuntu',
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url': 'https://twitter.com/i/cards/tfw/v1/665289828897005568',
|
||||||
|
'md5': 'ab2745d0b0ce53319a534fccaa986439',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'iBb2x00UVlv',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'upload_date': '20151113',
|
||||||
|
'uploader_id': '1189339351084113920',
|
||||||
|
'uploader': '@ArsenalTerje',
|
||||||
|
'title': 'Vine by @ArsenalTerje',
|
||||||
|
},
|
||||||
|
'add_ie': ['Vine'],
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -71,11 +84,11 @@ class TwitterCardIE(InfoExtractor):
|
||||||
request.add_header('User-Agent', user_agent)
|
request.add_header('User-Agent', user_agent)
|
||||||
webpage = self._download_webpage(request, video_id)
|
webpage = self._download_webpage(request, video_id)
|
||||||
|
|
||||||
youtube_url = self._html_search_regex(
|
iframe_url = self._html_search_regex(
|
||||||
r'<iframe[^>]+src="((?:https?:)?//www.youtube.com/embed/[^"]+)"',
|
r'<iframe[^>]+src="((?:https?:)?//(?:www.youtube.com/embed/[^"]+|(?:www\.)?vine\.co/v/\w+/card))"',
|
||||||
webpage, 'youtube iframe', default=None)
|
webpage, 'video iframe', default=None)
|
||||||
if youtube_url:
|
if iframe_url:
|
||||||
return self.url_result(youtube_url, 'Youtube')
|
return self.url_result(iframe_url)
|
||||||
|
|
||||||
config = self._parse_json(self._html_search_regex(
|
config = self._parse_json(self._html_search_regex(
|
||||||
r'data-player-config="([^"]+)"', webpage, 'data player config'),
|
r'data-player-config="([^"]+)"', webpage, 'data player config'),
|
||||||
|
|
Loading…
Reference in a new issue