Hello,
I have issues when downloading the m3u8 file.
You can see in here
Code:streamlink --http-cookie "User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36" "hls://https://614b17082f29c.streamlock.net/vod2/_definst_/Enctyption_65654654/124821/Cau-01-24.smil/chunklist_w292079638_b1044100.m3u8?moontokenendtime=1641055028&moontokenhash=vqx4VIHqcKa7prcSutpVESpGXTX-VcEacxhJg2LHzxM%3D&moontokenstarttime=1641054968" best -o "02.mp4"
[Attachment 62671 - Click to enlarge]
I have tried with http-cookie but it still errors 403
Code:streamlink --http-header "authToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6InRydW9uZ3BodWNyb3NAZ21haWwuY29tIiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZSI6InRydW9uZ3BodWNyb3NAZ21haWwuY29tIiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjoibWVtYmVyIiwidXNlcm5hbWUiOiJ0cnVvbmdwaHVjcm9zQGdtYWlsLmNvbSIsImF2YXRhciI6ImF2YXRhci9ub3Bob3RvM180OHg0OC5naWYiLCJmdWxsbmFtZSI6IlBow7pjIE5ndXnhu4VuIFRyxrDhu51uZyIsImV4cGlyZXMiOiIxNjcyNTkwODg4Iiwic2Vzc2lvbmxvZ2ludG9rZW4iOiI1QkRFOTMwNzBENDA0OTQ4ODY4MjVDRjkwNkI3MDk1NyIsInNlc3Npb25sb2dpbmRldmljZXR5cGUiOiJQQyIsImV4cCI6MTY3MjU5MDg4OCwiaXNzIjoiaHR0cHM6Ly9tb29uLnZuIiwiYXVkIjoiaHR0cHM6Ly9tb29uLnZuIn0.fb9ql9OTJP7qJLIWkeBtla-zNy0kBwtCfNPkXXADn2I; mepuzzConfig=%7B%22app_id%22%3A%225zL12Gw9Jr%22%2C%22app_domain%22%3A%22https%3A//moon.vn/%22%2C%22app_status%22%3A10%2C%22public_key%22%3Anull%2C%22not_ask_allow_in_day%22%3A0%2C%22notif_wellcome%22%3A%7B%22status%22%3A1%2C%22data%22%3A%7B%22title%22%3A%22%5B%u01AFU%20%u0110%C3I%5D%20CH%C0O%20N%u0102M%20H%u1ECCC%20M%u1EDAI%20V%u1EDAI%20S%C1CH%20ID%22%2C%22body%22%3A%22Nh%E2n%20d%u1ECBp%20khai%20gi%u1EA3ng%2005/9%2C%20%20SALE%20s%E1ch%20ID%20c%F2n%2085k/%20cu%u1ED1n.%20%u01AFu%20%u0111%E3i%20%E1p%20d%u1EE5ng%20%u0111%u1EBFn%20h%u1EBFt%2010/09%22%2C%22icon%22%3A%22https%3A//i.imgur.com/Zkqqc81.jpg%22%2C%22image%22%3A%22https%3A//i.imgur.com/jdToojw.jpg%22%2C%22url%22%3A%22https%3A//moon.vn/sach-id-tu-sach-luyen-thi-dai-hoc%23utm_source%3Dmepuzz%26utm_medium%3Dpushweb%26utm_campaign%3Dnewvisitor%22%7D%7D%7D; bannerStaticArray=%5B%7B%22id%22%3A%2261c20d4d385c214e2d020911%22%2C%22opt%22%3A%7B%22timeout%22%3A0%2C%22timeout_off%22%3A0%2C%22display%22%3A%22always%22%2C%22device%22%3A%22desktop%22%2C%22segment%22%3A%5B%5D%7D%7D%2C%7B%22id%22%3A%2261c20f477f69524931135604%22%2C%22opt%22%3A%7B%22timeout%22%3A0%2C%22timeout_off%22%3A0%2C%22display%22%3A%22always%22%2C%22device%22%3A%22mobile%22%2C%22segment%22%3A%5B%5D%7D%7D%5D; bannerConfig=%5B%2261c20d4d385c214e2d020911%22%5D" "hls://https://614b17082f29c.streamlock.net/vod2/_definst_/Enctyption_65654654/124821/Cau-01-24.smil/chunklist_w292079638_b1044100.m3u8?moontokenendtime=1641055028&moontokenhash=vqx4VIHqcKa7prcSutpVESpGXTX-VcEacxhJg2LHzxM%3D&moontokenstarttime=1641054968" best -o "Cau-01-24.mp4"
[Attachment 62672 - Click to enlarge]
Someone, please help me to solve this problem. Thank you very much.
+ Reply to Thread
Results 1 to 11 of 11
-
-
Without the mother page its a bit like pissing in the wind to help you, we need the url of the page you are trying to download from and any login credentials - plus you may not have the correct m3u8; but...
--http-cookie for the user-agent is wrong for a start - see your first CODE box, you are either using a cookie or user-agent, you can use both (and more) but you cant intermix the syntax, this should be:
Code:streamlink --http-header "User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36" "m3u8-url" best -o output.mp4
Code:streamlink --http-header "cookie=xxxxxxxxxxxx" "m3u8-url" best -o output.mp4
Code:streamlink --http-header "cookie=xxxxxxxxxxxx" --http-header "User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36" "m3u8-url" best -o output.mp4
Code:streamlink --http-header "referer=xxxxxxxxx" "m3u8-url" best -o output.mp4
Code:streamlink --http-header "authorization=eyxxxxxxxxxxxxxxxxxx" "m3u8-url" best -o output.mp4
Last edited by codehound; 1st Jan 2022 at 15:07.
-
Thanks for your method of downloading videos. I tried those methods, but it still has 403 errors.
The website where I want to download the video isCode:https://moon.vn
Code:https://moon.vn/video/id/122810/0
-
signup YOU a new fake account for us and write here login data, if you want some help ...
-
Code:
yt-dlp --allow-u https://614b17082f29c.streamlock.net/vod2/_definst_/Enctyption_65654654/122810/01-bai-31-cac-dac-trung-co-ban-cua-quan-the-p1.mp4/playlist.m3u8?moontokenendtime=1641230529&moontokenhash=fu2bfmpqH7j4h_kPcNPLafn0O6npo3dUtbBW4LDHy0k=&moontokenstarttime=1641230469
-
Thank you. I have tried with your method it still shows an error. And I wrap it with a double-quote; it is still the same.
[Attachment 62727 - Click to enlarge]
[Attachment 62728 - Click to enlarge] -
need fresh m3u8. expired soon. try tris
Code:https://614b17082f29c.streamlock.net/vod2/_definst_/Enctyption_65654654/122810/01-bai-31-cac-dac-trung-co-ban-cua-quan-the-p1.mp4/playlist.m3u8?moontokenendtime=1641231807&moontokenhash=v8JN0K2_5UE4DD0jXHi6U-DDriRJ5tGYXVFgX21RESQ=&moontokenstarttime=1641231747
anyway
1) video is encrypted. need key to decrypt
2) streamlink not work with video encryptedLast edited by lomero; 3rd Jan 2022 at 11:58.
-
Code:
hlsdl -K "1b2c3d4e5f6a7b8c9d1fa29ad6745cde" "https://614b17082f29c.streamlock.net/vod2/_definst_/Enctyption_65654654/122810/01-bai-31-cac-dac-trung-co-ban-cua-quan-the-p1.mp4/chunklist_w1563627055.m3u8?moontokenendtime=1641234694&moontokenhash=eU5yW9PinNruCVxpo-f7oEaRE2kK3zwqsef8NHlpE10%3D&moontokenstarttime=1641234634"
[Attachment 62729 - Click to enlarge]
To get videos like this, you need to get the key via debugging and preferably use hlsdl for downloading.
Here's hlsdl
https://siasky.net/_AGwWgXqKxBMiPnZ-FQiMxZweDjDHbVtATvemIxZvaxDvQ
To get the key, open developer tools -> network
You are searching for "auth", this is where you get the key but it's encrypted!
[Attachment 62730 - Click to enlarge]
If you open the initiator tab, you will see all the javascript files "responsible" for this element.
What we need here is to click on key-loader.js (can you guess what this does by the name? Unbelievable!)
[Attachment 62731 - Click to enlarge]
Now here you see some javascript code. What we want to do now, is to stop the code at some point. Can you guess which one? Exactly, right when the key gets decrypted -> line 64
So we right click that line and add a breakpoint.
Now we reload the page and it will stop before fully loading the video, but it will load a bunch of stuff, including the key decryption.
It will look like this
[Attachment 62732 - Click to enlarge]
On the right side you can see I've clicked on response -> data -> Uint8Array(16)
This is our key, however, it's not in hex.
To get this key in hex, we can use a simple python script (copy this in Notepad, save it as whatever.py, run cmd in that folder and type whatever.py and press enter. You need to have Python installed for this)
Code:import binascii array_alpha = [ 27, 44, 61, 78, 95, 106, 123, 140, 157, 31, 162, 154, 214, 116, 92, 222 ] print(bytes(array_alpha).hex())
Code:1b2c3d4e5f6a7b8c9d1fa29ad6745cde
Tada! -
Last edited by jonatasants; 6th Nov 2022 at 07:20.
Similar Threads
-
403 Forbidden Error from yt-dlp on mpd file download?
By influx in forum Video Streaming DownloadingReplies: 12Last Post: 5th Oct 2021, 14:48 -
How to download WE-PLAY.TV with Streamlink?
By minegroasprilla in forum Video Streaming DownloadingReplies: 2Last Post: 3rd Aug 2020, 14:30 -
Tryng to download from animal planet... HTTP error 403 Forbidden
By syrist in forum Video Streaming DownloadingReplies: 3Last Post: 15th May 2020, 19:38 -
download afreecatv steaming with ffmpeg get HTTP error 403 Forbidden
By j2ee in forum Video Streaming DownloadingReplies: 1Last Post: 30th Apr 2020, 09:13 -
FFMPEG can not download m3u8 video. Error 403 (access denied)
By goken12 in forum Video Streaming DownloadingReplies: 9Last Post: 1st Jun 2018, 19:18