mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-15 01:36:31 +00:00
parent
fc0a45fa41
commit
c6308b3153
@ -5,6 +5,7 @@ import re
|
|||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
|
determine_ext,
|
||||||
float_or_none,
|
float_or_none,
|
||||||
xpath_text,
|
xpath_text,
|
||||||
remove_end,
|
remove_end,
|
||||||
@ -116,13 +117,16 @@ class TwitterCardIE(TwitterBaseIE):
|
|||||||
video_url = config.get('video_url') or config.get('playlist', [{}])[0].get('source')
|
video_url = config.get('video_url') or config.get('playlist', [{}])[0].get('source')
|
||||||
|
|
||||||
if video_url:
|
if video_url:
|
||||||
f = {
|
if determine_ext(video_url) == 'm3u8':
|
||||||
'url': video_url,
|
formats.extend(self._extract_m3u8_formats(video_url, video_id, ext='mp4', m3u8_id='hls'))
|
||||||
}
|
else:
|
||||||
|
f = {
|
||||||
|
'url': video_url,
|
||||||
|
}
|
||||||
|
|
||||||
_search_dimensions_in_video_url(f, video_url)
|
_search_dimensions_in_video_url(f, video_url)
|
||||||
|
|
||||||
formats.append(f)
|
formats.append(f)
|
||||||
|
|
||||||
vmap_url = config.get('vmapUrl') or config.get('vmap_url')
|
vmap_url = config.get('vmapUrl') or config.get('vmap_url')
|
||||||
if vmap_url:
|
if vmap_url:
|
||||||
@ -263,7 +267,6 @@ class TwitterIE(InfoExtractor):
|
|||||||
'add_ie': ['Vine'],
|
'add_ie': ['Vine'],
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://twitter.com/captainamerica/status/719944021058060289',
|
'url': 'https://twitter.com/captainamerica/status/719944021058060289',
|
||||||
# md5 constantly changes
|
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '719944021058060289',
|
'id': '719944021058060289',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@ -272,6 +275,9 @@ class TwitterIE(InfoExtractor):
|
|||||||
'uploader_id': 'captainamerica',
|
'uploader_id': 'captainamerica',
|
||||||
'uploader': 'Captain America',
|
'uploader': 'Captain America',
|
||||||
},
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': True, # requires ffmpeg
|
||||||
|
},
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
Loading…
Reference in New Issue
Block a user