Download Live Stream Youtube

Though I think ShareX is still the best freeware for this (especially on compression with long videos). There's another: youtube-dl.

youtube-dl is a command line program. Simple. But requires ffmpeg or I got this error: "...download detected but ffmpeg or avconv could not be found...", which I downloaded and extracted to C:\. Then I need to set the Environmental Variables to the ffmpeg\bin folder (probably not that important with environmental path, because in the youtube-dl command line, it appears that I had to specify --ffmpeg-location PATH anyway)

Sample command: youtube-dl https://www.youtube.com/watch?v=oFEQK1BMnAQ --ffmpeg-location "C:\ffmpeg\bin"

youtube-dl is better than ShareX in a way that it can download a published video faster than ShareX because ShareX requires live capture.

So far, I can't find a way to download an ongoing live stream from the beginning (the very beginning of the stream), in spite of the many ways to speed download hours of youtube videos within minutes. Even though Youtube live streams allow user to slide the video backward in time to watch what's missed from the beginning of the ongoing stream.

I wish I know how this can be achieved.

This entry was posted in Questions, Technical. Bookmark the permalink.

2 Responses to Download Live Stream Youtube

  1. timlyg says:

    yt-dlp has come a long way. The new Windows executable works flawlessly as of now. I downloaded the entire recorded livestream video from David Tong's Christianity and AI (Kekristenan dan AI)

    Simple command would work:
    Just download the yt-dlp.exe file, which is 18MB as of now.
    # Use it to download a video

    # generally a smaller size; good quality
    yt-dlp -f best https://www.youtube.com/watch?v=VUhQ6zEky0o

    # bigger size; best quality
    yt-dlp https://www.youtube.com/watch?v=VUhQ6zEky0o

  2. timlyg says:

    4K Video Downloader+ getting harder to download Youtube videos which I subscribed to since Youtube is tightening its security against ad blockers and leechers. So it's back to yt-dlp.

    Here are my notes on the command lines:

    Alternative site to download Youtube:
    https://v4.www-y2mate.com/convert/

    list available formats with
    yt-dlp -F "URL"

    combine the video and audio streams using
    yt-dlp -f videoid+audioid
    yt-dlp -f "bestvideo+bestaudio/best" --merge-output-format mp4 "URL"

    Audio ONLY
    yt-dlp -x --audio-format mp3 "URL"

    Impersonate Browser
    yt-dlp --impersonate chrome:windows-10 "URL"

    Sleep between downloads, apparently must be used together (both min & max)
    --sleep-interval SECONDS
    --max-sleep-interval SECONDS

    Comma separated playlist_index of the items to download. You can specify a range using "[START]:[STOP][:STEP]". For backward compatibility, START-STOP is also supported. Use negative indices to count from the right and negative STEP to download in reverse order. E.g. "-I 1:3,7,-5::2" used on a playlist of size 15 will download the items at index 1,2,3,7,11,13,15
    -I, --playlist-items ITEM_SPEC

    Download Playlist sample:
    yt-dlp -f 605+234 -I 1:6 --impersonate chrome:windows-10 --sleep-interval 20 --max-sleep-interval 50 "https://www.youtube.com/watch?v=otjC1vZnXAY&list=PL9j-P-cHgBxkG6bEEswcmQ7pjs5kva7cV"

    yt-dlp -f 605+234 -I 1:29 --cookies cookies.txt --sleep-interval 20 --max-sleep-interval 50 "https://www.youtube.com/watch?v=YmplC63IAuI&list=PL9j-P-cHgBxlCGzTNeUcFcWsqogL0X4eC"

    Downlooad Video Sample:
    yt-dlp -f 605+234 --impersonate chrome:windows-10 "https://www.youtube.com/watch?v=f5zQ8_v12x4"

    yt-dlp --cookies cookies.txt https://www.youtube.com/watch?v=HSZYsyyAcIc

    If the server requires login, the authentication is in the cookies.txt file which yt-dlp can use. The cookies.txt file is easily retrieved using Firefox Extension. I don't use Chrome because Chrome is restricting access lately.

    With Auto-generated Subtitle embedded, for non-autogenerated sub, use --write-subs and format would be vtt unless specified (ie. --sub-format srt)
    yt-dlp --cookies cookies.txt --write-auto-subs --sub-lang "en.*" --embed-subs https://www.youtube.com/watch?v=MJ3fqxhMmxE

Leave a Reply to timlyg Cancel reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.