bashonly
43a74c5fa5
[core] Address gaps in allowed extensions
...
Adds some extensions missing in 4652109643
(from yt-dlp/yt-dlp#10362 )
Authored by: bashonly
Co-authored by: dirkf
4 months ago
dirkf
37cea84f77
[core,utils] Support unpublicised `--no-check-extensions`
4 months ago
dirkf
4652109643
[core,utils] Implement unsafe file extension mitigation
...
* from https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-79w7-vh3h-8g4 , thx grub4k
4 months ago
dirkf
3c466186a8
[utils] Back-port Namespace and MEDIA_EXTENSIONS from yt-dlp
...
Thx pukkandan
* Namespace: https://github.com/yt-dlp/yt-dlp/commit/591bb9d355
* MEDIA_EXTENSIONS: https://github.com/yt-dlp/yt-dlp/commit/8dc5930511
4 months ago
dirkf
2eac0fa379
[utils] Save `orig_msg` in `ExtractorError`
5 months ago
dirkf
06da64ee51
[utils] Update traverse_obj() from yt-dlp
...
* remove `is_user_input` option per https://github.com/yt-dlp/yt-dlp/pull/8673
* support traversal of compat_xml_etree_ElementTree_Element per https://github.com/yt-dlp/yt-dlp/pull/8911
* allow un/branching using all and any per https://github.com/yt-dlp/yt-dlp/pull/9571
* support traversal of compat_cookies.Morsel and multiple types in `set()` keys per https://github.com/yt-dlp/yt-dlp/pull/9577
thx Grub4k for these
* also, move traversal tests to a separate class
* allow for unordered dicts in tests for Py<3.7
5 months ago
Ori Avtalion
4ea59c6107
[utils] Fix crash in _report_ignoring_subs from c58b655
( #32762 )
...
Align `utils.bug_reports_message()` with yt-dlp https://github.com/yt-dlp/yt-dlp/commit/5873d4ccdd , thanks fstirlitz
---------
Co-authored-by: dirkf <fieldhouse@gmx.net>
7 months ago
dirkf
19dc10b986
[utils] Apply compat_contextlib_suppress
8 months ago
dirkf
acc383b9e3
[utils] Let int_or_none() accept a base, like int()
8 months ago
Hubert Hirtz
f0812d7848
[utils] Handle user:pass in URLs ( #28801 )
...
* Handle user:pass in URLs
Fixes "nonnumeric port" errors when youtube-dl is given URLs with
usernames and passwords such as:
http://username:password@example.com/myvideo.mp4
Refs:
- https://en.wikipedia.org/wiki/Basic_access_authentication
- https://tools.ietf.org/html/rfc1738#section-3.1
- https://docs.python.org/3.8/library/urllib.parse.html#urllib.parse.urlsplit
Fixes #18276 (point 4)
Fixes #20258
Fixes #26211 (see comment)
* Align code with yt-dlp
---------
Co-authored-by: dirkf <fieldhouse@gmx.net>
8 months ago
dirkf
427472351c
[utils] Make restricted filenames ignore characters in Unicode categories Mark, Other
...
Resolves #32629
12 months ago
dirkf
66ab0814c4
[utils] Revert bbd3e7e
, updating docstring, test instead
1 year ago
dirkf
bbd3e7e999
[utils] Properly handle list values in update_url()
...
An actual list value in a query update could have been treated
as a list of values because of the key:list parse_qs format.
1 year ago
dirkf
2efc8de4d2
[utils] Advertise optional supported `Content-Encoding`s
1 year ago
dirkf
e4178b5af3
[utils] Add and use `filter_dict()` from yt-dlp
1 year ago
dirkf
2d2a4bc832
[utils] Revise `isinstance()` tests (especially for str/unicode/bytes) to complete Linter fix
1 year ago
dirkf
7d965e6b65
[utils] Avoid comparing `type(var)`, etc, to pass new Linter rules
1 year ago
dirkf
abef53466d
[utils] Rework URL path munging for ., .. components
...
* move processing to YoutubeDLHandler
* also process `Location` header for redirect
* use tests from https://github.com/yt-dlp/yt-dlp/pull/7662
1 year ago
dirkf
e7926ae9f4
[utils] Rework decoding of `Content-Encoding`s
...
* support nested encodings
* support optional `br` encoding, if brotli package is installed
* support optional 'compress' encoding, if ncompress package is installed
* response `Content-Encoding` has only unprocessed encodings, or removed
* response `Content-Length` is decoded length (usable for filesize metadata)
* use zlib for both deflate and gzip decompression
* some elements taken from yt-dlp: thx especially coletdjnz
1 year ago
dirkf
2b7dd3b2a2
[utils] Fix update_Request() with empty data (not None)
1 year ago
dirkf
1fa8b86f0b
[utils] Remove stray undocumented Host header in redirect (fix 46fde7c
)
1 year ago
dirkf
a190b55964
[utils] Fix broken Py 3.11+ compat in `traverse_obj()`
...
* inspect.getargspec is missing despite doc claiming backward compat
* replace with emulation of `Signature.bind()`
1 year ago
dirkf
cb9366eda5
[utils] Minor updates (merge_dicts, T)
...
A couple of mods to ease yt-dlp back-ports:
* add kwargs to merge_dicts:
`unblank=True` (disallow empty string), `rev=False` (reverse the merge list)
* add `T(x)` shortcut for `{x}`, unsupported in Py2.6
1 year ago
dirkf
d9d07a9581
[utils] Improve js_to_json, align with yt-dlp
...
* support variable substitution, from https://github.com/yt-dlp/yt-dlp/pull/#521 etc,
thanks ChillingPepper, Grub4k, pukkandan
* improve escape handling, from https://github.com/yt-dlp/yt-dlp/pull/#521
thanks Grub4k
* support template strings from https://github.com/yt-dlp/yt-dlp/pull/6623
thanks Grub4k
* add limited `!` evaluation (eg, !!0 -> false, see tests)
1 year ago
dirkf
825a40744b
[utils] Align traverse_obj() with yt-dlp
...
Thanks Grub4k for these:
* traverse `Iterable`s, from https://github.com/yt-dlp/yt-dlp/pull/6902 , etc
* traverse `set` key for transformations/filters, `re.Match` group names, from
776995bc10
, etc
* traverse `re.Match`es, from https://github.com/yt-dlp/yt-dlp/pull/5174
* always return list when branching, from https://github.com/yt-dlp/yt-dlp/pull/5170
1 year ago
dirkf
1d8d5a93f7
[test] Fixes for old Pythons
1 year ago
bashonly
3801d36416
[utils] `YoutubeDLCookieJar`: Add `get_cookie_header` and `get_cookies_for_url` methods
1 year ago
dirkf
b383be9887
[core] Remove `Cookie` header on redirect to prevent leaks
...
Adated from yt-dlp/yt-dlp-ghsa-v8mc-9377-rwjj/pull/1/commits/101caac
Thx coletdjnz
1 year ago
dirkf
46fde7caee
[core] Update redirect handling from yt-dlp
...
* Thx coletdjnz: https://github.com/yt-dlp/yt-dlp/pull/7094
* add test that redirected `POST` loses its `Content-Type`
1 year ago
dirkf
f47fdb9564
[utils] Add {expected_type} and Iterable support to traverse_obj()
1 year ago
dirkf
f24bc9272e
[Misc] Fixes for 2.6 compatibility
1 year ago
dirkf
11cc3f3ad0
[utils] Fix `compiled_regex_type` in 249f2b6
2 years ago
dirkf
64d6dd64c8
[YouTube] Support Releases tab
2 years ago
dirkf
25124bd640
[devscripts] Improve hack to convert command-line options to API options
...
* define equality for DateRange
* don't show default DateRange
2 years ago
dirkf
f35b757c82
[utils] Ensure `allow_types` for `variadic()` is a tuple
2 years ago
pukkandan
1d3751c3fe
Escape URLs in `sanitized_Request`, not `sanitize_url` d2558234cf5dd12d6896eed5427b7dcdb3ab7b5a added escaping of URLs while sanitizing. However, `sanitize_url` may not always receive an actual URL. Eg: When using `youtube-dl "search query" --default-search ytsearch`, `search query` gets escaped to `search%20query` before being prefixed with `ytsearch:` which is not the intended behavior. So the escaping is moved to `sanitized_Request` instead.
2 years ago
dirkf
90c9f789d9
[utils] Add parse_qs, update_url
...
[skip ci]
2 years ago
dirkf
58988c1421
[YouTube] Bypass age-gating for certain restricted videos
...
* Use TVHTML5_SIMPLY_EMBEDDED_PLAYER client
* Also add and fix tests
* Introduce and use new utility function `update_url()`
2 years ago
Andrei Lebedev
27ed77aabb
[utils] Backport traverse_obj (etc) from yt-dlp ( #31156 )
...
* Backport traverse_obj and closely related function from yt-dlp (code by pukkandan)
* Backport LazyList, variadic(), try_call (code by pukkandan)
* Recast using yt-dlp's newer traverse_obj() implementation and tests (code by grub4k)
* Add tests for Unicode case folding support matching Py3.5+ (requires f102e3d
)
* Improve/add tests for variadic, try_call, join_nonempty
Co-authored-by: dirkf <fieldhouse@gmx.net>
2 years ago
dirkf
c94a459a24
[utils] Sanitize look-alike Unicode glyphs in non-ID filename fields when --restrict-filenames
...
Implements https://github.com/ytdl-org/youtube-dl/issues/31216#issuecomment-1236102822 , which has a test.
2 years ago
dirkf
556862bc91
[utils] Ensure RFC3986 encoding result is unicode
2 years ago
dirkf
d231b56717
[jsinterp] Overhaul JSInterp to handle new YT players 4c3f79c5, 324f67b9 ( #31170 )
...
* back-port from yt-dlp 8f53dc44a0cc1c2d98c35740b9293462c080f5d0, thanks pukkandan
* also support void, improve <</>> precedence, improve expressions in comma-list
* add more tests
2 years ago
pukkandan
0700fde640
[utils, etc] Kill child processes when yt-dl is killed
...
* derived from PR #26592 , closes #26592
Authored by: Unrud
2 years ago
pukkandan
1baa0f5f66
[utils] Escape URL while sanitizing
...
Closes #31008 , #yt-dlp/263
While this fixes the issue in question, it does not try to address the root-cause of the problem
Refer: 915f911e365736227e134ad654601443dbfd7ccb, f5fa042c82300218a2d07b95dd6b9c0756745db3
2 years ago
dirkf
52c3751df7
[utils] Enable ALPN in HTTPS to satisfy broken servers
...
See https://github.com/yt-dlp/yt-dlp/issues/3878
2 years ago
Sergey M․
cfee2dfe83
[utils] PEP 8
4 years ago
Sergey M․
a00a7e0cad
[utils] Add support for support for experimental HTTP response status code 308 Permanent Redirect (refs #27877 , refs #28768 )
4 years ago
Remita Amine
e88c9ef62a
[utils] add a function to clean podcast URLs
4 years ago
Remita Amine
9dd674e1d2
[utils] accept only supported protocols in url_or_none
4 years ago
Josh Soref
71ddc222ad
Fix typos ( #27084 )
...
* spelling: authorization
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: brightcove
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: creation
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: exceeded
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: exception
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: extension
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: extracting
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: extraction
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: frontline
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: improve
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: length
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: listsubtitles
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: multimedia
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: obfuscated
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: partitioning
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: playlist
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: playlists
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: restriction
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: services
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: split
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: srmediathek
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: support
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: thumbnail
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: verification
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: whitespaces
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
4 years ago