A feature-rich command-line audio/video downloader
[cleanup] Misc fixes (see desc)
pukkandan3fe75fdc803d
diff --git a/README.md b/README.mdindex dc1fad5b37..ed87a32738 100644--- a/README.md+++ b/README.md@@ -320,9 +320,7 @@ You can also fork the project on github and run your fork's [build workflow](.gi## General Options:-h, --help Print this help text and exit--version Print program version and exit- -U, --update Update this program to latest version. Make- sure that you have sufficient permissions- (run with sudo if needed)+ -U, --update Update this program to latest version-i, --ignore-errors Ignore download and postprocessing errors.The download will be considered successfuleven if the postprocessing failsdiff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.pyindex cc36e2c9cd..50342c2ca7 100644--- a/yt_dlp/YoutubeDL.py+++ b/yt_dlp/YoutubeDL.py@@ -3151,16 +3151,16 @@ class YoutubeDL:if fixup_policy in ('ignore', 'never'):returnelif fixup_policy == 'warn':- do_fixup = False+ do_fixup = 'warn'elif fixup_policy != 'force':assert fixup_policy in ('detect_or_warn', None)if not info_dict.get('__real_download'):do_fixup = Falsedef ffmpeg_fixup(cndn, msg, cls):- if not cndn:+ if not (do_fixup and cndn):return- if not do_fixup:+ elif do_fixup == 'warn':self.report_warning(f'{vid}: {msg}')returnpp = cls(self)diff --git a/yt_dlp/downloader/fragment.py b/yt_dlp/downloader/fragment.pyindex 451e3cc2fe..4655f067fc 100644--- a/yt_dlp/downloader/fragment.py+++ b/yt_dlp/downloader/fragment.py@@ -123,7 +123,7 @@ class FragmentFD(FileDownloader):'request_data': request_data,'ctx_id': ctx.get('ctx_id'),}- success = ctx['dl'].download(fragment_filename, fragment_info_dict)+ success, _ = ctx['dl'].download(fragment_filename, fragment_info_dict)if not success:return Falseif fragment_info_dict.get('filetime'):diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.pyindex 441d8a1364..97cd524bc7 100644--- a/yt_dlp/extractor/common.py+++ b/yt_dlp/extractor/common.py@@ -2808,7 +2808,7 @@ class InfoExtractor:content_type = 'video'elif codecs['acodec'] != 'none':content_type = 'audio'- elif codecs.get('tcodec', 'none') != 'none':+ elif codecs.get('scodec', 'none') != 'none':content_type = 'text'elif mimetype2ext(mime_type) in ('tt', 'dfxp', 'ttml', 'xml', 'json'):content_type = 'text'diff --git a/yt_dlp/options.py b/yt_dlp/options.pyindex c03f693194..944147871d 100644--- a/yt_dlp/options.py+++ b/yt_dlp/options.py@@ -236,7 +236,7 @@ def create_parser():general.add_option('-U', '--update',action='store_true', dest='update_self',- help='Update this program to latest version. Make sure that you have sufficient permissions (run with sudo if needed)')+ help='Update this program to latest version')general.add_option('-i', '--ignore-errors',action='store_true', dest='ignoreerrors',diff --git a/yt_dlp/utils.py b/yt_dlp/utils.pyindex fc9eb253bf..0b28b0926f 100644--- a/yt_dlp/utils.py+++ b/yt_dlp/utils.py@@ -1859,7 +1859,7 @@ def write_string(s, out=None, encoding=None):from .compat import WINDOWS_VT_MODE # Must be imported locallyif WINDOWS_VT_MODE:- s = s.replace('\n', ' \n')+ s = re.sub(r'([\r\n]+)', r' \1', s)if 'b' in getattr(out, 'mode', ''):byt = s.encode(encoding or preferredencoding(), 'ignore')@@ -3177,7 +3177,7 @@ def parse_codecs(codecs_str):return {}split_codecs = list(filter(None, map(str.strip, codecs_str.strip().strip(',').split(','))))- vcodec, acodec, tcodec, hdr = None, None, None, None+ vcodec, acodec, scodec, hdr = None, None, None, Nonefor full_codec in split_codecs:parts = full_codec.split('.')codec = parts[0].replace('0', '')@@ -3195,16 +3195,16 @@ def parse_codecs(codecs_str):if not acodec:acodec = full_codecelif codec in ('stpp', 'wvtt',):- if not tcodec:- tcodec = full_codec+ if not scodec:+ scodec = full_codecelse:write_string(f'WARNING: Unknown codec {full_codec}\n')- if vcodec or acodec or tcodec:+ if vcodec or acodec or scodec:return {'vcodec': vcodec or 'none','acodec': acodec or 'none','dynamic_range': hdr,- **({'tcodec': tcodec} if tcodec is not None else {}),+ **({'scodec': scodec} if scodec is not None else {}),}elif len(split_codecs) == 2:return {