yt-dlp icon indicating copy to clipboard operation
yt-dlp copied to clipboard

Add Option to raise error on a file too large or file too small

Open BergHeisen opened this issue 2 years ago • 0 comments

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:

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?

BergHeisen avatar Sep 08 '22 01:09 BergHeisen