VideoHelp Forum




+ Reply to Thread
Results 1 to 6 of 6
  1. Member
    Join Date
    Feb 2021
    Location
    Sweden
    Search Comp PM
    I am trying to use yt-dlp to download live streaming video from a few sites, but when yt-dlp tries to find the m3u8 informatioin it exits after getting response "HTTP Error 403: Forbidden".
    I am able to download using ffmpeg standalone but it is a mess dealing with all the ffmpeg arguments, so I would like to use yt-dlp instead.
    If I do it with ffmpeg I have to add the arguments:
    Code:
     -referer <url> -i <actual m3u8 url> -t <timout in seconds>
    Can the same referer flag be applied to yt-dlp without setting the additional argument
    Code:
     --downloader ffmpeg
    Last edited by BosseB; 12th Nov 2021 at 08:50.
    Quote Quote  
  2. Do you need ' -t '?
    Quote Quote  
  3. Member
    Join Date
    Feb 2021
    Location
    Sweden
    Search Comp PM
    Originally Posted by LZAA View Post
    Do you need ' -t '?
    Yes because I am using scripts to download 1 hour segments of a 24/7 stream using at jobs.
    I can use timeout to force yt-dlp to quit after a set time (3600 s) but it leaves a .part video file, which then has to be converted to mp4.
    But when I set yt-dlp to use ffmpeg as downloader I can also add the -t 3600 ffmpeg argument.
    OTOH changing yt-dlp downloader will probably cause an issue with the arguments to use for the download, which yt-dlp is handling internally...

    I am looking to simplify the rather complex scripting I have now where I code ffmpeg directly into something easier to use and understand, while at the same time producing the same end result.

    As of now I have another script that runs immediately before the ffmpeg script starts and which digs out the m3u8 URL from the webpage and stuffs that into a file, which the main script reads to set the -referer and -i parameters respectively for ffmpeg.
    Then follows conversion arguments to get the correct video size and quality etc. Pretty complex stuff.

    PS: I got some help here as well as on the mail list as to how to do the ffmpeg coding.
    Quote Quote  
  4. Code:
    yt-dlp --referer "http..." "url"
    Quote Quote  
  5. yt-dlp --referer "URL" --no-part ...
    Quote Quote  
  6. Member
    Join Date
    Feb 2021
    Location
    Sweden
    Search Comp PM
    Originally Posted by jagabo View Post
    Code:
    yt-dlp --referer "http..." "url"
    Originally Posted by LZAA
    Code:
    yt-dlp --referer "URL" --no-part ...
    OK I tested by using this, where I have the same url twice:
    Code:
    yt-dlp --referer <url> <url> -o test.mp4
    Now I get past the "HTTP Error 403: Forbidden" problem and there is a video created in format 1280x720 (too big).
    So I added an additional parameter to reduce the video size:
    Code:
    yt-dlp -S 'res:500' --referer <url> <url> -o test.mp4
    But it is still 1280x720...

    And the created videos are only 24 seconds in length!
    So the ffmpeg -t argument has to be added to yt-dlp in order to fix this such that a longer (1 hour) download can be done from the live stream.
    Otherwise yt-dlp is not usable.

    Currently I have to use the --downloader ffmpeg argument to be able to set the length of the video but I lose control of the formatting and get huge video file sizes..

    Instead I must continue using ffmpeg rather than yt-dlp, which means I have to dig out the m3u8 url separately using another script call first and read it from disk to be used in the main script using the ffmpeg call.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!