yt-dlp
yt-dlp copied to clipboard
Add Option to raise error on a file too large or file too small
IMPORTANT: PRs without the template will be CLOSED
Description of your pull request and other information
If the parameters are given, the http downloader will raise an error when it encounters a download where the file is too large / too small (controlled by the parameters min_filesize / max_filesize). It's helpful when writing a script and you want to handle the situation of a file being too big / too small properly. Since YoutubeDL.download() does not raise an Error nor does the return value change on those situations, this atleast would give an option to handle the situation Fixes #
Template
Before submitting a pull request make sure you have:
- [ x] At least skimmed through contributing guidelines including yt-dlp coding conventions
- [ x] Searched the bugtracker for similar pull requests
- [ x] Checked the code with flake8 and ran relevant tests
In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check one of the following options:
- [ x] I am the original author of this code and I am willing to release it under Unlicense
- [ ] I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)
What is the purpose of your pull request?
- [ x] Fix or improvement to an extractor (Make sure to add/update tests)
- [ ] New extractor (Piracy websites will not be accepted)
- [ ] Core bug fix/improvement
- [ ] New feature (It is strongly recommended to open an issue first)