nilaoda / N_m3u8DL-CLI

[.NET] m3u8 downloader 开源的命令行m3u8/HLS/dash下载器,支持普通AES-128-CBC解密,多线程,自定义请求头等. 支持简体中文,繁体中文和英文. English Supported.
https://nilaoda.github.io/N_m3u8DL-CLI/
MIT License
14.17k stars 2.15k forks source link

[HELP] How to capture stream from SiriusXM #166

Closed Sei969 closed 4 years ago

Sei969 commented 4 years ago

Hello, I'm trying to capture AES128 audio stream from a SiriusXM channel:

Need a USA Vpn Browser link: https://player.siriusxm.com/home/foryou (Free preview > Channel 75) master m3u8: https://siriusxm-priprodlive.akamaized.net/AAC_Data/metropolitanopera/HLS_metropolitanopera_256k_v3/metropolitanopera_256k_large_v3.m3u8

What I get is as follow, quite indecipherable to me:

N_m3u8DL-CLI v2.6.3 20200417...
Speed: waiting
Progress: waiting

????:metropolitanopera_variant_large_v3_20200427152811
15:28:11.999 ????:C:\Users\....\Desktop\N_m3u8DL-CLI-master\Downloads
15:28:12.124 ??????...
15:28:12.264 ??m3u8??
15:28:26.194 ??m3u8??
15:28:26.274 ??meta.json
15:28:26.494 ???????
15:28:26.523 ??playLists.json
15:28:27.749 ??????????
15:28:27.749 ????m3u8...
15:28:27.749 ??m3u8??
15:28:43.044 ????:00m00s
15:28:43.044 ???:0, ?????:0
15:28:43.044 ??????, ????
15:28:43.134 '0' is not a valid range value. The range must be greater than 0.
> "consumer" is not recognized as an internal or external command,
> an executable program or batch file.
> "gupId" is not recognized as an internal or external command,
> an executable program or batch file.

According to master.m3u8 here's the index:

https://siriusxm-priprodlive.akamaized.net/AAC_Data/metropolitanopera/metropolitanopera_variant_large_v3.m3u8?token=1587811473_9105c16e27a7232681c761a568181b58&consumer=k2&gupId=49DB30E6EFA74AC419984495AB19FB6B

#EXTM3U
#EXT-X-ALLOW-CACHE:NO
#EXT-X-VERSION:1
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=281600,CODECS="mp4a.40.2"
HLS_metropolitanopera_256k_v3/metropolitanopera_256k_large_v3.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=105600,CODECS="mp4a.40.5"
HLS_metropolitanopera_96k_v3/metropolitanopera_96k_large_v3.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=70400,CODECS="mp4a.40.5"
HLS_metropolitanopera_64k_v3/metropolitanopera_64k_large_v3.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=35200,CODECS="mp4a.40.5"
HLS_metropolitanopera_32k_v3/metropolitanopera_32k_large_v3.m3u8

and the other two .m3u8 links return me these indexes (cut for lenght):

https://siriusxm-priprodlive.akamaized.net/AAC_Data/metropolitanopera/HLS_metropolitanopera_32k_v3/metropolitanopera_32k_large_v3.m3u8?token=1587811473_9105c16e27a7232681c761a568181b58&consumer=k2&gupId=49DB30E6EFA74AC419984495AB19FB6B

#EXTM3U
#EXT-X-VERSION:1
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:254898
#EXT-X-ALLOW-CACHE:NO
#EXT-X-KEY:METHOD=AES-128,URI="key/1"
#EXT-X-PROGRAM-DATE-TIME:2020-04-25T05:14:31.101+00:00
#EXTINF:10,
metropolitanopera_32k_1_042518871101_00254898_v3.aac
#EXT-X-PROGRAM-DATE-TIME:2020-04-25T05:14:40.852+00:00
#EXTINF:10,
metropolitanopera_32k_1_042518880852_00254899_v3.aac
#EXT-X-PROGRAM-DATE-TIME:2020-04-25T05:14:50.604+00:00
#EXTINF:10,

https://siriusxm-priprodlive.akamaized.net/AAC_Data/metropolitanopera/HLS_metropolitanopera_64k_v3/metropolitanopera_64k_large_v3.m3u8?token=1587811473_9105c16e27a7232681c761a568181b58&consumer=k2&gupId=49DB30E6EFA74AC419984495AB19FB6B

#EXTM3U
#EXT-X-VERSION:1
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:254900
#EXT-X-ALLOW-CACHE:NO
#EXT-X-KEY:METHOD=AES-128,URI="key/1"
#EXT-X-PROGRAM-DATE-TIME:2020-04-25T05:14:50.604+00:00
#EXTINF:10,
metropolitanopera_64k_1_042518890604_00254900_v3.aac
#EXT-X-PROGRAM-DATE-TIME:2020-04-25T05:15:00.355+00:00
#EXTINF:10,

Header request from the master.m3u8:

GET /AAC_Data/metropolitanopera/metropolitanopera_variant_large_v3.m3u8?token=1587811473_9105c16e27a7232681c761a568181b58&consumer=k2&gupId=49DB30E6EFA74AC419984495AB19FB6B HTTP/1.1
Host: siriusxm-priprodlive.akamaized.net
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br
Origin: https://player.siriusxm.com
DNT: 1
Connection: keep-alive
Referer: https://player.siriusxm.com/all-channels

If someone wants to test you have to go to this link (need a USA Vpn): https://player.siriusxm.com/home/foryou

Then start free preview > all channels > and choose channel 75 (Met Opera Radio).

I would love someone to help me fix it. Any suggestions are always welcome. Thank you!

nilaoda commented 4 years ago

You need add Header Cookie.

Find that with your browser:

image

and then

N_m3u8DL-CLI.exe "https://siriusxm-priprodlive.akamaized.net/AAC_Data/metropolitanopera/HLS_metropolitanopera_32k_v3/metropolitanopera_32k_large_v3.m3u8?token=1588006122_9d7bae231a1e834d2a4a6a33c9318250&consumer=k2&gupId=5291D61E3F0DD31570F665D29CC3319A" --saveName "metropolitanopera_32k_large_v3" --headers "cookie:STRING YOU FOUND"

recording

image

Sei969 commented 4 years ago

Thank you nilaoda!

I was able to reproduce from my side. The fragments are downloaded and merged into a .ts file of about 139MB but the terminal is stuck on Waiting...

22:48:29.681 <278292 Downloading>
22:48:29.960 <278292 Complete>
22:48:29.961 <278293 Downloading>
22:48:30.241 <278293 Complete>
22:48:30.242 Waiting...

After 15 minutes of waiting I am forced to shutdown the terminal and when I try to listen the downloaded file it plays only the first 6 seconds.

I also want to ask:

  1. is it possible to choose the quality of the file to download?
  2. Since I also have an account how can I implement username and password in the program commands?
  3. Is it possible to set a proxy command to avoid using a Vpn?

Anyway, your program is very promising. I can't wait to read your answers!

nilaoda commented 4 years ago

My program determines whether it is a live stream by detecting whether m3u8 ends with #EXT-X-ENDLIST

You can manually change the vod tag of meta.json to true, and the program will download the stream in the normal way. (Just use meta.json file path as url)


  1. At this stage, there is no option to select quality.
  2. This is just an m3u8 download program, and will not provide login function.
  3. Currently, the system proxy settings are used automatically, and can also be disabled using commands. Use custom settings will be added in a future version.
Sei969 commented 2 years ago

Is N_m3u8DL-CLI support AES-128 m3u8 live? It works great with SiriusXM pre-recorded content but I can't figure out if it works with m3u8 live.