I'm using youtube-dl to download a live stream and I'd like to be able to limit the time of the download, closing the connection once that time has elapsed. Is there a built in way to close the connection and save the file? I don't see anything in on the manpage but maybe I'm missing something. I'm using Ubuntu 14.04. Thanks.

1 Answer 1


Hack-around solution: Use two terminal sessions, one for youtube-dl, and the other for sleep followed by sending SIGINT to youtube-dl.


Terminal 1:

youtube-dl <url>

Terminal 2:

sleep 300; kill -SIGINT $(pgrep youtube-dl)

Specifically, SIGINT is the signal sent by ctrl+c, so this simulates ctrl+c'ing the youtube-dl process after the elapsed time.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.