Notices


Reply
Thread Tools
Posts: 3 | Thanked: 14 times | Joined on Feb 2011 @ cornwall
#1
Hello everyone, I'm a long time observer but first time poster in this forum.
I've noticed that get_iplayer has made it's way into the app manager so I thought I would share a script I wrote ages ago (and just ported to my N900) that adds zenity dialogs to simply build a get_iplayer command to download or live stream a programme from the BBC iplayer.
What you will need

You have to have a UK IP to access the iplayer (or a good UK proxy)

From the repos
get_iplayer
Zenity
rtmpdump
and sed (but everyone has sed right?)

Then you need my script.

Code:
#!/bin/sh
# Version 0.4 Created 07/MAY/2009
# Last edited on 1/Febuary/2011 # Made to work (Hopefully) with the N900
# Damn You osso-xterm -e
# Written by TIMTTMY
#
# A simple get_iplayer script gui using zenity
# Be sure the /path/to/rtmpdump is correct for your system.
# Also you need zenity and sed installed

# Select your player for watching/listening to live streams.
# I find ffplay works best. xine and vlc don't seem to like the live radio feeds.


#PLAYER='xine stdin:/'
PLAYER='ffplay -'
#PLAYER='vlc -'
#PLAYER='mplayer -cache 1024 -'

#Path to save iplayer files
OUTPUT='--output=/media/mmc1/'

RTMPDUMP='/usr/bin/rtmpdump'
# Check to see if rtmpdump is installed in /usr/bin/

if [ -f "$RTMPDUMP" ];
	then 
	echo "rtmpdump found"
	else zenity --title "rtmpdump not found in /usr/bin/ " --height=200 --width 400 --error --text "rtmpdump not found in /usr/bin/\n\n\ Please install rtmpdump\n\n In /usr/bin/rtmpdump."
	exit
  fi

# Choose a channel
CHANNEL=$(zenity  --list  --height=325 --width=200 --text "Get_iplayer : Select a channel" --radiolist  --column "Pick" --column "Opinion" TRUE "BBC 	tv" FALSE "liveradio" FALSE "livetv" FALSE "radio" FALSE "podcast" FALSE "url" | cut -f 2 | sed 's/ /1/' );
if [ $? = 1 ];
then exit
else
echo "$CHANNEL"
fi

# Stream or store ?
if [ $CHANNEL = url ]
then
echo "Store Mode"
else
STREAM=$(zenity --list --height=175 --width=500 --text "Get_iplayer : Do you want to watch this programme or dump it to disk" --radiolist --column "Pick" --column "Opinion" TRUE "1	'--get'		Save To Disk To Watch Later" FALSE "2	'--stream'	Watch It Now Not Saving To Disk"  | cut -f 1 );
if [ $? = 1 ];
then exit
else
echo "$STREAM"
fi
fi

# Grep for a programme
SEARCH=$(zenity --entry --width=800 --text "Search for a programme or paste a Website URL. leave blank for none." --entry-text "" );
if [ $? = 1 ];
then exit
else
echo "$SEARCH"
fi

if [ $CHANNEL = url ]
then 
GET=$(zenity --entry --width=800 --text "execute?" --entry-text "get_iplayer --force --url=$SEARCH --flvstreamer=/usr/bin/rtmpdump" $OUTPUT ); 
echo "$GET"
exec /usr/bin/osso-xterm -e $GET
exit
else
# Get_iplayer PID
NUM=$(get_iplayer --long --type=$CHANNEL $SEARCH | sed -n '/Added:/!p' | zenity --list --width=1000 --height=800 --title "Fetching feeds, Please wait for list to populate" --column "Files" | sed  "s/ /\n/g" | sed -n '/Added/!p' |  sed "s/:/\n/g" | head -n 1 );
# -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^ put everthing   ^ Don't print lines  ^ put everything  ^             
# -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^ after a space   ^ With Added in them ^ after a : on a  ^
# -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^ on a new line   ^                    ^ new line        ^
if [ $? = 1 ];
then exit
else
echo "$NUM"
fi
fi
# Flvstreamer modes
VMODE=$(zenity  --list  --height=275 --width=1000 --text "Get_iplayer : Extra Options" --radiolist  --column "Pick" --column "Opinion" FALSE "'--mode=flashhd,flashvhigh --flvstreamer="/usr/bin/rtmpdump"'			Use this option for HD flash mode" TRUE "'--mode=flashlow --flvstreamer="/usr/bin/rtmpdump"'			Use this mode for std flash " FALSE "'--mode=flashaacstd --flvstreamer="/usr/bin/rtmpdump"'		Use this option for live radio." FALSE "'--mode=flashstd,flashhigh,flashnormal --flvstreamer="/usr/bin/rtmpdump"'		Use this option for live tv." | cut -f 1 | sed 's/.\(.*\)/\1/' | sed 's/\(.*\)./\1/' );	
if [ $? = 1 ];
then exit
else
echo "$VMODE"
fi

