VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Member
    Join Date
    Apr 2019
    Location
    Bahrain
    Search PM
    Dear,

    I've been using ffmpeg long time ago to download from shahid.net, The changed it several times but I always get it. I didn't do any downloads in the last year and I can see they changed it one another time.

    They implemented HLS and AES encryption, which I did before with another website. But now they have some weird m3u8 data there, there's no direct links to the ts streams instead we're talking about a manifest file which leads to video fragments.

    The manifest file will have the AES decryption key with it and I got the key, but the manifest list as I said doesn't have direct links to individual .ts streams. What I see instead is

    Code:
    #EXTM3U
    #EXT-X-VERSION:3
    #EXT-X-ALLOW-CACHE:NO
    #EXT-X-MEDIA-SEQUENCE:0
    #EXT-X-TARGETDURATION:6
    #EXT-X-KEY:METHOD=AES-128,URI="https://shahidkey-a.akamaihd.net/?kid=a2cb40a4-6af0-4631-a13c-4a34e540f93d",IV=0X6C20557FBBCFA150C2356FF5524791BF
    #EXT-X-PROGRAM-DATE-TIME:1970-01-01T00:00:00Z
    #EXTINF:6.000000,no-desc
    Fragments(video=0,format=m3u8-aapl-v3,audiotrack=aac_UND_2_32)
    #EXTINF:6.000000,no-desc
    Fragments(video=60000000,format=m3u8-aapl-v3,audiotrack=aac_UND_2_32)
    #EXTINF:6.000000,no-desc
    Fragments(video=120000000,format=m3u8-aapl-v3,audiotrack=aac_UND_2_32)
    #EXTINF:6.000000,no-desc
    Fragments(video=180000000,format=m3u8-aapl-v3,audiotrack=aac_UND_2_32)
    ...
    ...
    ...
    etc...
    It's just a part of the sequence (which has over 1700 sequence/fragments).

    I can download individual fragments from the browser inspect/developer tools. They're just binary, The encrypted HLS stream
    this is one of them
    https://shahid04-l3.shahid.net/65b60600-0224-4251-a0c9-abb7559a893e/6985408_6100036960...k=aac_UND_2_32)

    I created an m3u8 file with the decryption key inside and the whole list of these Fragments files, ffmpeg couldn't parse it and for each fragment it showed me the same single error "Failed to open segment of playlist 0"


    This is the command I tried
    Code:
    ffmpeg -i f1.m3u8 -c copy -bsf:a aac_adtstoasc -hls_key_info_file "https://shahidkey-a.akamaihd.net/?kid=a2cb40a4-6af0-4631-a13c-4a34e540f93d" output.mp4
    Quote Quote  
  2. Deceased
    Join Date
    Dec 2007
    Search PM
    Try v4 of hls with streamlink:

    Code:
    streamlink "hlsvariant://https://shahid04-l3.shahid.net/65b60600-0224-4251-a0c9-abb7559a893e/6985408_6100036960_Formula1Grand.ism/manifest(format=m3u8-aapl-v4).m3u8" best -o output.ts
    Quote Quote  
  3. Member
    Join Date
    Mar 2019
    Location
    Germany
    Search PM
    You can use hlsdl. Just copy the master .m3u8 URL and let it do its job
    Quote Quote  
  4. Member
    Join Date
    Apr 2019
    Location
    Bahrain
    Search PM
    Originally Posted by blimey View Post
    Try v4 of hls with streamlink:

    Code:
    streamlink "hlsvariant://https://shahid04-l3.shahid.net/65b60600-0224-4251-a0c9-abb7559a893e/6985408_6100036960_Formula1Grand.ism/manifest(format=m3u8-aapl-v4).m3u8" best -o output.ts
    Thanks bro, it's working albeit with few issues.
    I'm in macOS, so I started with a Windows VM, it worked perfectly till the internet disconnected and the file was corrupted. While it was downloading, I tried installing it in macOS and it wasn't something direct as there's no direct way. But I managed to install it, I installed and started to download again everything went smooth without interruption.. after finishing I discovered the file was without audio (no audio stream), so I'm again back in the Win VM downloading it again

    Hopefully this time it will work normally.
    Quote Quote  
  5. Member
    Join Date
    Apr 2019
    Location
    Bahrain
    Search PM
    Originally Posted by hvq View Post
    You can use hlsdl. Just copy the master .m3u8 URL and let it do its job
    Thanks bro, sadly I'll need to compile this as I can't see any compiled or executables there.. I never did this before so currently I'm using the above streamlink method which seems to be similar.
    Quote Quote  
  6. Member
    Join Date
    Mar 2019
    Location
    Germany
    Search PM
    Originally Posted by Xajel View Post
    Originally Posted by hvq View Post
    You can use hlsdl. Just copy the master .m3u8 URL and let it do its job
    Thanks bro, sadly I'll need to compile this as I can't see any compiled or executables there.. I never did this before so currently I'm using the above streamlink method which seems to be similar.
    No you don't. Just download the release here
    Quote Quote  
  7. Deceased
    Join Date
    Dec 2007
    Search PM
    Originally Posted by Xajel View Post
    Thanks bro, it's working albeit with few issues.
    I'm in macOS, so I started with a Windows VM, it worked perfectly till the internet disconnected and the file was corrupted. While it was downloading, I tried installing it in macOS and it wasn't something direct as there's no direct way. But I managed to install it, I installed and started to download again everything went smooth without interruption.. after finishing I discovered the file was without audio (no audio stream), so I'm again back in the Win VM downloading it again

    Hopefully this time it will work normally.
    ffmpeg will also work with v1 or v4 hls, but since this master m3u8 is hls-multi (separate video/audio), you might have to specify the child m3u8 inputs separately for the video and audio to ffmpeg, and carefully mux them to insure video/audio sync.
    Quote Quote  
  8. Originally Posted by hvq View Post
    Originally Posted by Xajel View Post
    Originally Posted by hvq View Post
    You can use hlsdl. Just copy the master .m3u8 URL and let it do its job
    Thanks bro, sadly I'll need to compile this as I can't see any compiled or executables there.. I never did this before so currently I'm using the above streamlink method which seems to be similar.
    No you don't. Just download the release here
    thanks
    how can using it to download playlist in.txt file as youtybe dll?
    Quote Quote  



Similar Threads

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