stsaz / fmedia

fast audio player/recorder/converter
BSD 2-Clause "Simplified" License
216 stars 21 forks source link

HTTPS Internet Radio Streams #84

Closed adamleinss closed 2 years ago

adamleinss commented 2 years ago

Hello,

Is there any planned support for recording streaming radio with HTTPS? Most sites are HTTPS these days.

Example stream:

C:\fmedia>fmedia https://stream.revma.ihrhls.com/zc4245 -o C:\temp\radio.mp3 --stream-copy φfmedia v1.28 (win-x64) 10:00:17.823 :3c80 [error] file: *1: "https://stream.revma.ihrhls.com/zc4245": file open: (123) The filename, directory name, or volume label syntax is incorrect

C:\fmedia>fmedia http://stream.revma.ihrhls.com/zc4245 -o C:\temp\radio.mp3 --stream-copy φfmedia v1.28 (win-x64) 10:00:24.952 :224c [info] net.httpif: 1: resolving host stream.revma.ihrhls.com... 10:00:24.978 :224c [info] net.httpif: 1: connecting to stream.revma.ihrhls.com (18.188.21.167:80)... 10:00:25.025 :224c [info] net.httpif: 1: HTTP redirect: http://n48a-e2.revma.ihrhls.com/zc4245?rj-ttl=5&rj-tok=AAABgwPnI5cAlb9_5FoqZhXqOQ 10:00:25.025 :224c [info] net.httpif: 1: resolving host n48a-e2.revma.ihrhls.com... 10:00:25.050 :224c [info] net.httpif: *1: connecting to n48a-e2.revma.ihrhls.com (13.58.142.3:80)... fmedia has crashed: C:\Users\aleinss\AppData\Local\Temp\fmedia-crashdump-63136c09.txt fmedia (win-x64) v1.28 Signal:3221225477 Address:0x0000000000000010 Flags:0 Thread:224c

0: 0x00007ff651ea8a8d +8a8d C:\fmedia\fmedia.exe [0x00007ff651ea0000]

1: 0x00007ff651ea3adf +3adf C:\fmedia\fmedia.exe [0x00007ff651ea0000]

2: 0x00007ffaf03a0057 +110057 C:\WINDOWS\System32\KERNELBASE.dll [0x00007ffaf0290000]

3: 0x00007ffaf28953b0 +a53b0 C:\WINDOWS\SYSTEM32\ntdll.dll [0x00007ffaf27f0000]

4: 0x00007ffaf287c766 +8c766 C:\WINDOWS\SYSTEM32\ntdll.dll [0x00007ffaf27f0000]

5: 0x00007ffaf289229f +a229f C:\WINDOWS\SYSTEM32\ntdll.dll [0x00007ffaf27f0000]

6: 0x00007ffaf2841454 +51454 C:\WINDOWS\SYSTEM32\ntdll.dll [0x00007ffaf27f0000]

7: 0x00007ffaf2890dce +a0dce C:\WINDOWS\SYSTEM32\ntdll.dll [0x00007ffaf27f0000]

8: 0x00007ffae3069640 +9640 C:\fmedia\mod\net.dll [0x00007ffae3060000]

9: 0x00007ffae3068952 +8952 C:\fmedia\mod\net.dll [0x00007ffae3060000]

10: 0x00007ffadf7c512b +512b C:\fmedia\mod\core.dll [0x00007ffadf7c0000]

11: 0x00007ffadf7ccc23 +cc23 C:\fmedia\mod\core.dll [0x00007ffadf7c0000]

12: 0x00007ffadf7cd7b9 +d7b9 C:\fmedia\mod\core.dll [0x00007ffadf7c0000]

13: 0x00007ff651eb1256 +11256 C:\fmedia\fmedia.exe [0x00007ff651ea0000]

14: 0x00007ff651ea13c1 +13c1 C:\fmedia\fmedia.exe [0x00007ff651ea0000]

15: 0x00007ff651ea14f6 +14f6 C:\fmedia\fmedia.exe [0x00007ff651ea0000]

16: 0x00007ffaf15b7034 +17034 C:\WINDOWS\System32\KERNEL32.DLL [0x00007ffaf15a0000]

17: 0x00007ffaf2842651 +52651 C:\WINDOWS\SYSTEM32\ntdll.dll [0x00007ffaf27f0000]

If you copy/paste this URL into any web browser, it plays just fine.

adamleinss commented 2 years ago

Actually, it looks like it does re-direct to HTTP, not sure why fmedia crashes.

adamleinss commented 2 years ago

C:\fmedia>fmedia -debug http://stream.revma.ihrhls.com/zc4245 -o C:\temp\radio.mp3 --stream-copy φfmedia v1.28 (win-x64) 20:02:29.725 :6a64 [error] main: cmd line parser: near '': FFCMDARG_ESHORT

stsaz commented 2 years ago

Hello! Thank you for reporting this! Fixed, will be available in the upcoming release.

adamleinss commented 2 years ago

Wow that was quick, thank you!

stsaz commented 2 years ago

I've just released v1.29, now this http:// radio stream works fine. There are a few notes, however:

fmedia http://stream.revma.ihrhls.com/zc4245 -o C:\temp\radio.mp3 --stream-copy

This particular stream is in AAC-HE format, so you need to specify .aac file - e.g. radio.aac.

"https://stream.revma.ihrhls.com/zc4245": file open: (123) The filename, directory name, or volume label syntax is incorrect

HTTPS streams are not supported currently. I guess I need to include SSL support into fmedia at some point in the future... I added this into fmedia's TODO list. On the other hand, I don't want to support SSL radio streams at all because data encryption is completely meaningless in this case (using much more energy than unencrypted streams without any good reason). But it seems that there's no other way as more and more people start using HTTPS like maniacs :)

adamleinss commented 2 years ago

Thanks, it is working great! Only thing I noticed is it appears that --until is not honored when you want to terminate the stream copying after a certain amount of time. I can work around that with taskkill.

stsaz commented 2 years ago

--until is not honored

It's true for network streams. It won't be too hard to implement though. Added to my TODO list.