metube icon indicating copy to clipboard operation
metube copied to clipboard

Allow rate limiting

Open Marthisdil opened this issue 2 years ago • 2 comments

YT-DLP doesn't support it directly, but the ratelimit ability is used in the downloader (https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/YoutubeDL.py#L176 (line 466))

Even better would be a little scheduler where you can rate limit during, say, working hours, but late night, have it be at a different limit

Marthisdil avatar Mar 17 '22 17:03 Marthisdil

You can set the option via the YTDL_OPTIONS environment variable, see the README. About the scheduler, I'm not sure how common the use case it. Leaving it here for future feedback.

alexta69 avatar Mar 22 '22 21:03 alexta69

Not directly relevant, but I'm leaving how to limit the download speed here. I believe it would be useful to add this as an example in the Configuration via environment variables section as I struggled for a while with all the permutations.

Config Type: Variable
Name: YTDL_OPTIONS
Key: YTDL_OPTIONS
Value: {"ratelimit": 3000000}

Speed is in bytes/s so 3000000B/s = 3.00MB/s

A crude solution for the scheduling would be having two user scripts, one composed for day use with a low ratelimit, and another for night use with a higher ratelimit. Then it's a case of scheduling these to run at your desired times.

tekwarfare avatar Aug 20 '22 12:08 tekwarfare