Writing the final m3u8 video file sequentially during the download process
Opened this issue ยท 7 comments
UPDATE :
UPDATE :
Hi Mr @AminBhst , Ramadan moubarak, so recently a developer of m3u8 downloader informs me about his idea to be able to play temporary video while downloading in his software :
""I have found a new idea: when downloading, do not directly download the video in the specified format (mp4/flv), but rather a single ts/mkv file, and finally convert it to the specified video format. The ts/mkv video format naturally supports streaming playback, so it can be downloaded and played simultaneously.
You can test with this code:
ffmpeg -referer https://0472.org/ -i https://0472.org/hls/cgtn.m3u8 -max_muxing_queue_size 9999 -preset fast -c:v copy -c:a copy $PWD/1740732513283.mkv
Make sure you have the ffmpeg executable file. "
UPDATE :
So i made today 2 new posts, maybe they can help to to achieve this dream goal ! :
and
Hi, sometimes I encounter problems in downloading when I playback the temporary hls video downloaded by the famous download videos extensions like:
https://github.com/xifangczy/cat-catch
and
https://github.com/chandler-stimson/live-stream-downloader
this extension is not a downloader but can also detect m3u8 links of embedded hls videos for preview:
https://github.com/andy-portmen/open-in-vlc
and also these extensions are able to give us the m3u8 links of the embedded hls videos:
https://github.com/puemos/hls-downloader
https://github.com/54ac/stream-detector
http://sniffertv.com/docs/
https://sniffertv.com/docs/
https://www.downloadhelper.net/
https://9xbuddy.com/fr
https://9xbuddy.online/fr
https://mediatools.rndnm.com/howTo
https://mediatools.cc/hlsDownloader
https://m3u8.dev/
https://download.m3u8.dev/
https://beta.m3u8.dev/
https://m3u8play.dev/
i.e. the problems I encounter sometimes are the download does not finish or is deleted, web browser that does not close at the end of the download despite the auto close browser when donwload finish option is enabled....
I had the idea to use external downloaders to copy paste the m3u8 link given by these great extensions and put them in external donwload managers, like FDM, media-donwloader, jdownloader....but either it doesn't work and these download managers are unable to download hls m3u8 videos, or there is no sequential download and we can't playback temporary video because it's full of small fragments...
until this night, I decide to install IDA a famous Russian download manager because it's compatible with my indows 7 os 32 bits, and there the dream becomes true alhamdouilAllah, I copy the m3u8 link given by the extensions and I paste it into IDA: Internet Download Accelerator which can download the hls video sequentially and display the temporary video and I can playback temporary video! I set the number of threads = 1, and I enabled the option from the graphical interface "close IDA when download finish".....
so we hope please Brisk will also be able to download hls videos if we copy and paste the m3u8 links given by the video downloaders extensions, so Brisk will no longer need to develop a custom media detection extension, and we could download hls video and playback temporary video whose download should be sequential i.e. without displaying lots of small hls video fragments in the download folder in order to be able to playback temporary video, thank's!
Hey. with the new v2.1.0 Brisk already supports downloading m3u8 streams with the browser extension.
Regarding sequential file writes, I'll have to think about it, but I think it could work even with multiple threads.
Great ! Thanks ! ๐ฏ ๐ฅ
yes i think so too, because in the settings of extensions cat catch and live stream downloader, I sometimes set the number of threads to 2 and 3 and even 6 and I can playback temporary video from the beginning using the internal downloader parser of these extensions......
but to put more chances, I still set the number of threads=1 in IDA download manager, I watch old anime so the streaming platform offers SD quality and the anime episode weighs 40 MB so for me, very fast download and no need to increase the number of threads....
oops I forgot to post the IDA link:
and here are my 2 favorite streaming sites where each episode has several media players and where we can test this feature of sending the detected m3u8 link by the extensions to the external download manager:
UPDATE :
Mr @AminBhst , sadly, my dream is broken :( the dream was short-lived, after 5 videos downloaded of 24-minute anime episodes, the external download manager shows download forbidden :(
may be to skip this kind of bugs, video extensions should add some things to the m3u8 link to fix this problem, may be add extra referer, user agent of the browser....because the website seems to detect that it is an external download manager and blocks the download after 5 successful downloads :(
so a classic easy graphical download manager seems easier to use like IDA download manager, and may be Brisk download manager will encounter the same donwload problem we hope please Brisk will find the technical exploit to avoid the "download forbidden" message when using an external download manager like Brisk compatible with m3u8 links, thanks! maybe by add some things to the m3u8 link to fix this problem, for example referer, user agent of the browser....because the website seems to detect that it is an external download maanger and blocks the download :(
I have the idea to install a free vpn that acts on the OS and the external download manager IDA uilse VPN connection to test if I can avoid this blocking and "download prohibited" message, but psiphon vpn (and probably lantern vpn, proton vpn and many other free vpn) are no longer compatible with my windows 7 os 32 bits unfortunately so I can't test, and the ideal is not to use a vpn.....because with the internal downloader of the extension, we don't have this kind of "download prohibited" message that we find in external download manager .......
Thanks !
UPDATE: after a 10 hour break, I can again download m3u8 links given by extension of video donwloader using IDA download manager, apparently we should not download multiple videos to avoid blocking via external download manager...., i only download 5 videos of 24 minutes each spaced out in time, yet i had a blocked forbidden donwload yesterday when using IDA ...... ......
UPDATE :
Hi Mr @AminBhst , Ramadan moubarak, so recently a developer of m3u8 downloader informs me about his idea to be able to play temporary video while downloading in his software :
""I have found a new idea: when downloading, do not directly download the video in the specified format (mp4/flv), but rather a single ts/mkv file, and finally convert it to the specified video format. The ts/mkv video format naturally supports streaming playback, so it can be downloaded and played simultaneously.
You can test with this code:
ffmpeg -referer https://0472.org/ -i https://0472.org/hls/cgtn.m3u8 -max_muxing_queue_size 9999 -preset fast -c:v copy -c:a copy $PWD/1740732513283.mkv
Make sure you have the ffmpeg executable file. "
UPDATE :
Mr he852100 gives me this great idea :
Sequential download+player preview is easy to achieve :
It's easy. M3u8 and fragments are saved locally, only m3u8 needs to be modified to adapt to the new environment
Tampering with the temporary file raw.m3u8 of N_m3u8DL RE
#EXTINF:2.000,live
https://video-edge-cec8e8.tpe01.abs.hls.xxx.net/v1/segment/.ts
to
#EXTINF:2.000,live
0____/segment.ts
Set up a local HTTP server, N_m3u8DL RE cache to set up this directory
Play it on the player