projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[odnoklassniki] Fix extraction (Closes #5671)
[youtube-dl]
/
youtube_dl
/
YoutubeDL.py
diff --git
a/youtube_dl/YoutubeDL.py
b/youtube_dl/YoutubeDL.py
index eaa436bf9a34029402c801784f4696b869fc035b..84d50dab7646537f3707f550e43b4b9ea2ca7ddd 100755
(executable)
--- a/
youtube_dl/YoutubeDL.py
+++ b/
youtube_dl/YoutubeDL.py
@@
-71,6
+71,7
@@
from .utils import (
write_string,
YoutubeDLHandler,
prepend_extension,
write_string,
YoutubeDLHandler,
prepend_extension,
+ replace_extension,
args_to_str,
age_restricted,
)
args_to_str,
age_restricted,
)
@@
-259,7
+260,6
@@
class YoutubeDL(object):
The following options are used by the post processors:
prefer_ffmpeg: If True, use ffmpeg instead of avconv if both are available,
otherwise prefer avconv.
The following options are used by the post processors:
prefer_ffmpeg: If True, use ffmpeg instead of avconv if both are available,
otherwise prefer avconv.
- exec_cmd: Arbitrary command to run after downloading
"""
params = None
"""
params = None
@@
-1085,7
+1085,9
@@
class YoutubeDL(object):
req_format = self.params.get('format')
if req_format is None:
req_format_list = []
req_format = self.params.get('format')
if req_format is None:
req_format_list = []
- if info_dict['extractor'] in ['youtube', 'ted'] and FFmpegMergerPP(self).available:
+ if (self.params.get('outtmpl', DEFAULT_OUTTMPL) != '-' and
+ info_dict['extractor'] in ['youtube', 'ted'] and
+ FFmpegMergerPP(self).available):
req_format_list.append('bestvideo+bestaudio')
req_format_list.append('best')
req_format = '/'.join(req_format_list)
req_format_list.append('bestvideo+bestaudio')
req_format_list.append('best')
req_format = '/'.join(req_format_list)
@@
-1270,7
+1272,7
@@
class YoutubeDL(object):
return
if self.params.get('writedescription', False):
return
if self.params.get('writedescription', False):
- descfn =
filename + '.description'
+ descfn =
replace_extension(filename, 'description', info_dict.get('ext'))
if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(descfn)):
self.to_screen('[info] Video description is already present')
elif info_dict.get('description') is None:
if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(descfn)):
self.to_screen('[info] Video description is already present')
elif info_dict.get('description') is None:
@@
-1285,7
+1287,7
@@
class YoutubeDL(object):
return
if self.params.get('writeannotations', False):
return
if self.params.get('writeannotations', False):
- annofn =
filename + '.annotations.xml'
+ annofn =
replace_extension(filename, 'annotations.xml', info_dict.get('ext'))
if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(annofn)):
self.to_screen('[info] Video annotations are already present')
else:
if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(annofn)):
self.to_screen('[info] Video annotations are already present')
else:
@@
-1332,7
+1334,7
@@
class YoutubeDL(object):
return
if self.params.get('writeinfojson', False):
return
if self.params.get('writeinfojson', False):
- infofn =
os.path.splitext(filename)[0] + '.info.json'
+ infofn =
replace_extension(filename, 'info.json', info_dict.get('ext'))
if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(infofn)):
self.to_screen('[info] Video description metadata is already present')
else:
if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(infofn)):
self.to_screen('[info] Video description metadata is already present')
else:
@@
-1403,7
+1405,7
@@
class YoutubeDL(object):
new_info = dict(info_dict)
new_info.update(f)
fname = self.prepare_filename(new_info)
new_info = dict(info_dict)
new_info.update(f)
fname = self.prepare_filename(new_info)
- fname = prepend_extension(fname, 'f%s' % f['format_id'])
+ fname = prepend_extension(fname, 'f%s' % f['format_id']
, new_info['ext']
)
downloaded.append(fname)
partial_success = dl(fname, new_info)
success = success and partial_success
downloaded.append(fname)
partial_success = dl(fname, new_info)
success = success and partial_success