# Build get_iplayer command to run

if [ $STREAM -eq 2 ]
then
GET=$(zenity --entry --width=800 --text "execute?" --entry-text "get_iplayer --stream $NUM --type=livetv,liveradio $VMODE " ); 
echo "$GET"
exec $GET | $PLAYER
else
GET=$(zenity --entry --width=800 --text "execute?" --entry-text "get_iplayer --type=$CHANNEL --get $NUM $VMODE $OUTPUT " ); 
echo "$GET"
osso-xterm -e "$GET"
fi
Save the above as iplayGUI.sh on your device.
Make it executable.
Code:
chmod +x iplayGUI.sh
and run it
Code:
sh iplayGUI.sh
Enjoy! No more long get_iplayer commands to write on your phone.

Hopefully someone can fix it so the cancel buttons actually cancel the programme.
Attached Images
     

Last edited by timttmy; 2011-02-27 at 10:58. Reason: Added screenshots
 

The Following 9 Users Say Thank You to timttmy For This Useful Post:
Posts: 118 | Thanked: 89 times | Joined on Aug 2010
#2
Thanks bud. However, I can't find Zenity in the repos
 
bigears5000's Avatar
Posts: 468 | Thanked: 775 times | Joined on May 2010 @ Hereford, England
#3
Originally Posted by br1zer View Post
Thanks bud. However, I can't find Zenity in the repos
In xterm type

sudo gainroot
apt-get install zenity
 

The Following 4 Users Say Thank You to bigears5000 For This Useful Post:
Posts: 3 | Thanked: 14 times | Joined on Feb 2011 @ cornwall
#4
Yeah do what bigears5000 said

Let me know if you get it working
 

The Following 2 Users Say Thank You to timttmy For This Useful Post:
rob42's Avatar
Posts: 46 | Thanked: 14 times | Joined on Feb 2011 @ Hampshire,UK
#5
Morning
having a problem getting this to run.
already had get_iplayer loaded via ham. installed other parts and saved script to root on n900.
script starts but bet error which hints at a problem with get_iplayer - ( installed by package manager ?).
have removed get_iplayer and tried to install via apt-get but get told package not found.
where am I going wrong? where should get_iplayer be found ?
thanks
 
Banned | Posts: 695 | Thanked: 308 times | Joined on Apr 2011 @ originally pakistan ,now in china
#6
why only for uk people ?ahh ..proxy set up ?
can we hope for any player which can run pptv without flash problem as there is no update comming on flash 10 ?
 
Posts: 345 | Thanked: 117 times | Joined on Jan 2010 @ uk
#7
Got this trying to listen to a radio thing....

pipe:: Unknown format

any ideas?
 

The Following User Says Thank You to kyllerbuzcut For This Useful Post:
rob42's Avatar
Posts: 46 | Thanked: 14 times | Joined on Feb 2011 @ Hampshire,UK
#8
quick update to problem . have got gt-iplayer to load via apt ( get-iplayer ) but still getting an error - get_iplayer is not writtable.
any ideas ?
ta
 
Tiboric's Avatar
Posts: 433 | Thanked: 312 times | Joined on Nov 2009 @ U.K
#9
Originally Posted by rob42 View Post
quick update to problem . have got gt-iplayer to load via apt ( get-iplayer ) but still getting an error - get_iplayer is not writtable.
any ideas ?
ta
Code:
sudo chmod 777 /usr/bin/get_iplayer
and if you get another one when updating iplayer

Code:
sudo cp /usr/bin/get_iplayer /usr/bin/get_iplayer.old
sudo chmod 777 /usr/bin/get_iplayer.old
let me know if that worked....
__________________
Shortcut Maker. A GUI for .desktop shortcuts
SMS Faker. A very simple sms faker
 

The Following 2 Users Say Thank You to Tiboric For This Useful Post:
rob42's Avatar
Posts: 46 | Thanked: 14 times | Joined on Feb 2011 @ Hampshire,UK
#10
ta for speedy reply
gave them ago -
tried sudo chmod 777 /usr/bin/get_iplayer first - got error -
" running the updater again.....
info current version 2.78
info check for latest from www.infrdead.org
error.failed to connect to updatesite - update aborted "

www.infradead.org is now http://www.linux-mtd.infradead.org.

I guess I need to make some changes in get_iplayer ? if so howdo I do this?

ta
 
Reply


 
Forum Jump


All times are GMT. The time now is 09:57.