aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/YoutubeDL.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2021-01-04 22:10:47 +0530
committerpukkandan <pukkandan@gmail.com>2021-01-05 02:36:09 +0530
commit91ebc64068d2957400dbfaadff23e995392b3963 (patch)
treeebaf13430c45fdef23815fed611d393ae1679c8c /youtube_dlc/YoutubeDL.py
parent50865ca803a130308c064c2de5c7140754382993 (diff)
downloadhypervideo-pre-91ebc64068d2957400dbfaadff23e995392b3963.tar.lz
hypervideo-pre-91ebc64068d2957400dbfaadff23e995392b3963.tar.xz
hypervideo-pre-91ebc64068d2957400dbfaadff23e995392b3963.zip
Change defaults
* Enabled --ignore by default * Disabled --video-multistreams and --audio-multistreams by default * Changed default format selection to 'bv*+ba/b' when --audio-multistreams is disabled * Changed default format sort order to 'res,fps,codec,size,br,asr,proto,ext,has_audio,source,format_id' * Changed default output template to '%(title)s [%(id)s].%(ext)s' * Enabled `--list-formats-as-table` by default
Diffstat (limited to 'youtube_dlc/YoutubeDL.py')
-rw-r--r--youtube_dlc/YoutubeDL.py37
1 files changed, 17 insertions, 20 deletions
diff --git a/youtube_dlc/YoutubeDL.py b/youtube_dlc/YoutubeDL.py
index 715eaa7dc..e632ba708 100644
--- a/youtube_dlc/YoutubeDL.py
+++ b/youtube_dlc/YoutubeDL.py
@@ -178,7 +178,7 @@ class YoutubeDL(object):
outtmpl: Template for output names.
restrictfilenames: Do not allow "&" and spaces in file names.
trim_file_name: Limit length of filename (extension excluded).
- ignoreerrors: Do not stop on download errors.
+ ignoreerrors: Do not stop on download errors. (Default False when running youtube-dlc, but True when directly accessing YoutubeDL class)
force_generic_extractor: Force downloader to use the generic extractor
nooverwrites: Prevent overwriting files.
playliststart: Playlist item to start at.
@@ -1185,23 +1185,20 @@ class YoutubeDL(object):
merger = FFmpegMergerPP(self)
return merger.available and merger.can_merge()
- def prefer_best():
- if self.params.get('simulate', False):
- return False
- if not download:
- return False
- if self.params.get('outtmpl', DEFAULT_OUTTMPL) == '-':
- return True
- if info_dict.get('is_live'):
- return True
- if not can_merge():
- return True
- return False
-
- req_format_list = ['bestvideo+bestaudio', 'best']
- if prefer_best():
- req_format_list.reverse()
- return '/'.join(req_format_list)
+ prefer_best = (
+ not self.params.get('simulate', False)
+ and download
+ and (
+ not can_merge()
+ or info_dict.get('is_live')
+ or self.params.get('outtmpl', DEFAULT_OUTTMPL) == '-'))
+
+ return (
+ 'best/bestvideo+bestaudio'
+ if prefer_best
+ else 'bestvideo*+bestaudio/best'
+ if self.params.get('allow_multiple_audio_streams', False)
+ else 'bestvideo+bestaudio/best')
def build_format_selector(self, format_spec):
def syntax_error(note, start):
@@ -1216,8 +1213,8 @@ class YoutubeDL(object):
GROUP = 'GROUP'
FormatSelector = collections.namedtuple('FormatSelector', ['type', 'selector', 'filters'])
- allow_multiple_streams = {'audio': self.params.get('allow_multiple_audio_streams', True),
- 'video': self.params.get('allow_multiple_video_streams', True)}
+ allow_multiple_streams = {'audio': self.params.get('allow_multiple_audio_streams', False),
+ 'video': self.params.get('allow_multiple_video_streams', False)}
def _parse_filter(tokens):
filter_parts = []