Skip to content

Instantly share code, notes, and snippets.

@ga2arch
Created May 26, 2012 15:43
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ga2arch/2794364 to your computer and use it in GitHub Desktop.
Save ga2arch/2794364 to your computer and use it in GitHub Desktop.
Tool to download mp3 from be-at.tv
import sys
import urllib2
import subprocess
url = sys.argv[1]
f = urllib2.urlopen(url)
content = f.read()
f.close()
tmp = url.split('/')
tmp1 = ' '.join(map(lambda x: x.capitalize(), tmp[-2].split('-')))
title = tmp[-1].capitalize().split('.')[0] + ' - ' + tmp1 + '.mp3'
print title
num = content.split('http://www.be-at.tv/embed.swf?p=')[1].split('&')[0]
print num
f = urllib2.urlopen('http://www.be-at.tv/CMS/Feeds/Playlist.ashx?page='+num)
content = f.read()
f.close()
uri = "Session" + content.split('url="/Session')[1].split('.flv')[0]
subprocess.call(['rtmpdump', '-r', 'rtmp://media.cdn.be-at.tv:80/cfx/st/',
'-a', 'cfx/st/', '-y', uri, '-o', '/tmp/audio.flv'])
subprocess.call(['ffmpeg', '-i', '/tmp/audio.flv', '-acodec', 'copy', title])
@troych
Copy link

troych commented Oct 18, 2013

Any chance we could get an update for this? I was able to manually download these sets for private use but since their latest update it seems to be harder get the correct files.

@rubensayshi
Copy link

yea, the Playlist.ashx can't seem to be requested :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment