--max-filesize may not work #17705

Open
opened 2026-02-21 09:37:30 -05:00 by deekerman · 6 comments
Owner

Originally created by @triplesixman on GitHub (Aug 17, 2019).

Checklist

  • [* ] I'm reporting a broken site support issue
  • [* ] I've verified that I'm running youtube-dl version 2019.08.13
  • [* ] I've checked that all provided URLs are alive and playable in a browser
  • [ *] I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • [* ] I've searched the bugtracker for similar bug reports including closed ones
  • [ *] I've read bugs section in FAQ

Verbose log

:~/test# youtube-dl --max-filesize 20m https://www.youtube.com/watch?v=h2zkV-l_TbY
[youtube] h2zkV-l_TbY: Downloading webpage
[youtube] h2zkV-l_TbY: Downloading video info webpage
[download] Destination: ☕ Restaurant Ambience • 10H Busy Coffee Shop Background Noise-h2zkV-l_TbY.f313.webm
[download]   0.2% of 5.55GiB at  5.91MiB/s ETA 15:59^C
ERROR: Interrupted by user

Description

Hello,

I notice that the "--max-size" function no longer works on youtube-dl updated.

Originally created by @triplesixman on GitHub (Aug 17, 2019). ## Checklist - [* ] I'm reporting a broken site support issue - [* ] I've verified that I'm running youtube-dl version **2019.08.13** - [* ] I've checked that all provided URLs are alive and playable in a browser - [ *] I've checked that all URLs and arguments with special characters are properly quoted or escaped - [* ] I've searched the bugtracker for similar bug reports including closed ones - [ *] I've read bugs section in FAQ ## Verbose log ``` :~/test# youtube-dl --max-filesize 20m https://www.youtube.com/watch?v=h2zkV-l_TbY [youtube] h2zkV-l_TbY: Downloading webpage [youtube] h2zkV-l_TbY: Downloading video info webpage [download] Destination: ☕ Restaurant Ambience • 10H Busy Coffee Shop Background Noise-h2zkV-l_TbY.f313.webm [download] 0.2% of 5.55GiB at 5.91MiB/s ETA 15:59^C ERROR: Interrupted by user ``` ## Description Hello, I notice that the "--max-size" function no longer works on youtube-dl updated.
Author
Owner

@chuckn408 commented on GitHub (Aug 27, 2019):

works for me:::

youtube-dl --max-filesize 20m https://www.youtube.com/watch?v=h2zkV-l_TbY
[youtube] h2zkV-l_TbY: Downloading webpage
[youtube] h2zkV-l_TbY: Downloading video info webpage
WARNING: Unable to extract video title
[download] Destination: _-h2zkV-l_TbY.f313.webm
[download] File is larger than max-filesize (30690430 bytes > 20971520 bytes). Aborting.
[download] Destination: _-h2zkV-l_TbY.f251.webm
[download] File is larger than max-filesize (30429877 bytes > 20971520 bytes). Aborting.

Did you cancel it too prematurely?

@chuckn408 commented on GitHub (Aug 27, 2019): works for me::: > youtube-dl --max-filesize 20m https://www.youtube.com/watch?v=h2zkV-l_TbY [youtube] h2zkV-l_TbY: Downloading webpage [youtube] h2zkV-l_TbY: Downloading video info webpage WARNING: Unable to extract video title [download] Destination: _-h2zkV-l_TbY.f313.webm [download] File is larger than max-filesize (30690430 bytes > 20971520 bytes). Aborting. [download] Destination: _-h2zkV-l_TbY.f251.webm [download] File is larger than max-filesize (30429877 bytes > 20971520 bytes). Aborting. Did you cancel it too prematurely?
Author
Owner

@triplesixman commented on GitHub (Aug 27, 2019):

Nope. It must have been fixed during a recent update, it works now. :)

@triplesixman commented on GitHub (Aug 27, 2019): Nope. It must have been fixed during a recent update, it works now. :)
Author
Owner

@ohhai commented on GitHub (Feb 15, 2020):

Sorry for the example, but it does not work everywhere, at least:

$ /usr/local/bin/youtube-dl --max-filesize 1m https://www.pornhub.com/view_video.php?viewkey=ph5e272646bddb8
[PornHub] ph5e272646bddb8: Downloading pc webpage
[PornHub] ph5e272646bddb8: Downloading m3u8 information
[PornHub] ph5e272646bddb8: Downloading m3u8 information
[PornHub] ph5e272646bddb8: Downloading m3u8 information
[PornHub] ph5e272646bddb8: Downloading m3u8 information
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 266
[download] Destination: Mom's secret night life - Crystal Rush-ph5e272646bddb8.mp4
[download]   1.9% of ~94.33MiB at 804.45KiB/s ETA 03:35^C
ERROR: Interrupted by user

Version:

[debug] youtube-dl version 2020.01.24
[debug] Python version 3.7.6 (CPython) - Linux-5.4.17-200.fc31.x86_64-x86_64-with-fedora-31-Thirty_One
[debug] exe versions: ffmpeg 4.2.2, ffprobe 4.2.2, phantomjs 2.1.1
@ohhai commented on GitHub (Feb 15, 2020): Sorry for the example, but it does not work everywhere, at least: ``` $ /usr/local/bin/youtube-dl --max-filesize 1m https://www.pornhub.com/view_video.php?viewkey=ph5e272646bddb8 [PornHub] ph5e272646bddb8: Downloading pc webpage [PornHub] ph5e272646bddb8: Downloading m3u8 information [PornHub] ph5e272646bddb8: Downloading m3u8 information [PornHub] ph5e272646bddb8: Downloading m3u8 information [PornHub] ph5e272646bddb8: Downloading m3u8 information [hlsnative] Downloading m3u8 manifest [hlsnative] Total fragments: 266 [download] Destination: Mom's secret night life - Crystal Rush-ph5e272646bddb8.mp4 [download] 1.9% of ~94.33MiB at 804.45KiB/s ETA 03:35^C ERROR: Interrupted by user ``` Version: ``` [debug] youtube-dl version 2020.01.24 [debug] Python version 3.7.6 (CPython) - Linux-5.4.17-200.fc31.x86_64-x86_64-with-fedora-31-Thirty_One [debug] exe versions: ffmpeg 4.2.2, ffprobe 4.2.2, phantomjs 2.1.1 ```
Author
Owner

@marczz commented on GitHub (Apr 20, 2020):

With youtube-dl version 2020.03.24 it does not work even with the youtube-dl test video:

$ youtube-dl  --max-filesize 1M --restrict-filename https://www.youtube.com/watch?v=BaW_jenozKc
[youtube] BaW_jenozKc: Downloading webpage
[download] File is larger than max-filesize (2208750 bytes > 1048576 bytes). Aborting.
[download] Destination: youtube-dl_test_video_a-BaW_jenozKc.f140.m4a
[download] 100% of 154.06KiB in 00:00

But by using a format it is ok:

$ youtube-dl  -f "[filesize < 1M]" --restrict-filename https://www.youtube.com/watch?v=BaW_jenozKc
[youtube] BaW_jenozKc: Downloading webpage
[download] Destination: youtube-dl_test_video_a-BaW_jenozKc.mp4
[download] 100% of 354.29KiB in 00:01

Version:

[debug] youtube-dl version 2020.03.24
[debug] Python version 3.7.3 (CPython) - Linux-4.19.0-8-amd64-x86_64-with-debian-10.3
[debug] exe versions: ffmpeg 4.1.4-1, ffprobe 4.1.4-1, phantomjs 2.1.1, rtmpdump 2.4
[debug] Default format spec: bestvideo+bestaudio/best
@marczz commented on GitHub (Apr 20, 2020): With youtube-dl version 2020.03.24 it does not work even with the youtube-dl test video: $ youtube-dl --max-filesize 1M --restrict-filename https://www.youtube.com/watch?v=BaW_jenozKc [youtube] BaW_jenozKc: Downloading webpage [download] File is larger than max-filesize (2208750 bytes > 1048576 bytes). Aborting. [download] Destination: youtube-dl_test_video_a-BaW_jenozKc.f140.m4a [download] 100% of 154.06KiB in 00:00 But by using a format it is ok: $ youtube-dl -f "[filesize < 1M]" --restrict-filename https://www.youtube.com/watch?v=BaW_jenozKc [youtube] BaW_jenozKc: Downloading webpage [download] Destination: youtube-dl_test_video_a-BaW_jenozKc.mp4 [download] 100% of 354.29KiB in 00:01 Version: [debug] youtube-dl version 2020.03.24 [debug] Python version 3.7.3 (CPython) - Linux-4.19.0-8-amd64-x86_64-with-debian-10.3 [debug] exe versions: ffmpeg 4.1.4-1, ffprobe 4.1.4-1, phantomjs 2.1.1, rtmpdump 2.4 [debug] Default format spec: bestvideo+bestaudio/best
Author
Owner

@dirkf commented on GitHub (Oct 2, 2024):

This problem still exists, because the potential filesize is only checked (only known?) for HTTP downloads and not for fragment (DASH, HLS) downloads.

TODO: check how this works in yt-dlp.

@dirkf commented on GitHub (Oct 2, 2024): This problem still exists, because the potential filesize is only checked (only known?) for HTTP downloads and not for fragment (DASH, HLS) downloads. TODO: check how this works in _yt-dlp_.
Author
Owner

@dirkf commented on GitHub (Oct 5, 2024):

... check how this works in yt-dlp.

The same: https://github.com/yt-dlp/yt-dlp/issues/10663#issuecomment-2393100696

@dirkf commented on GitHub (Oct 5, 2024): >... check how this works in _yt-dlp_. The same: https://github.com/yt-dlp/yt-dlp/issues/10663#issuecomment-2393100696
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#17705
No description provided.