Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Scheduled --rate-limit / download stop #2031
Comments
|
I personally think that's better done as an external script (just kill the youtube-dl process when you want and resume the download the next day), so that youtube-dl doesn't get more complicated. |
|
Hi @jaimeMF I agree that it is currently complicated since you are rewriting the entire FileDownloader to it's own module. Killing & resuming the process is possible from an external script. Changing the rate-limit is not possible (at last during downloading a huge video). It know is possible to kill the the process, reset ratelimit variable and resume. However, this is not a beautiful way of coding. Adding options such as "--rate-limit-start" / "--rate-limit-stop" is relatively easy. Few lines in "slow_down" function to check whether speed limiting should be enforced or not. Two variables will be required to store ratelimitstart time and ratelimitstop time. Some coding will be necessary in the main program to check if those options are set and store them in the mentioned variables. Some documentation will be needed. Anyway, this is just a suggestion. The youtube-dl code is already very good and I do not want to over-complicate things. It is essential to keep a balance between reliability / functionality and simplicity. Best regards, |
|
It's just my opinion. If you want, you can open a pull request with your suggested changes and we will look into it. |
|
OK, I will act accordingly. |
I suggest Youtube-DL code should have a mechanism to schedule speed-limit, also scheduled stop/start.
Some users might have download caps during days, yet unlimited download cap during night hours.
I have a friend who executes Youtube-DL at his office in the afternoons in order to download a long list of videos (for education purposes of course!!!). He does not want to annoy other users the next morning because of Youtube-DL, hogging the entire bandwidth! He can not be sure if the download would be finished by next morning. Since he visits his office only in the afternoons, manual control is not an option.
I had to write a custom Python script for him to address that issue. Yet I believe, it would be a nice option for original Youtube-DL code/API.
Most of suggested code could be integrated in FileDownloader.py, somewhere in _do_download function, Line 632:680
With best regards,
Ali