implementing throttled-rate option

This commit is contained in:
simon 2021-10-26 17:14:26 +07:00
parent 581314a8a4
commit 5f3fc460c1
3 changed files with 12 additions and 1 deletions

View File

@ -19,7 +19,8 @@
"sleep_interval": 3,
"format": false,
"add_metadata": false,
"add_thumbnail": false
"add_thumbnail": false,
"throttledratelimit": false
},
"application": {
"app_root": "/app",

View File

@ -515,6 +515,11 @@ class VideoDownloader:
obs["format"] = self.config["downloads"]["format"]
if self.config["downloads"]["limit_speed"]:
obs["ratelimit"] = self.config["downloads"]["limit_speed"] * 1024
throttle = self.config["downloads"]["throttledratelimit"]
if throttle:
obs["throttledratelimit"] = throttle * 1024
external = False
if external:
obs["external_downloader"] = "aria2c"

View File

@ -53,6 +53,11 @@
<i>Limit download speed. 0 (zero) to deactivate.</i><br>
<input type="number" name="downloads.limit_speed" id="downloads.limit_speed"><span>KB/sec</span>
</div>
<div class="settings-item">
<p>Current throttled rate limit: <span class="settings-current">{{ config.downloads.throttledratelimit }}</span></p>
<i>Assume the download is being throttled below this speed and restart. 0 (zero) to deactivate, e.g. 100KB/sec</i><br>
<input type="number" name="downloads.throttledratelimit" id="downloads.throttledratelimit"><span>KB/sec</span>
</div>
<div class="settings-item">
<p>Current scraping sleep interval: <span class="settings-current">{{ config.downloads.sleep_interval }}</p>
<i>Seconds to sleep between calls to YouTube. Might be necessary to avoid throttling. Recommended 3.</i><br>