#!/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
chmod +x iplayGUI.sh
sh iplayGUI.sh
| The Following 9 Users Say Thank You to timttmy For This Useful Post: | ||

| The Following 4 Users Say Thank You to bigears5000 For This Useful Post: | ||

| The Following User Says Thank You to kyllerbuzcut For This Useful Post: | ||
sudo chmod 777 /usr/bin/get_iplayer
sudo cp /usr/bin/get_iplayer /usr/bin/get_iplayer.old sudo chmod 777 /usr/bin/get_iplayer.old
| The Following 2 Users Say Thank You to Tiboric For This Useful Post: | ||