Ticket #2105: run-iheart-x

File run-iheart-x, 655 bytes (added by yuri@…, 14 years ago)

Script reproducing the problem

Line 
1#!/usr/bin/env python
2
3import subprocess
4import time
5import urllib2
6import xml.etree.ElementTree as ET
7import os
8import datetime
9
10DefaultStation="ktrh-am"
11
12def getXML():
13 data=urllib2.urlopen('http://p2.'+station+'.ccomrcdn.com/player/player_dispatcher.html?section=radio&action=listen_live').read()
14 xml=ET.fromstring(data)
15 return xml
16
17station=DefaultStation
18
19try:
20 xml=getXML()
21except urllib2.URLError:
22 print "Error - Invalid Station ID or Web Server Problem - Try Again"
23
24rtmpurl=xml.find("ListenLiveInitialize/StreamInfo/stream").attrib['primary_location']
25
26os.system('mplayer -msglevel all=9 \"'+rtmpurl+'\" -novideo -ao pulse -quiet');