Audio/video stream recording forums (http://stream-recorder.com/forum/index.php)
-   Audio stream recording (http://stream-recorder.com/forum/forumdisplay.php?f=5)
-   -  

download audio streamed by JWPlayer

(http://stream-recorder.com/forum/showthread.php?t=19521)

anctop 03-23-2015 01:10 AM

download audio streamed by JWPlayer


 
Hello,

I'm new in this forum & a novice in matters with streaming.
Recently I come across a couple of radio programmes on the www and I want to save a local copy of them, but enormous difficulties are encountered.

The site uses JWPlayer to stream multimedia contents. Here is a sample URL :

http://programme.rthk.hk/channel/rad...channel=radio4

The URL indicates that the audio should be an MP3, but in fact the player plays an .m3u8 :

http://stmw1.rthk.hk/aod/_definst_/r.../playlist.m3u8

and this .m3u8 directs to another .m3u8 :

http://stmw1.rthk.hk/aod/_definst_/r...061855960.m3u8

This last .m3u8 is a playlist with over 700 entries of .ts files :

http://stmw1.rthk.hk/aod/_definst_/r...061855960_0.ts
http://stmw1.rthk.hk/aod/_definst_/r...061855960_1.ts
http://stmw1.rthk.hk/aod/_definst_/r...061855960_2.ts
....

Since the URL's are known, I've retrieved a few of them, but none of these .ts files can be opened by local players (e.g. VLC). The file types of the .ts files are reported as :

media_w2061855960_0.ts: MPEG transport stream data
media_w2061855960_1.ts: TeX font metric data
media_w2061855960_2.ts: TeX font metric data
media_w2061855960_3.ts: data
media_w2061855960_4.ts: data
....

I've also tried to download using some Firefox add-on, but the stream keeps generating new entries with identical names instead of a single target.

I guess the .ts files are the fragments of the original MP3.
Even though I am patient enough to retrieve all such .ts files named in the playlist, the problem remains how to sew them together ? or is there any better way to download the programme as a single clip ?

nullacht 03-23-2015 04:42 AM

Re: download audio streamed by JWPlayer


 
LIVESTREAMER:

Code:

livestreamer "hlsvariant://stmw1.rthk.hk/aod/_definst_/radio/archive/radio4/Liveon4/mp3/mp3:20150321.mp3/playlist.m3u8" best -o 01.ts
Code:

[cli][info] Found matching plugin stream for URL hlsvariant://stmw1.rthk.hk/aod/_definst_/radio/archive/radio4/Liveon4/mp3/mp3:20150321.mp3/playlist.m3u8
[cli][info] Available streams: 70k (worst, best)
[cli][info] Opening stream: 70k (hls)

FFMPEG:

Code:

ffmpeg -i "http://stmw3.rthk.hk/aod/_definst_/radio/archive/radio4/Liveon4/mp3/mp3:20150321.mp3/playlist.m3u8" -c copy 01.ts

anctop 03-24-2015 01:42 AM

Re: download audio streamed by JWPlayer


 
Many thanks for the suggestions.

I've tried the method of "ffmpeg". It starts and runs for a short while but then ends prematurely with an error :

Code:

[hls,applehttp @ 02fdd720] Failed to open segment of playlist 0
http://stmw3.rthk.hk/aod/_definst_/radio/archive/radio4/Liveon4/mp3/mp3:20150321.mp3/playlist.m3u8: Unknown error
size=    2500kB time=00:05:20.00 bitrate=  64.0kbits/s
video:0kB audio:2500kB subtitle:0kB other streams:0kB global headers:0kB muxing
overhead: 0.013008%

Is it possible to "resume" the download ?

Also, a couple of lines saying "[mpegts @ 030155c0] PES packet size mismatch" appeared during the execution.
How does this error affect the downloaded file ?

nullacht 03-24-2015 05:12 AM

Re: download audio streamed by JWPlayer


 
I can't confirm that. Everything is working fine here. Seems to be a connection problem (maybe a bad internet connection?). Try it again with the Livestreamer application.

Code:

http://docs.livestreamer.io/cli.html

Mabel 03-24-2015 08:17 PM

Re: download audio streamed by JWPlayer


 
Quote:

Originally Posted by anctop (Post 75061)
Hello,

I'm new in this forum & a novice in matters with streaming.
Recently I came across a couple of radio programs on the www and I want to save a local copy of them, but enormous difficulties are encountered.

The site uses JWPlayer to stream multimedia contents. ... I guess the .ts files are the fragments ...

I too am a novice here (and to stream-ripping). I had a very similar problem over the last few days, and here is my (Windows-based) semi-automatic solution. It is somewhat crude, but it works. It requires two browser add-ons (which I have installed in Firefox) or workalikes: Video Download Helper and Download Them All.

The link above is to a zip-file which contains everything else you will need. Just open the file "Instructions.txt" and follow it. (The instructions assume the use of the above two browser add-ons.)

The method requires a bit of manual editing to the scripts used (they are Windows .cmd files) and the entering of some commands in a Command-Prompt window, but for about 5 minutes' work, you can download all the (.TS) segments comprising the whole download stream and concatenate them into a single file playable in VLC Media Player. (The concatenated file is somewhat bloated with multiple redundant headers throughout the file, but their existence doesn't seem to bother VLC and the overhead is slight.)

Note: the specific example used in the instructions may not work in some countries, as the stream I used it for may be geo-blocked for IP addresses outside Australia. Just adapt it to whatever stream you want.

I'd be interested in any feedback.

anctop 03-24-2015 09:50 PM

Re: download audio streamed by JWPlayer


 
I've just tried the "livestreamer" method. It runs much faster than "ffmpeg", but there are still a couple of errors :

Code:

[cli][info] Found matching plugin stream for URL hlsvariant://stmw1.rthk.hk/aod/_definst_/radio/archive/radio4/Liveon4/mp3/mp3:20150321.mp3/playlist.m3u8
[cli][info] Available streams: 70k (worst, best)
[cli][info] Opening stream: 70k (hls)
[download][01.ts] Written 15.5 MB (2m4s @ 52.0 KB/s)
[stream.hls][error] Failed to open segment 188: Unable to open URL: http://stmw1.rthk.hk/aod/_definst_/radio/archive/radio4/Liveon4/mp3/mp3:20150321.mp3/media_w739913464_188.ts (timed out)
[download][01.ts] Written 43.4 MB (5m27s @ 73.1 KB/s)
[stream.hls][error] Failed to open segment 523: Unable to open URL: http://stmw3.rthk.hk/aod/_definst_/radio/archive/radio4/Liveon4/mp3/mp3:20150321.mp3/media_w1960685163_523.ts (timed out)
[download][01.ts] Written 59.6 MB (7m29s @ 516.6 KB/s)
[cli][info] Stream ended

The errors are fatal, because the resultant "01.ts" cannot be played.

I think nullacht's conclusion is right, that my network connection is not stable enough for lengthy downloading. I'll try at different times when the traffic is less busy.

Thanks again for recommending the useful tools.

Mabel 03-24-2015 09:57 PM

Re: download audio streamed by JWPlayer


 
Quote:

Originally Posted by Mabel (Post 75103)
... my (Windows-based) semi-automatic solution ... is somewhat crude, but it works. ... for about 5 minutes' work, you can download all the (.TS) segments comprising the whole download stream and concatenate them into a single file playable in VLC Media Player.

Hmmm. It seems that not all .ts files (?AKA .MP2T files) are the same. The files in the stream I tested my solution on, play in VLC (2.1.5) (try this one, for example), but when I tried the same with some of the files linked to by anctop, VLC would not play them. I noticed, in a hex editor, that there are some differences between them in their header blocks, but I don't know what the differences mean.

(I have just updated to ver 2.2.0 of VLC, and same behaviour!)

So, while my solution works for downloading the files, you may need to hunt around for a player that will play the particular version of .TS files used in your stream. Anctop, did you ever find such a player?

(Note: The above links are to ABC (Australia) radio programs that are kept online only for 1 month after the original broadcast date. That content will expire in 28 days, so if you're reading this after that time, the links won't work.)

Mabel 03-24-2015 11:59 PM

Re: download audio streamed by JWPlayer


 
Quote:

Originally Posted by Mabel (Post 75106)
So, while my solution works for downloading the files, you may need to hunt around for a player that will play the particular version of .TS files used in your stream. Anctop, did you ever find such a player?

I found an open source player that plays the files linked to by both anctop and me. It is MPC-HC.

BarryJones 03-26-2015 10:49 PM

Re: download audio streamed by JWPlayer


 
Quote:

Originally Posted by Mabel (Post 75103)
I too am a novice here (and to stream-ripping). I had a very similar problem over the last few days, and here is my (Windows-based) semi-automatic solution. It is somewhat crude, but it works. It requires two browser add-ons (which I have installed in Firefox) or workalikes: Video Download Helper and Download Them All.

The link above is to a zip-file which contains everything else you will need. Just open the file "Instructions.txt" and follow it. (The instructions assume the use of the above two browser add-ons.)

The method requires a bit of manual editing to the scripts used (they are Windows .cmd files) and the entering of some commands in a Command-Prompt window, but for about 5 minutes' work, you can download all the (.TS) segments comprising the whole download stream and concatenate them into a single file playable in VLC Media Player. (The concatenated file is somewhat bloated with multiple redundant headers throughout the file, but their existence doesn't seem to bother VLC and the overhead is slight.)

Note: the specific example used in the instructions may not work in some countries, as the stream I used it for may be geo-blocked for IP addresses outside Australia. Just adapt it to whatever stream you want.

I'd be interested in any feedback.

Your method works for me. I downloaded an abc.net.au audio stream and the output plays fine within Windows/VLC. Now I want to convert the .ts file into a regular audio file (eg .mp3, .flac) so that I can tag it within my audio player (WinAmp).


All times are GMT -6. The time now is 08:40 PM.