[cleanup] Misc (#17159)

Closes #17196, Closes #17385
Authored by: bashonly, dialmaster, gamer191, BOplaid

Co-authored-by: Christopher Dial <dial.chris@gmail.com>
Co-authored-by: BOplaid <146466352+BOplaid@users.noreply.github.com>
Co-authored-by: gamer191 <83270075+gamer191@users.noreply.github.com>
This commit is contained in:
bashonly
2026-08-15 23:53:52 +00:00
committed by GitHub
co-authored by Christopher Dial BOplaid gamer191
parent 4dc054d51c
commit 4e969d3a6c
7 changed files with 61 additions and 25 deletions
+7 -19
View File
@@ -4,8 +4,8 @@ on:
branches: ['master']
paths:
- pyproject.toml
- .github/**
- devscripts/**
- .github/workflows/core.yml
- devscripts/run_tests.py
- test/**
- yt_dlp/**.py
- '!yt_dlp/extractor/**.py'
@@ -17,8 +17,8 @@ on:
branches: ['**']
paths:
- pyproject.toml
- .github/**
- devscripts/**
- .github/workflows/core.yml
- devscripts/run_tests.py
- test/**
- yt_dlp/**.py
- '!yt_dlp/extractor/**.py'
@@ -43,25 +43,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
# CPython 3.10 is in quick-test
os: [ubuntu-latest, windows-latest]
# Linux CPython 3.10 is covered by quick-test.yml
python-version: ['3.11', '3.12', '3.13', '3.14', '3.15', pypy-3.11]
include:
# atleast one of each CPython/PyPy tests must be in windows
- os: windows-latest
python-version: '3.10'
- os: windows-latest
python-version: '3.11'
- os: windows-latest
python-version: '3.12'
- os: windows-latest
python-version: '3.13'
- os: windows-latest
python-version: '3.14'
- os: windows-latest
python-version: '3.15'
- os: windows-latest
python-version: pypy-3.11
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -74,6 +61,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
check-latest: true
- name: Install test requirements (cpython)
if: ${{ !startsWith(matrix.python-version, 'pypy') }}
+1
View File
@@ -94,3 +94,4 @@ Triage Maintainers are frequent contributors who can manage issues and pull requ
- [pzhlkj6612](https://github.com/pzhlkj6612)
- [DTrombett](https://github.com/dtrombett)
- [grqz](https://github.com/grqz)
- [InvalidUsernameException](https://github.com/InvalidUsernameException)
+3 -3
View File
@@ -1309,7 +1309,7 @@ To summarize, the general syntax for a field is:
%(name[.keys][addition][>strf][,alternate][&replacement][|default])[flags][width][.precision][length]type
```
Additionally, you can set different output templates for the various metadata files separately from the general output template by specifying the type of file followed by the template separated by a colon `:`. The different file types supported are `subtitle`, `thumbnail`, `description`, `annotation` (deprecated), `infojson`, `link`, `pl_thumbnail`, `pl_description`, `pl_infojson`, `chapter`, `pl_video`. E.g. `-o "%(title)s.%(ext)s" -o "thumbnail:%(title)s\%(title)s.%(ext)s"` will put the thumbnails in a folder with the same name as the video. If any of the templates is empty, that type of file will not be written. E.g. `--write-thumbnail -o "thumbnail:"` will write thumbnails only for playlists and not for video.
Additionally, you can set different output templates for the various metadata files separately from the general output template by specifying the type of file followed by the template separated by a colon `:`. The different file types supported are `subtitle`, `thumbnail`, `description`, `annotation` (deprecated), `infojson`, `link`, `pl_thumbnail`, `pl_description`, `pl_infojson`, `chapter`, `pl_video`. E.g. `-o "%(title)s.%(ext)s" -o "thumbnail:%(title)s/%(title)s.%(ext)s"` will put the thumbnails in a folder with the same name as the video. If any of the templates is empty, that type of file will not be written. E.g. `--write-thumbnail -o "thumbnail:"` will write thumbnails only for playlists and not for video.
<a id="outtmpl-postprocess-note"></a>
@@ -1598,7 +1598,7 @@ Any string comparison may be prefixed with negation `!` in order to produce an o
**Note**: None of the aforementioned meta fields are guaranteed to be present since this solely depends on the metadata obtained by the particular extractor, i.e. the metadata offered by the website. Any other field made available by the extractor can also be used for filtering.
Formats for which the value is not known are excluded unless you put a question mark (`?`) after the operator. You can combine format filters, so `-f "bv[height<=?720][tbr>500]"` selects up to 720p videos (or videos where the height is not known) with a bitrate of at least 500 kbps. You can also use the filters with `all` to download all formats that satisfy the filter, e.g. `-f "all[vcodec=none]"` selects all audio-only formats.
Formats for which the value is not known are excluded unless you put a question mark (`?`) after the operator. You can combine format filters, so `-f "bv[height<=?720][tbr>500]"` selects up to 720p videos (or videos where the height is not known) with a bitrate greater than 500 kbps. You can also use the filters with `all` to download all formats that satisfy the filter, e.g. `-f "all[vcodec=none]"` selects all audio-only formats.
Format selectors can also be grouped using parentheses; e.g. `-f "(mp4,webm)[height<480]"` will download the best pre-merged mp4 and webm formats with a height lower than 480.
@@ -1862,7 +1862,7 @@ The following extractors use this feature:
* `player_client`: Clients to extract video data from. The currently available clients are `web`, `web_safari`, `web_embedded`, `web_music`, `web_creator`, `mweb`, `ios`, `visionos`, `android`, `android_vr`, `tv`, `tv_downgraded`, and `tv_simply`. By default, `visionos,android_vr,web` is used. If no JavaScript runtime/engine is available, then `web` is omitted. If logged-in cookies are passed to yt-dlp, then `tv_downgraded,web` is used for free accounts and `tv_downgraded,web_creator,web` is used for premium accounts. The `web_music` client is added for `music.youtube.com` URLs when logged-in cookies are used. The `web_embedded` client is added for age-restricted videos but only successfully works around the age-restriction sometimes (e.g. if the video is embeddable). The `tv_downgraded` client may be added as a fallback if `android_vr` or `visionos` is unable to access a video. The `web_creator` client is added for age-restricted videos if account age-verification is required. Some clients, such as `web_creator` and `web_music`, require a `po_token` for their formats to be downloadable. Some clients, such as `web_creator`, will only work with authentication. Not all clients support authentication via cookies. You can use `default` for the default clients, or you can use `all` for all clients (not recommended). You can prefix a client with `-` to exclude it, e.g. `youtube:player_client=default,-web`
* `player_skip`: Skip some network requests that are generally needed for robust extraction. One or more of `configs` (skip client configs), `webpage` (skip initial webpage), `js` (skip js player), `initial_data` (skip initial data/next ep request). While these options can help reduce the number of requests needed or avoid some rate-limiting, they could cause issues such as missing formats or metadata. See [#860](https://github.com/yt-dlp/yt-dlp/pull/860) and [#12826](https://github.com/yt-dlp/yt-dlp/issues/12826) for more details
* `webpage_skip`: Skip extraction of embedded webpage data. One or both of `player_response`, `initial_data`. These options are for testing purposes and don't skip any network requests. Neither is skipped by default; however, if a `player_js_version` value other than `actual` is used, then `webpage_skip=player_response` is implied
* `webpage_client`: Client to use for the video webpage request. One of `web` or `web_safari` (default)
* `webpage_client`: Client to use for the video webpage request. One of `web` (default) or `web_safari`
* `player_params`: YouTube player parameters to use for player requests. Will overwrite any default ones set by yt-dlp.
* `player_js_variant`: The player javascript variant to use for n/sig deciphering. The known variants are: `main`, `tcc`, `tce`, `es5`, `es6`, `es6_tcc`, `es6_tce`, `tv`, `tv_es6`, `phone`, `house`. The default is `main`, and the others are for debugging purposes. You can use `actual` to go with what is prescribed by the site
* `player_js_version`: The player javascript version to use for n/sig deciphering, in the format of `signature_timestamp@hash` (e.g. `20348@0004de42`). The default is to use what is prescribed by the site, and can be selected with `actual`. Using any other value will imply `webpage_skip=player_response`
+2 -1
View File
@@ -108,7 +108,7 @@ build = [
]
static-analysis = [
"autopep8~=2.0",
"ruff~=0.15.0",
"ruff~=0.16.0",
]
test = [
"pytest~=9.0",
@@ -253,6 +253,7 @@ exclude-newer = "7 days"
[tool.uv.exclude-newer-package]
protobug = false
pyinstaller = false
yt-dlp-ejs = false
[tool.ruff]
+4 -1
View File
@@ -32,6 +32,7 @@ from yt_dlp.utils import (
ExtractorError,
UnavailableVideoError,
YoutubeDLError,
filter_dict,
format_bytes,
join_nonempty,
)
@@ -137,7 +138,9 @@ def generator(test_case, tname):
expect_warnings(ydl, test_case.get('expected_warnings', []))
def get_tc_filename(tc):
return ydl.prepare_filename(dict(tc.get('info_dict', {})))
# Filename is generated from expected info dict, so filter out type wildcard values
return ydl.prepare_filename(
filter_dict(tc.get('info_dict', {}), cndn=lambda _, v: type(v) is not type))
res_dict = None
+1 -1
View File
@@ -290,7 +290,7 @@ class KnownPiracyIE(UnsupportedInfoExtractor):
r'highstream\.tv',
r'uqload\.com',
r'vedbam\.xyz',
r'vadbam\.net'
r'vadbam\.net',
r'vidlo\.us',
r'wolfstream\.tv',
r'xvideosharing\.com',
+43
View File
@@ -2198,6 +2198,49 @@ class YoutubeTabIE(YoutubeTabBaseInfoExtractor):
'extract_flat': True,
'playlist_items': '75',
},
}, {
# YoutubeTab_52
# "UUMO" is a prefix that can be used for any channel to get a members-only playlist
'note': 'flat playlist entry of subscriber_only video',
'url': 'https://www.youtube.com/playlist?list=UUMOXuqSBlHAE6Xw-yeJA0Tunw',
'info_dict': {
'id': 'UUMOXuqSBlHAE6Xw-yeJA0Tunw',
'availability': 'public',
'title': 'Members-only videos',
'description': 'Videos available to members of this channel. Automatically updated.',
'tags': [],
'modified_date': r're:\d{8}',
'channel': 'Linus Tech Tips',
'view_count': int,
'channel_id': 'UCXuqSBlHAE6Xw-yeJA0Tunw',
'channel_url': 'https://www.youtube.com/channel/UCXuqSBlHAE6Xw-yeJA0Tunw',
'uploader_url': 'https://www.youtube.com/@LinusTechTips',
'uploader_id': '@LinusTechTips',
'uploader': 'Linus Tech Tips',
},
'playlist': [{
'info_dict': {
# availability is the only value we are testing for here
'availability': 'subscriber_only',
'id': str,
'_type': 'url',
'title': str,
'duration': int,
'url': str,
'uploader': str,
'uploader_id': str,
'uploader_url': str,
'channel': str,
'channel_id': str,
'channel_url': str,
'ie_key': 'Youtube',
},
}],
'playlist_mincount': 1,
'params': {
'extract_flat': True,
'playlist_items': '1',
},
}]
@classmethod