aboutsummaryrefslogtreecommitdiff
path: root/test/test_utils.py
AgeCommit message (Collapse)Author
2024-05-26[ie/youtube] Extract upload timestamp if available (#9856)coletdjnz
Closes #4962, Closes #9829 Authored by: coletdjnz
2024-04-28[core/windows] Fix tests for `sys.executable` with spaces (Fix for ↵Simon Sawicki
64766459e37451b665c1464073c28361fbcf1c25) Authored by: Grub4K
2024-04-27[core/windows] Improve shell quoting and tests (#9802)Simon Sawicki
Authored by: Grub4K
2024-04-09[core] Prevent RCE when using `--exec` with `%q` (CVE-2024-22423)Simon Sawicki
The shell escape function now properly escapes `%`, `\\` and `\n`. `utils.Popen` as well as `%q` output template expansion have been patched accordingly. 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-hjq6-52gw-2g7p for more details. Authored by: Grub4K
2024-03-30[test] `traversal`: Separate traversal tests (#9574)Simon Sawicki
Authored by: Grub4K
2024-03-11[docs] Misc Cleanup (#8977)pukkandan
Closes #8355, #8944 Authored by: bashonly, Grub4k, Arthurszzz, seproDev, pukkandan Co-authored-by: sepro <4618135+seproDev@users.noreply.github.com> Co-authored-by: bashonly <bashonly@protonmail.com> Co-authored-by: Arthurszzz <minecraftgamerarthur@gmail.com> Co-authored-by: Simon Sawicki <accounts@grub4k.xyz> Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2024-01-05[utils] `traverse_obj`: Support `xml.etree.ElementTree.Element` (#8911)Simon Sawicki
Authored by: Grub4K
2023-12-30[cleanup] Misc (#8598)Simon Sawicki
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>
2023-12-20[networking] Strip whitespace around header values (#8802)coletdjnz
Fixes https://github.com/yt-dlp/yt-dlp/issues/8729 Authored by: coletdjnz
2023-12-06[utils] `traverse_obj`: Move `is_user_input` into output template (#8673)Simon Sawicki
Authored by: Grub4K
2023-10-08[utils] `js_to_json`: Fix `Date` constructor parsing (#8295)Awal Garg
Authored by: awalgarg, Grub4K
2023-09-24[cleanup] MiscSimon Sawicki
Authored by: Grub4K
2023-09-24[core] Prevent RCE when using `--exec` with `%q` (CVE-2023-40581)Simon Sawicki
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
2023-09-21[utils] `js_to_json`: Handle `Array` objectsbashonly
Authored by: Grub4K, std-move Co-authored-by: std-move <26625259+std-move@users.noreply.github.com> Co-authored-by: Simon Sawicki <accounts@grub4k.xyz>
2023-07-30[utils] HTTPHeaderDict: Handle byte valuespukkandan
2023-07-28[networking] Remove dot segments during URL normalization (#7662)coletdjnz
This implements RFC3986 5.2.4 remove_dot_segments during the URL normalization process. Closes #3355, #6526 Authored by: coletdjnz
2023-07-20[utils] Improve `parse_duration`bashonly
Authored by: bashonly
2023-07-15[networking] Rewrite architecture (#2861)coletdjnz
New networking interface consists of a `RequestDirector` that directs each `Request` to appropriate `RequestHandler` and returns the `Response` or raises `RequestError`. The handlers define adapters to transform its internal Request/Response/Errors to our interfaces. User-facing changes: - Fix issues with per request proxies on redirects for urllib - Support for `ALL_PROXY` environment variable for proxy setting - Support for `socks5h` proxy - Closes https://github.com/yt-dlp/yt-dlp/issues/6325, https://github.com/ytdl-org/youtube-dl/issues/22618, https://github.com/ytdl-org/youtube-dl/pull/28093 - Raise error when using `https` proxy instead of silently converting it to `http` Authored by: coletdjnz
2023-07-15[networking] Add module (#2861)pukkandan
No actual changes - code is only moved around
2023-07-11[utils] `clean_podcast_url`: Handle more trackers (#7556)Mahmoud Abdel-Fattah
Authored by: mabdelfattah, bashonly Closes #7544
2023-05-24Update to ytdl-commit-d1c6c5pukkandan
[YouTube] [core] Improve platform debug log, based on yt-dlp https://github.com/ytdl-org/youtube-dl/commit/d1c6c5c4d618fa950813c0c71aede34a5ac851e9 Except: * 6ed34338285f722d0da312ce0af3a15a077a3e2a [jsinterp] Add short-cut evaluation for common expression * There was no performance improvement when tested with https://github.com/ytdl-org/youtube-dl/issues/30641 * e8de54bce50f6f77a4d7e8e80675f7003d5bf630 [core] Handle `/../` sequences in HTTP URLs * We plan to implement this differently
2023-04-30[utils] `traverse_obj`: More fixes (#6959)Simon Sawicki
- Fix result when branching with `traverse_string` - Fix `slice` path on `dict`s - Fix tests and docstrings from 21b5ec86c2c37d10c5bb97edd7051d3aac16bb3e - Add `is_iterable_like` helper function Authored by: Grub4K
2023-04-24[utils] `traverse_obj`: Allow iterables in traversal (#6902)Simon Sawicki
Authored by: Grub4K
2023-03-25[utils] `js_to_json`: Implement template strings (#6623)Simon Sawicki
Authored by: Grub4K
2023-02-10[utils] `traverse_obj`: Fix more bugsSimon Sawicki
and cleanup uses of `default=[]` Continued from b1bde57bef878478e3503ab07190fd207914ade9
2023-02-08[utils] `traverse_obj`: Fix several behavioral problemsSimon Sawicki
See #6180 for further info Authored by: Grub4K
2023-02-02[utils] `traverse_obj`: Various improvementsSimon Sawicki
- Add `set` key for transformations/filters - Add `re.Match` group names - Fix behavior for `expected_type` with `dict` key - Raise for filter function signature mismatch in debug Authored by: Grub4K
2022-12-30Add `weba` to known extensionspukkandan
2022-12-30[utils] js_to_json: Fix bug in f55523c (#5771)ChillingPepper
Authored by: ChillingPepper, pukkandan
2022-10-13[utils] `js_to_json`: Improve escape handling (#5217)Simon Sawicki
Authored by: Grub4K
2022-10-09[extractor/wordpress:mb.miniAudioPlayer] Add embed extractor (#5087)Matthew
Closes https://github.com/yt-dlp/yt-dlp/issues/4994 Authored by: coletdjnz
2022-10-09[utils] `traverse_obj`: Allow `re.Match` objects (#5174)Simon Sawicki
Authored by: Grub4K
2022-10-09[utils] `traverse_obj`: Always return list when branching (#5170)Simon Sawicki
Fixes #5162 Authored by: Grub4K
2022-09-26[utils] `traverse_obj`: Rewrite, document and add tests (#5024)Simon Sawicki
Authored by: Grub4K
2022-09-04[utils] `base_url`: URL paths can contain `&` (#4841)Elyse
Authored by: elyse0 Closes #4187
2022-08-14[jsinterp] Handle new youtube signature functionspukkandan
Closes #4635
2022-08-05Fix tests for 989a01c2610832193c268d072ada8814bfd4c00dpukkandan
2022-08-04Determine merge container better (See desc) (#1482)Lauren N. Liberda
* Determine the container early. Closes #4069 * Use codecs instead of just file extensions * Obey `--prefer-free-formats` * Allow fallbacks in `--merge-output` Authored by: pukkandan, selfisekai
2022-08-02[extractor/rai] Add raisudtirol extractor (#4524)nixxo
Closes #4206 Authored by: nixxo
2022-07-15Fix a904a7f8c6edc42046f0a78fb279739d500d4887pukkandan
2022-07-15Allow users to specify encoding in each config files (#4357)Lesmiscore
Authored by: Lesmiscore
2022-07-11[cleanup] Minor fixespukkandan
2022-06-25[cleanup] Consistent style for file headspukkandan
2022-06-25[compat] Remove more functionspukkandan
Removing any more will require changes to a large number of extractors
2022-05-09[cleanup] Minor fixes (See desc)pukkandan
* [youtube] Fix `--youtube-skip-dash-manifest` * [build] Use `$()` in `Makefile`. Closes #3684 * Fix bug in 385ffb467b2285e85a2a5495b90314ba1f8e0700 * Fix bug in 43d7f5a5d0c77556156a3f8caa6976d3908a1e38 * [cleanup] Remove unnecessary `utf-8` from `str.encode`/`bytes.decode` * [utils] LazyList: Expose unnecessarily "protected" attributes and other minor cleanup
2022-04-18[cleanup] Misc cleanup and refactor (#2173)pukkandan
2022-04-12[cleanup] Sort importspukkandan
Using https://github.com/PyCQA/isort isort -m VERTICAL_HANGING_INDENT --py 36 -l 80 --rr -n --tc .
2022-04-12[cleanup] Upgrade syntaxpukkandan
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
2022-04-12[cleanup] Remove unused code paths (#2173)felix
Notes: * `_windows_write_string`: Fixed in 3.6 * https://bugs.python.org/issue1602 * PEP: https://www.python.org/dev/peps/pep-0528 * Windows UTF-8 fix: Fixed in 3.3 * https://bugs.python.org/issue13216 * `__loader__`: is always present in 3.3+ * https://bugs.python.org/issue14646 * `workaround_optparse_bug9161`: Fixed in 2.7 * https://bugs.python.org/issue9161 Authored by: fstirlitz
2022-04-07[test] Add `test_locked_file`pukkandan