Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    simple get_iplayer gui

    Reply
    Page 1 of 2 | 1   2   | Next
    timttmy | # 1 | 2011-02-27, 10:35 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks
    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:
    br1zer, Captwheeto, demolition, drangina, ivyking, marxian, noobmonkey, pelago, stevomanu

     
    br1zer | # 2 | 2011-02-27, 19:56 | Report

    Thanks bud. However, I can't find Zenity in the repos

    Edit | Forward | Quote | Quick Reply | Thanks

     
    bigears5000 | # 3 | 2011-02-27, 20:07 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 4 Users Say Thank You to bigears5000 For This Useful Post:
    br1zer, drangina, timttmy, youngcalihottie

     
    timttmy | # 4 | 2011-02-27, 20:39 | Report

    Yeah do what bigears5000 said

    Let me know if you get it working

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to timttmy For This Useful Post:
    br1zer, drangina

     
    rob42 | # 5 | 2011-05-18, 08:40 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    prankster | # 6 | 2011-05-18, 08:59 | Report

    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 ?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    kyllerbuzcut | # 7 | 2011-05-18, 18:54 | Report

    Got this trying to listen to a radio thing....

    pipe:: Unknown format

    any ideas?

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to kyllerbuzcut For This Useful Post:
    stevomanu

     
    rob42 | # 8 | 2011-05-19, 08:45 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Tiboric | # 9 | 2011-05-19, 11:30 | Report

    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....

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to Tiboric For This Useful Post:
    demolition, rob42

     
    rob42 | # 10 | 2011-05-19, 13:02 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 1 of 2 | 1   2   | Next
vBulletin® Version 3.8.8
Normal Logout