Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use sleep delay before Invoking downloader #23791

Closed
3 tasks done
bmrz2019 opened this issue Jan 20, 2020 · 8 comments
Closed
3 tasks done

use sleep delay before Invoking downloader #23791

bmrz2019 opened this issue Jan 20, 2020 · 8 comments
Labels

Comments

@bmrz2019
Copy link

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2020.01.15
  • I've searched the bugtracker for similar feature requests including closed ones

Description

if one uses --sleep-interval 9000 then the command goes to the website, invokes downloader, gathers the 'final URL or similar' and then waits. This is inconvenient:

  • Some websites have timeout for the extracted URL - it becomes invalid before the timeout happens.

  • Download fails

Can you edit code so sleep before doing any network activity

Example

./youtube-dl  -v --sleep-interval  9000  -f '(mp4)[height<480]' --add-metadata   --no-mtime  https://www.youtube.com/watch?v=-nNkqbrL3SE 


[debug] System config: []
[debug] User config: [u'--no-mtime', u'--download-archive', u'~/.youtube-dl-archive', u'-f', u'mp4']
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--sleep-interval', u'9000', u'-f', u'(mp4)[height<480]', u'--add-metadata', u'--no-mtime', u'https://www.youtube.com/watch?v=-nNkqbrL3SE']
[debug] Encodings: locale ISO-8859-1, fs ISO-8859-1, out ISO-8859-1, pref ISO-8859-1
[debug] youtube-dl version 2020.01.15
[debug] Python version 2.7.15+ (CPython) - Linux-4.15.0-65-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6
[debug] Proxy map: {}
[youtube] -nNkqbrL3SE: Downloading webpage
[youtube] -nNkqbrL3SE: Downloading video info webpage
[debug] Invoking downloader on u'https://r1---sn-4g5e6nzl.googlevideo.com/videoplayback?expire=1579557417&ei=yc0lXpu9N4bb1gKklLGYDA&ip=4.4.4.4.&id=o-AKI_x-X7Nye_Lb_Q1KR00uvnz8G_20r7oOkbs_XUT0Gs&itag=18&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-4g5e6nzl%2Csn-h0jeened&ms=au%2Conr&mv=m&mvi=0&pl=17&initcwndbps=1696250&vprv=1&mime=video%2Fmp4&gir=yes&clen=9074296&ratebypass=yes&dur=201.851&lmt=1571923299773668&mt=1579535755&fvip=1&fexp=23842630&beids=9466587&c=WEB&txp=5531432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=ALgxI2wwRAIgKYkaHvEvx4MXLUN7FYxk_KeyFmbcmK-INvW1g1v9nEUCIFgUU34oDKtVveoS6ol9AnnpSTgIEIZsx04mQEk8CVcS&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIgEyH6OY38x7pkNv6S3HVCvsxrtyjTPhvABTLGLJQikewCIQC-7bgzx9qNNOtmhDYBQyk4PejspOkzkEO4HoJc4x-NdA%3D%3D'
[download] Sleeping 9000 seconds...

For Playlists

I do not know what the optimal solution is:

@faizan2700
Copy link

If anyone is not working on this I would like to work on this.

@faizan2700
Copy link

for a single video if we start sleep(time) before initializing the extractor that would solve the issue but if video url has some other problem like webpage is not extracted correctly we will have to wait for that whatever the sleep time is (because that will be known only after extracting the page).
and for playlist we will first extract the information of webpage of playlist and then for before every video processing we will start sleep(time).
But what is the purpose of the option of sleep interval ? ( is it because youtube or other site will detect a lot of activity and block the program so sleep time prevents site to detect this activity? or something other ?

@bmrz2019
Copy link
Author

But what is the purpose of the option of sleep interval ? ( is it because youtube or other site will detect a lot of activity and block the program so sleep time prevents site to detect this activity? or something other ?

  1. a lot of activity and block the program
  2. may be you want to download to start after approximately 5 hours (say when sleeping), because you want to use the bandwidth for something else -like urgent work now.

@bmrz2019
Copy link
Author

@faizan2700 are you planning to work on this? Thank you

@ke352802081770314
Copy link

ke352802081770314 commented Sep 8, 2020

treble2019, your original example looked like you wanted to achieve objective #2. In that case, you could just sleep 9000; ,/youtube-dl ... couldn't you?
Also, the option's name "sleep-interval" indicates that it is more likely aimed at achieving #1 which cannot be done externally when downloading multiple videos. But sleeping 9000 seconds multiple times betwene several videos isn't probably what you wanted, is it, because the third or forth video would already interfere with your following workday?

@tsingi
Copy link

tsingi commented Feb 23, 2021

Using UNIX (Linux) the 'at' command would accomplish this.

@rautamiekka
Copy link
Contributor

treble2019, your original example looked like you wanted to achieve objective #2. In that case, you could just sleep 9000; ,/youtube-dl ... couldn't you?
Also, the option's name "sleep-interval" indicates that it is more likely aimed at achieving #1 which cannot be done externally when downloading multiple videos. But sleeping 9000 seconds multiple times betwene several videos isn't probably what you wanted, is it, because the third or forth video would already interfere with your following workday?

Be careful when using the hash with numbers on GitHub.

@bmrz2019
Copy link
Author

just sleep 9000; ,/youtube-dl ... couldn't you?

Yes. I could. Then why have that option inside youtube-dl?

My case is that one could run

tsp youtube-dl --max-sleep-interval seconds --sleep-interval SECONS url

of course I can write bash script...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants