Commit Graph

154 Commits (2bea7936323ca4b6f3b9b1fdd892566223e30efa)

Author SHA1 Message Date
sepro f95a92b3d0
[cleanup] Deprecate more compat functions ()
Authored by: seproDev
rakslice 8f4ea14680
Fix format sorting bug with vp9.2 vcodec ()
Authored by: rakslice
sepro 0b570f2a90
[core] Do not alter default format selection when simulated ()
Closes 
Authored by: seproDev
sepro add96eb9f8
[cleanup] Add more ruff rules ()
Authored by: seproDev

Reviewed-by: bashonly <88596187+bashonly@users.noreply.github.com>
Reviewed-by: Simon Sawicki <contact@grub4k.xyz>
pukkandan 86a972033e
Infer `acodec` for single-codec containers
Lev 104a7b5a46
[ie] Migrate commonly plural fields to lists ()
Authored by: llistochek, pukkandan
Related: 
Simon Sawicki f9fb3ce86e
[cleanup] Misc ()
Authored by: bashonly, pukkandan, seproDev, Grub4K

Co-authored-by: bashonly <bashonly@protonmail.com>
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
Co-authored-by: sepro <4618135+seproDev@users.noreply.github.com>
Simon Sawicki 00cdda4f6f
[core] Fix format selection parse error for CPython 3.12 ()
Authored by: Grub4K
pukkandan 993edd3f6e
[outtmpl] Support multiplication
Related: 
Simon Sawicki de015e9307
[core] Prevent RCE when using `--exec` with `%q` (CVE-2023-40581)
The shell escape function is now using `""` instead of `\"`. `utils.Popen` has been patched to properly quote commands.

Prior to this fix using `--exec` together with `%q` when on Windows could cause remote code to execute. See https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-42h4-v29r-42qg for reference.

Authored by: Grub4K
bashonly 5ca095cbcd
[cleanup] Misc ()
Closes , Closes 
Authored by: barsnick, sqrtNOT, gamer191, coletdjnz, Grub4K, bashonly
pukkandan 6148833f5c
[cleanup] Misc
pukkandan 62b5c94cad
[cleanup] Misc fixes
Closes 
pukkandan a264433c9f
[outtmpl] Fix replacement for `playlist_index`
bashonly 6c5211cebe
[core] Fix HTTP headers and cookie handling
- Remove `Cookie` header from `http_headers` immediately after loading into cookiejar
- Restore compat for `--load-info-json` cookies
- Add more tests
- Fix improper passing of Cookie header by `MailRu` extractor

Closes 
Authored by: bashonly, pukkandan
Simon Sawicki 3121512228
[core] Change how `Cookie` headers are handled
Cookies are now saved and loaded under `cookies` key in the info dict
instead of `http_headers.Cookie`. Cookies passed in headers are
auto-scoped to the input URLs with a warning.

Ref: https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-v8mc-9377-rwjj

Authored by: Grub4K
pukkandan 47bcd43724
[outtmpl] Pad `playlist_index` etc even when with internal formatting
Closes 
pukkandan 1619ab3e67
Bugfix for ebe1b4e34f
pukkandan ad54c9130e
[cleanup] Misc
Closes , Closes , Closes , Closes , Closes 
Authored by: mikf, freezboltz, pukkandan
pukkandan ebe1b4e34f
[outtmpl] Fix some minor bugs
Closes 
coletdjnz 08916a49c7
[core] Improve HTTP redirect handling ()
Aligns HTTP redirect handling with what browsers commonly do and RFC standards. 

Fixes issues afac4caa7d missed.

