Code:
- JK Says:
Here is a one-liner bash function that will allow you to stream any iheartradio station by typing:
iheartradio
function iheartradio { mplayer -quiet $(wget -O – -q “http://p2.$1.ccomrcdn.com/player/player_dispatcher.html?section=radio&action=listen_live” | sed -n “s|.*primary_location=\”\(rtmp://[^\"]*\)\”.*|\1|p”) -novideo >& /dev/null; }
Hello, i hope i'm posting in the right section. For some reason i can't really understand scripting language. Could anyone please make this work for me?
I'll try to explain what i'm doing here.
There's this flash radio site, and i want to access it from the terminal through a simple command.
The rtmp:// stream changes every hour or something like that. This stream can always be found into this xml page http://p2.wrzx-fm.ccomrcdn.com/player/player_dispatcher.html?section=radio&action=listen _live
Code:
<stream id="909" primary_location="rtmp://cp21575.live.edgefcs.net/live/Ind_IN_WRZX-FM_OR@s7701?auth=daEbvahaVbMbyczbEd2bCdRcIbtd9dQaScm-bot39e-4q-ML4V7_9opFFom4GBvmytAq&aifp=1234&CHANNELID=909&CPROG=_&MARKET=INDIANAPOLIS-IN&REQUESTOR=WRZX-FM&SERVER_NAME=p2.wrzx-fm.ccomrcdn.com&SITE_ID=2005&STATION_ID=WRZX-FM&MNM=2&TYPEOFPLAY=0" backup_location=""/>
the command that plays fine the radio in the terminal is: mplayer "rtmp://url" -novideo
so if it updates, i have to open the xml page again and again and copy the rtmp link to play.
aparently this guy figured out this script that should grab the rtmp url and run it in mplayer through a single command, but i'm an idiot and have no knowledge why it's not working
what i do know is that i need to put #!/bin/bash line at the beginning of my script and that i need to make it executable in order to actually run it, but it's not working
here's my script:
(i have replaced his $1 from the script line with wrzx-fm because that's the radio's name btw)
Code:
tzily@PC:~/Desktop$ chmod u+x iheartradio.sh
tzily@PC:~/Desktop$
ok, and now to run the thing:
Code:
tzily@PC:~/Desktop$ iheartradio
iheartradio: command not found
tzily@PC:~/Desktop$ iheartradio.sh
iheartradio.sh: command not found
tzily@PC:~/Desktop$ ./iheartradio.sh
tzily@PC:~/Desktop$ /.iheartradio.sh
bash: /.iheartradio.sh: No such file or directory
tzily@PC:~/Desktop$ .iheartradio.sh
.iheartradio.sh: command not found
tzily@PC:~/Desktop$ '/home/tzily/Desktop/iheartradio.sh'
tzily@PC:~/Desktop$ sudo iheartradio.sh
[sudo] password for tzily:
sudo: iheartradio.sh: command not found
tzily@PC:~/Desktop$
I'm trying hard to run it, but i assume the script needs something...
this might look pathetic for some experienced fellows around here, but i'm new to this and if i don't get it right, i can't sleep tonight please someone correct and test this for me. Please...
Bookmarks