aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbashonly <88596187+bashonly@users.noreply.github.com>2025-02-18 20:29:29 -0600
committerGitHub <noreply@github.com>2025-02-19 02:29:29 +0000
commit4985a4041770eaa0016271809a1fd950dc809a55 (patch)
treeb16ffbdd6b8282432e4e3fa72bdc19670ab4ad9a
parent01a63629a21781458dcbd38779898e117678f5ff (diff)
[cleanup] Misc (#12238)
Authored by: StefanLobbenmeier, dirkf, Grub4K Co-authored-by: Stefan Lobbenmeier <Stefan.Lobbenmeier@gmail.com> Co-authored-by: dirkf <fieldhouse@gmx.net> Co-authored-by: Simon Sawicki <contact@grub4k.xyz>
-rw-r--r--.github/workflows/codeql.yml6
-rw-r--r--README.md2
-rwxr-xr-xdevscripts/run_tests.py3
-rw-r--r--yt_dlp/__init__.py10
-rw-r--r--yt_dlp/extractor/pbs.py2
5 files changed, 13 insertions, 10 deletions
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 170a6ac19..910c409ef 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -33,7 +33,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@v2
+ uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -47,7 +47,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- uses: github/codeql-action/autobuild@v2
+ uses: github/codeql-action/autobuild@v3
# â„šī¸ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -60,6 +60,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v2
+ uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
diff --git a/README.md b/README.md
index 0ac27c462..e8ef1980a 100644
--- a/README.md
+++ b/README.md
@@ -1525,7 +1525,7 @@ The available fields are:
- `hasvid`: Gives priority to formats that have a video stream
- `hasaud`: Gives priority to formats that have an audio stream
- `ie_pref`: The format preference
- - `lang`: The language preference
+ - `lang`: The language preference as determined by the extractor (e.g. original language preferred over audio description)
- `quality`: The quality of the format
- `source`: The preference of the source
- `proto`: Protocol used for download (`https`/`ftps` > `http`/`ftp` > `m3u8_native`/`m3u8` > `http_dash_segments`> `websocket_frag` > `mms`/`rtsp` > `f4f`/`f4m`)
diff --git a/devscripts/run_tests.py b/devscripts/run_tests.py
index eb614fe59..ebb3500b6 100755
--- a/devscripts/run_tests.py
+++ b/devscripts/run_tests.py
@@ -25,7 +25,8 @@ def parse_args():
def run_tests(*tests, pattern=None, ci=False):
- run_core = 'core' in tests or (not pattern and not tests)
+ # XXX: hatch uses `tests` if no arguments are passed
+ run_core = 'core' in tests or 'tests' in tests or (not pattern and not tests)
run_download = 'download' in tests
pytest_args = args.pytest_args or os.getenv('HATCH_TEST_ARGS', '')
diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py
index c76fe2748..3819656e2 100644
--- a/yt_dlp/__init__.py
+++ b/yt_dlp/__init__.py
@@ -295,18 +295,20 @@ def validate_options(opts):
raise ValueError(f'invalid {key} retry sleep expression {expr!r}')
# Bytes
- def validate_bytes(name, value):
+ def validate_bytes(name, value, strict_positive=False):
if value is None:
return None
numeric_limit = parse_bytes(value)
- validate(numeric_limit is not None, 'rate limit', value)
+ validate(numeric_limit is not None, name, value)
+ if strict_positive:
+ validate_positive(name, numeric_limit, True)
return numeric_limit
- opts.ratelimit = validate_bytes('rate limit', opts.ratelimit)
+ opts.ratelimit = validate_bytes('rate limit', opts.ratelimit, True)
opts.throttledratelimit = validate_bytes('throttled rate limit', opts.throttledratelimit)
opts.min_filesize = validate_bytes('min filesize', opts.min_filesize)
opts.max_filesize = validate_bytes('max filesize', opts.max_filesize)
- opts.buffersize = validate_bytes('buffer size', opts.buffersize)
+ opts.buffersize = validate_bytes('buffer size', opts.buffersize, True)
opts.http_chunk_size = validate_bytes('http chunk size', opts.http_chunk_size)
# Output templates
diff --git a/yt_dlp/extractor/pbs.py b/yt_dlp/extractor/pbs.py
index 2f839a2e9..53b199415 100644
--- a/yt_dlp/extractor/pbs.py
+++ b/yt_dlp/extractor/pbs.py
@@ -501,7 +501,7 @@ class PBSIE(InfoExtractor):
r"div\s*:\s*'videoembed'\s*,\s*mediaid\s*:\s*'(\d+)'", # frontline video embed
r'class="coveplayerid">([^<]+)<', # coveplayer
r'<section[^>]+data-coveid="(\d+)"', # coveplayer from http://www.pbs.org/wgbh/frontline/film/real-csi/
- r'\bclass="passportcoveplayer"[^>]+\bdata-media="(\d+)', # https://www.thirteen.org/programs/the-woodwrights-shop/who-wrote-the-book-of-sloyd-fggvvq/
+ r'\sclass="passportcoveplayer"[^>]*\sdata-media="(\d+)', # https://www.thirteen.org/programs/the-woodwrights-shop/who-wrote-the-book-of-sloyd-fggvvq/
r'<input type="hidden" id="pbs_video_id_[0-9]+" value="([0-9]+)"/>', # jwplayer
r"(?s)window\.PBS\.playerConfig\s*=\s*{.*?id\s*:\s*'([0-9]+)',",
r'<div[^>]+\bdata-cove-id=["\'](\d+)"', # http://www.pbs.org/wgbh/roadshow/watch/episode/2105-indianapolis-hour-2/