mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 23:26:53 +01:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
27f774862d
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
from .common import FileDownloader
|
from .common import FileDownloader
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
|
check_executable,
|
||||||
encodeFilename,
|
encodeFilename,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -19,13 +20,11 @@ def real_download(self, filename, info_dict):
|
|||||||
encodeFilename(tmpfilename, for_subprocess=True)]
|
encodeFilename(tmpfilename, for_subprocess=True)]
|
||||||
|
|
||||||
for program in ['avconv', 'ffmpeg']:
|
for program in ['avconv', 'ffmpeg']:
|
||||||
try:
|
if check_executable(program, ['-version']):
|
||||||
subprocess.call([program, '-version'], stdout=(open(os.path.devnull, 'w')), stderr=subprocess.STDOUT)
|
|
||||||
break
|
break
|
||||||
except (OSError, IOError):
|
|
||||||
pass
|
|
||||||
else:
|
else:
|
||||||
self.report_error(u'm3u8 download detected but ffmpeg or avconv could not be found. Please install one.')
|
self.report_error(u'm3u8 download detected but ffmpeg or avconv could not be found. Please install one.')
|
||||||
|
return False
|
||||||
cmd = [program] + args
|
cmd = [program] + args
|
||||||
|
|
||||||
retval = subprocess.call(cmd)
|
retval = subprocess.call(cmd)
|
||||||
@ -42,5 +41,5 @@ def real_download(self, filename, info_dict):
|
|||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
self.to_stderr(u"\n")
|
self.to_stderr(u"\n")
|
||||||
self.report_error(u'ffmpeg exited with code %d' % retval)
|
self.report_error(u'%s exited with code %d' % (program, retval))
|
||||||
return False
|
return False
|
||||||
|
@ -8,9 +8,10 @@
|
|||||||
|
|
||||||
from .common import FileDownloader
|
from .common import FileDownloader
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
|
check_executable,
|
||||||
|
compat_str,
|
||||||
encodeFilename,
|
encodeFilename,
|
||||||
format_bytes,
|
format_bytes,
|
||||||
compat_str,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -103,9 +104,7 @@ def run_rtmpdump(args):
|
|||||||
test = self.params.get('test', False)
|
test = self.params.get('test', False)
|
||||||
|
|
||||||
# Check for rtmpdump first
|
# Check for rtmpdump first
|
||||||
try:
|
if not check_executable('rtmpdump', ['-h']):
|
||||||
subprocess.call(['rtmpdump', '-h'], stdout=(open(os.path.devnull, 'w')), stderr=subprocess.STDOUT)
|
|
||||||
except (OSError, IOError):
|
|
||||||
self.report_error('RTMP download detected but "rtmpdump" could not be run. Please install it.')
|
self.report_error('RTMP download detected but "rtmpdump" could not be run. Please install it.')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class CBSIE(InfoExtractor):
|
|||||||
}, {
|
}, {
|
||||||
'url': 'http://www.cbs.com/shows/liveonletterman/artist/221752/st-vincent/',
|
'url': 'http://www.cbs.com/shows/liveonletterman/artist/221752/st-vincent/',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'P9gjWjelt6iP',
|
'id': 'WWF_5KqY3PK1',
|
||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
'title': 'Live on Letterman - St. Vincent',
|
'title': 'Live on Letterman - St. Vincent',
|
||||||
'description': 'Live On Letterman: St. Vincent in concert from New York\'s Ed Sullivan Theater on Tuesday, July 16, 2014.',
|
'description': 'Live On Letterman: St. Vincent in concert from New York\'s Ed Sullivan Theater on Tuesday, July 16, 2014.',
|
||||||
|
@ -71,7 +71,8 @@ def _real_extract(self, url):
|
|||||||
if items_json is None:
|
if items_json is None:
|
||||||
CONTENT_ID_REGEXES = [
|
CONTENT_ID_REGEXES = [
|
||||||
r'YUI\.namespace\("Media"\)\.CONTENT_ID\s*=\s*"([^"]+)"',
|
r'YUI\.namespace\("Media"\)\.CONTENT_ID\s*=\s*"([^"]+)"',
|
||||||
r'root\.App\.Cache\.context\.videoCache\.curVideo = \{"([^"]+)"'
|
r'root\.App\.Cache\.context\.videoCache\.curVideo = \{"([^"]+)"',
|
||||||
|
r'"first_videoid"\s*:\s*"([^"]+)"',
|
||||||
]
|
]
|
||||||
long_id = self._search_regex(CONTENT_ID_REGEXES, webpage, 'content ID')
|
long_id = self._search_regex(CONTENT_ID_REGEXES, webpage, 'content ID')
|
||||||
video_id = long_id
|
video_id = long_id
|
||||||
|
Loading…
Reference in New Issue
Block a user