This commit refactors the tests in the HotmartIE class to generate a dynamic URL for testing. Previously, the test URL was hardcoded and could expire, causing the tests to fail. Now, the test URL is generated dynamically by making a request to the Teachable API and constructing the URL from the response. This ensures that the test URL is always valid at the time of testing.
This commit updates the Teachable extractor function to support the extraction of multiple videos from a single page. Previously, the function only extracted the first video from a page. The updated function now iterates over all video elements on a page and extracts each one. This enhancement improves the functionality of the extractor and allows for more comprehensive scraping of Teachable content.
Implemented code convention compliance throughout the HotmartIE extractor. The adjustments span from syntax and structure to proper usage of utility functions. The changes encompass quote usage, inline value extraction, long lines management, import order, fallbacks collapsing, trailing parentheses placement, and the use of conversion and parsing functions like url_or_none and int_or_none for safer data handling.
This commit introduces a few minor style corrections that were previously overlooked. These corrections ensure that the code adheres to the project's style guidelines and improves overall readability. The changes are minor and do not affect the functionality of the code.
This commit reverts the unnecessary style changes that were introduced by the Black tool. While Black is useful for enforcing PEP 8 style guidelines, it had caused too many modifications in this case, leading to a loss of original code style and readability. This commit ensures that only the necessary style changes for PEP 8 compliance are kept, while the rest of the code remains as originally intended.
This commit resolves the flake8 E203 errors in the teachable.py file. The errors were caused by unnecessary whitespace before colons on lines 210 and 386. The removal of these spaces ensures the code adheres to PEP 8 style guidelines, allowing flake8 to run without any errors.
This commit addresses the failing tests in teachable.py and hotmart.py. The changes ensure that the tests pass by correctly handling the temporary URLs generated by these scripts.
Please note that the tests are dependent on the validity of these temporary URLs. Therefore, the tests will pass temporarily as long as the URLs are valid.
In addition, this commit adheres to the style guide by wrapping the code at 79 characters.
The test URL in the HotmartIE class has been updated to match the format expected by _VALID_URL. This resolves a test error where the test URL did not match the expected format.
This commit updates the Teachable extractor to handle Hotmart video URLs and adds a new extractor for Hotmart. The Hotmart extractor is used to handle videos from Hotmart, a platform for selling online courses. The changes allow yt-dlp to download videos from courses hosted on Hotmart.
The code for these changes was originally written by Green0Photon and can be found at https://github.com/Green0Photon/yt-dlp/tree/teachable-fix-add-hotmart. This commit is a direct implementation of his work into the main yt-dlp repository.
The changes have been tested and confirmed to work as expected. This commit also includes updates to the code style and formatting to match the yt-dlp contributing guidelines.
- Fix bug in `axel` Cookie header arg
- Pass cookies to `curl` as strings
- Write session cookies for `aria2c` and `wget`
Closes#7539
Authored by: bashonly
- 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#7558
Authored by: bashonly, pukkandan
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
- ffmpeg: Calculate cookies from cookiejar and pass with `-cookies` arg instead of `-headers`
- aria2c, curl, wget: Write cookiejar to file and use external FD built-in cookiejar support
- httpie: Calculate cookies from cookiejar instead of `http_headers`
- axel: Calculate cookies from cookiejar and disable http redirection if cookies are passed
- May break redirects, but axel simply don't have proper cookie support
Ref: https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-v8mc-9377-rwjj
Authored by: bashonly, coletdjnz
This is useful for HLS where detecting whether the format is
actually DRM requires the child manifest to be downloaded.
Makes the error message when using `--test` inconsistent,
but doesn't really matter.