diff options
Diffstat (limited to 'devscripts')
-rwxr-xr-x | devscripts/bash-completion.py | 8 | ||||
-rw-r--r-- | devscripts/changelog_override.json | 11 | ||||
-rwxr-xr-x[-rw-r--r--] | devscripts/cli_to_api.py | 2 | ||||
-rw-r--r-- | devscripts/make_changelog.py | 10 | ||||
-rwxr-xr-x | devscripts/make_readme.py | 12 | ||||
-rw-r--r-- | devscripts/set-variant.py | 2 | ||||
-rw-r--r-- | devscripts/update-version.py | 2 | ||||
-rwxr-xr-x | devscripts/zsh-completion.py | 16 |
8 files changed, 38 insertions, 25 deletions
diff --git a/devscripts/bash-completion.py b/devscripts/bash-completion.py index 9b4a9d4..3918ebd 100755 --- a/devscripts/bash-completion.py +++ b/devscripts/bash-completion.py @@ -9,8 +9,8 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import yt_dlp -BASH_COMPLETION_FILE = "completions/bash/yt-dlp" -BASH_COMPLETION_TEMPLATE = "devscripts/bash-completion.in" +BASH_COMPLETION_FILE = 'completions/bash/yt-dlp' +BASH_COMPLETION_TEMPLATE = 'devscripts/bash-completion.in' def build_completion(opt_parser): @@ -21,9 +21,9 @@ def build_completion(opt_parser): opts_flag.append(option.get_opt_string()) with open(BASH_COMPLETION_TEMPLATE) as f: template = f.read() - with open(BASH_COMPLETION_FILE, "w") as f: + with open(BASH_COMPLETION_FILE, 'w') as f: # just using the special char - filled_template = template.replace("{{flags}}", " ".join(opts_flag)) + filled_template = template.replace('{{flags}}', ' '.join(opts_flag)) f.write(filled_template) diff --git a/devscripts/changelog_override.json b/devscripts/changelog_override.json index 86e8ec2..ced38a0 100644 --- a/devscripts/changelog_override.json +++ b/devscripts/changelog_override.json @@ -169,5 +169,16 @@ "when": "5c019f6328ad40d66561eac3c4de0b3cd070d0f6", "short": "[cleanup] Misc (#9765)", "authors": ["bashonly", "Grub4K", "seproDev"] + }, + { + "action": "change", + "when": "e6a22834df1776ec4e486526f6df2bf53cb7e06f", + "short": "[ie/orf:on] Add `prefer_segments_playlist` extractor-arg (#10314)", + "authors": ["seproDev"] + }, + { + "action": "add", + "when": "6aaf96a3d6e7d0d426e97e11a2fcf52fda00e733", + "short": "[priority] Security: [[CVE-2024-10123](https://nvd.nist.gov/vuln/detail/CVE-2024-10123)] [Properly sanitize file-extension to prevent file system modification and RCE](https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-79w7-vh3h-8g4j)\n - Unsafe extensions are now blocked from being downloaded" } ] diff --git a/devscripts/cli_to_api.py b/devscripts/cli_to_api.py index 2aa51eb..9c2710e 100644..100755 --- a/devscripts/cli_to_api.py +++ b/devscripts/cli_to_api.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + # Allow direct execution import os import sys diff --git a/devscripts/make_changelog.py b/devscripts/make_changelog.py index 8e199e7..00634fb 100644 --- a/devscripts/make_changelog.py +++ b/devscripts/make_changelog.py @@ -223,10 +223,10 @@ class Changelog: return message if not sep else f'{message}{sep}{rest}' - def _format_message_link(self, message, hash): - assert message or hash, 'Improperly defined commit message or override' - message = message if message else hash[:HASH_LENGTH] - return f'[{message}]({self.repo_url}/commit/{hash})' if hash else message + def _format_message_link(self, message, commit_hash): + assert message or commit_hash, 'Improperly defined commit message or override' + message = message if message else commit_hash[:HASH_LENGTH] + return f'[{message}]({self.repo_url}/commit/{commit_hash})' if commit_hash else message def _format_issues(self, issues): return ', '.join(f'[#{issue}]({self.repo_url}/issues/{issue})' for issue in issues) @@ -356,7 +356,7 @@ class CommitRange: logger.info(f'CHANGE {self._commits[commit.hash]} -> {commit}') self._commits[commit.hash] = commit - self._commits = {key: value for key, value in reversed(self._commits.items())} + self._commits = dict(reversed(self._commits.items())) def groups(self): group_dict = defaultdict(list) diff --git a/devscripts/make_readme.py b/devscripts/make_readme.py index 2270b31..cbb5859 100755 --- a/devscripts/make_readme.py +++ b/devscripts/make_readme.py @@ -51,7 +51,7 @@ PATCHES = ( ), ( # Headings r'(?m)^ (\w.+\n)( (?=\w))?', - r'## \1' + r'## \1', ), ( # Fixup `--date` formatting rf'(?m)( --date DATE.+({delim}[^\[]+)*)\[.+({delim}.+)*$', @@ -61,26 +61,26 @@ PATCHES = ( ), ( # Do not split URLs rf'({delim[:-1]})? (?P<label>\[\S+\] )?(?P<url>https?({delim})?:({delim})?/({delim})?/(({delim})?\S+)+)\s', - lambda mobj: ''.join((delim, mobj.group('label') or '', re.sub(r'\s+', '', mobj.group('url')), '\n')) + lambda mobj: ''.join((delim, mobj.group('label') or '', re.sub(r'\s+', '', mobj.group('url')), '\n')), ), ( # Do not split "words" rf'(?m)({delim}\S+)+$', - lambda mobj: ''.join((delim, mobj.group(0).replace(delim, ''))) + lambda mobj: ''.join((delim, mobj.group(0).replace(delim, ''))), ), ( # Allow overshooting last line rf'(?m)^(?P<prev>.+)${delim}(?P<current>.+)$(?!{delim})', lambda mobj: (mobj.group().replace(delim, ' ') if len(mobj.group()) - len(delim) + 1 <= max_width + ALLOWED_OVERSHOOT - else mobj.group()) + else mobj.group()), ), ( # Avoid newline when a space is available b/w switch and description DISABLE_PATCH, # This creates issues with prepare_manpage r'(?m)^(\s{4}-.{%d})(%s)' % (switch_col_width - 6, delim), - r'\1 ' + r'\1 ', ), ( # Replace brackets with a Markdown link r'SponsorBlock API \((http.+)\)', - r'[SponsorBlock API](\1)' + r'[SponsorBlock API](\1)', ), ) diff --git a/devscripts/set-variant.py b/devscripts/set-variant.py index 10341e7..24ce455 100644 --- a/devscripts/set-variant.py +++ b/devscripts/set-variant.py @@ -30,7 +30,7 @@ def property_setter(name, value): opts = parse_options() transform = compose_functions( property_setter('VARIANT', opts.variant), - property_setter('UPDATE_HINT', opts.update_message) + property_setter('UPDATE_HINT', opts.update_message), ) write_file(VERSION_FILE, transform(read_file(VERSION_FILE))) diff --git a/devscripts/update-version.py b/devscripts/update-version.py index 07a0717..2018ba8 100644 --- a/devscripts/update-version.py +++ b/devscripts/update-version.py @@ -24,7 +24,7 @@ def get_new_version(version, revision): else: old_version = read_version().split('.') if version.split('.') == old_version[:3]: - revision = str(int((old_version + [0])[3]) + 1) + revision = str(int(([*old_version, 0])[3]) + 1) return f'{version}.{revision}' if revision else version diff --git a/devscripts/zsh-completion.py b/devscripts/zsh-completion.py index 267af5f..8e190c0 100755 --- a/devscripts/zsh-completion.py +++ b/devscripts/zsh-completion.py @@ -9,15 +9,15 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import yt_dlp -ZSH_COMPLETION_FILE = "completions/zsh/_yt-dlp" -ZSH_COMPLETION_TEMPLATE = "devscripts/zsh-completion.in" +ZSH_COMPLETION_FILE = 'completions/zsh/_yt-dlp' +ZSH_COMPLETION_TEMPLATE = 'devscripts/zsh-completion.in' def build_completion(opt_parser): opts = [opt for group in opt_parser.option_groups for opt in group.option_list] - opts_file = [opt for opt in opts if opt.metavar == "FILE"] - opts_dir = [opt for opt in opts if opt.metavar == "DIR"] + opts_file = [opt for opt in opts if opt.metavar == 'FILE'] + opts_dir = [opt for opt in opts if opt.metavar == 'DIR'] fileopts = [] for opt in opts_file: @@ -38,11 +38,11 @@ def build_completion(opt_parser): with open(ZSH_COMPLETION_TEMPLATE) as f: template = f.read() - template = template.replace("{{fileopts}}", "|".join(fileopts)) - template = template.replace("{{diropts}}", "|".join(diropts)) - template = template.replace("{{flags}}", " ".join(flags)) + template = template.replace('{{fileopts}}', '|'.join(fileopts)) + template = template.replace('{{diropts}}', '|'.join(diropts)) + template = template.replace('{{flags}}', ' '.join(flags)) - with open(ZSH_COMPLETION_FILE, "w") as f: + with open(ZSH_COMPLETION_FILE, 'w') as f: f.write(template) |