Authored by: coletdjnz
pukkandan 6f2287cb18
[cleanup] Misc
Closes , closes 
pukkandan ec9311c41b
[outtmpl] Support `str.format` syntax inside replacements
Closes 
pukkandan 78fde6e339
[outtmpl] Allow `\n` in replacements and default.
Fixes: https://github.com/yt-dlp/yt-dlp/issues/6808#issuecomment-1510055357
Fixes: https://github.com/yt-dlp/yt-dlp/issues/6808#issuecomment-1510363645
pukkandan 9f14daf22b
[extractor] Deprecate `_sort_formats`
pukkandan 07a1250e0e
[outtmpl] Curly braces to filter keys
pukkandan d2c8aadf79
[cleanup] Misc
Closes , Closes , Closes 
Authored by: pukkandan, MrRawes, DavidH-2022
pukkandan 97d9c79e92
Fix tests for 989a01c261
pukkandan f2df407165
[cleanup] Misc cleanup
pukkandan 14f25df2b6
[compat] Remove deprecated functions from core code
pukkandan 54007a45f1
[cleanup] Consistent style for file heads
pukkandan ac66811112
[compat] Remove more functions
Removing any more will require changes to a large number of extractors
pukkandan f0500bd1e4
[test] Fix `FakeYDL` signatures
Authored by: coletdjnz
pukkandan 7e9a612585
Add option `--lazy-playlist` to process entries as they are received
pukkandan 7e88d7d78f
Add slicing notation to `--playlist-items`
* Adds support for negative indices and step
* Add `-I` as alias for `--playlist-index`
* Deprecates `--playlist-start`, `--playlist-end`, `--playlist-reverse`, `--no-playlist-reverse`

Closes , Closes 
pukkandan 0a5a191a2a
Improve `--clean-infojson`
It should not removes fields that may be needed for `--load-infojson`.
Eg: `_ffmpeg_args`, `_has_drm`
pukkandan f82711587c
[cleanup] Sort imports
Using https://github.com/PyCQA/isort

    isort -m VERTICAL_HANGING_INDENT --py 36 -l 80 --rr -n --tc .
pukkandan 86e5f3ed2e
[cleanup] Upgrade syntax
Using https://github.com/asottile/pyupgrade

1. `__future__` imports and `coding: utf-8` were removed
2. Files were rewritten with `pyupgrade --py36-plus --keep-percent-format`
3. f-strings were cherry-picked from `pyupgrade --py36-plus`

Extractors are left untouched (except removing header) to avoid unnecessary merge conflicts
pukkandan 34baa9fdf0
[outtmpl] Fix replacement/default when used with alternate
pukkandan 6db9c4d57d
Ignore format-specific fields in initial pass of `--match-filter`
Closes 
pukkandan 09b49e1f68
Add pre-processor stage `after_filter`
* Move `_match_entry` and `post_extract` to `process_video_result`. It is also left in `process_info` for API compat
* `--list-...` options and `--force-write-archive` now obey filtering options
* Move `SponsorBlockPP` to `after_filter`. Closes https://github.com/yt-dlp/yt-dlp/issues/2536
* Reverts 4ec82a72bb since this commit addresses the issue it was solving
pukkandan 9e907ebddf
[cleanup] Misc cleanup
pukkandan f46e2f9d92
Add key `requested_downloads` in the root `info_dict`
pukkandan abbeeebc4c
[outtmpl] Alternate form for `D` and fix suffix's case
Fixes: https://github.com/yt-dlp/yt-dlp/issues/2085#issuecomment-1002247689, https://github.com/yt-dlp/yt-dlp/pull/2132/files#r775729811
pukkandan 37893bb0c9
[outtmpl] Change filename sanitization type to `S`
`F` is already used for float!
Bug in e0fd95737d
pukkandan b69fd25c25
[cleanup] Misc cleanup
Closes     
pukkandan e0fd95737d
[outtmpl] Add alternate forms `F`, `D`
and improve `id` detection

F = sanitize as filename (# = restricted)
D = add Decimal suffixes

Closes , 2081
PilzAdam e978789f0f
[outtmpl] Add operator `&` for replacement text ()
Authored by: PilzAdam
pukkandan dd2a987d3f
[tests] Fix tests
pukkandan 4476d2c764
[outtmpl] Add alternate forms for `q` and `j`