Kodi Community Forum
[RELEASE] iPlayer - BBC Video and Music Plugin (UK only!) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154)
+---- Thread: [RELEASE] iPlayer - BBC Video and Music Plugin (UK only!) (/showthread.php?tid=51322)



Stream selecting menu - jackanddougal - 2010-09-01

Hi

Please apply this patch to the IPlayer addon which allows the user to select the stream quality at playback time. It simply adds 4 'Play H.264 (XXXkb)' options to the context menu.

Cheers

Daniel

diff -ru plugin.video.iplayer.base/default.py plugin.video.iplayer/default.py
--- plugin.video.iplayer.base/default.py 2010-09-01 21:03:26.896706727 +0100
+++ plugin.video.iplayer/default.py 2010-09-01 21:25:19.756706868 +0100
@@ -146,13 +146,14 @@
label = args.get('label', [None])[0]
deletesearch = args.get('deletesearch', [None])[0]
radio = args.get('radio', [None])[0]
+ pref = args.get('pref', [None])[0]

feed = None
if feed_channel:
feed = iplayer.feed('auto', channel=feed_channel, atoz=feed_atoz, radio=radio)
elif feed_atoz:
feed = iplayer.feed(tvradio or 'auto', atoz=feed_atoz, radio=radio)
- return (feed, listing, pid, tvradio, category, series, url, label, deletesearch, radio)
+ return (feed, listing, pid, tvradio, category, series, url, label, deletesearch, radio, pref)

def list_feeds(feeds, tvradio='tv', radio=None):
xbmcplugin.addSortMethod(handle=PLUGIN_HANDLE, sortMethod=xbmcplugin.SORT_METHOD_TRACKNUM )
@@ -397,6 +398,21 @@
iconImage='defaultVideo.png',
thumbnailImage=thumbnail)

+ menuitems = []
+ cmd = "XBMC.RunPlugin(%s?&pid=%s&pref=%s)" % (sys.argv[0], urllib.quote_plus(programme.pid), urllib.quote_plus('h264 480'))
+ menuitems.append( ('Play H.264 (480kb)', cmd) )
+
+ cmd = "XBMC.RunPlugin(%s?&pid=%s&pref=%s)" % (sys.argv[0], urllib.quote_plus(programme.pid), urllib.quote_plus('h264 800'))
+ menuitems.append( ('Play H.264 (800kb)', cmd) )
+
+ cmd = "XBMC.RunPlugin(%s?&pid=%s&pref=%s)" % (sys.argv[0], urllib.quote_plus(programme.pid), urllib.quote_plus('h264 1500'))
+ menuitems.append( ('Play H.264 (1500kb)', cmd) )
+
+ cmd = "XBMC.RunPlugin(%s?&pid=%s&pref=%s)" % (sys.argv[0], urllib.quote_plus(programme.pid), urllib.quote_plus('h264 3200'))
+ menuitems.append( ('Play H.264 (3200kb)', cmd) )
+
+ listitem.addContextMenuItems( menuitems )
+
datestr = programme.updated[:10]
date=datestr[8:10] + '/' + datestr[5:7] + '/' +datestr[:4]#date ==dd/mm/yyyy

@@ -781,7 +797,7 @@
fw.close()
return outfile

-def watch(feed, pid, showDialog):
+def watch(feed, pid, pref, showDialog):

times = []
times.append(['start',time.clock()])
@@ -838,7 +854,8 @@
pDialog.update(50, 'Fetching video stream info')
if pDialog.iscanceled(): raise
times.append(['update dialog',time.clock()])
- pref = get_setting_videostream(channel)
+ if pref == None:
+ pref = get_setting_videostream(channel)
times.append(['get_setting_videostream',time.clock()])
opref = pref
if showDialog:
@@ -1100,8 +1117,8 @@
if addoncompat.get_setting('progcount') == 'false': progcount = False

# get current state parameters
- (feed, listing, pid, tvradio, category, series, url, label, deletesearch, radio) = read_url()
- logging.info( (feed, listing, pid, tvradio, category, series, url, label, deletesearch, radio) )
+ (feed, listing, pid, tvradio, category, series, url, label, deletesearch, radio, pref) = read_url()
+ logging.info( (feed, listing, pid, tvradio, category, series, url, label, deletesearch, radio, pref) )

# update feed category
if feed and category:
@@ -1111,7 +1128,7 @@
if pid:
showDialog = addoncompat.get_setting('displaydialog') == 'true'
if not label:
- watch(feed, pid, showDialog)
+ watch(feed, pid, pref, showDialog)
else:
pref = get_setting_videostream(label)
bitrate = pref.split(' ')[1]


- bosel - 2010-09-02

@jackanddougal,

I think providing your patch here http://code.google.com/p/xbmc-iplayerv2/issues/list would probably get it included.

And as long as you're in a patching mood, would you mind helping me out with getting an external (bash) script to run whenever the plugin starts video playback (and another one when it stops)? I've been trying various ways of getting it to work, but i've basically given up (being useless at python doesn't help)

anyway, thanks for the patch


TV with IPlayer addon has no sound - raybooysen - 2010-09-04

Hey everyone

I'm using Dharma beta 1 with the IPlayer plugin on my Mac Mini. My mac has an HDMI output to my Onkyo for video and sound.

When using the iplayer addon, radio works perfectly but streaming any video I lose the audio.

Any ideas?

http://code.google.com/p/xbmc-iplayerv2/


- Smiff - 2010-09-05

hmm iplayer doesnt seem to be working for me (timeout errors, "please check network access to iplayer by playin..") today but the interesting part is that it doesn't work for me in web browsers on my desktop pc either ("this content doesn't seem to be working.")! hrmm. also, anyone noticed that "new iplayer coming soon" banner? could be lots of breakage coming - i hope not?

anyone else got iplayer problems currently?

edit2: fine now, yep it was a server side problem on Sunday!

http://www.bbc.co.uk/blogs/bbcinternet/2010/09/bbc_iplayer_gets_even_better.html


- mal_k100 - 2010-09-05

If you want a workaround, use Executor to run a browser with a parameter od http://www.bbc.co.uk/iplayer.
It works (sort of) excet that there is a problem with Executor not switching to the external applications screen (in Windows 7). But using the windows ALT-TAB get around it.
SOmetimes my Executor comes back with a black screen though. Worth a try anyway.


- scope - 2010-09-05

iplayer seems to play video well in Dharma, however I have no sound.. Any idea how I find the cause of this?


- tinybilbo - 2010-09-07

Can anyone get the live stream of News24 to work?
I keep getting an invalid URL...


- XBMCG33K - 2010-09-07

I'm really sorry if this has been asked before, so please excuse me for being lazy and not searching all 98 pages but can this be somehow used if I'm in the US?


- procrastinator - 2010-09-07

XBMCG33K Wrote:can this be somehow used if I'm in the US?

VERY common question!! It can be done, but you'd have to use it in the same way you would access the BBC iPlayer website from the US; i.e. Use a UK proxy


- tinybilbo - 2010-09-07

XBMCG33K Wrote:I'm really sorry if this has been asked before, so please excuse me for being lazy and not searching all 98 pages but can this be somehow used if I'm in the US?

The short answer is yes you can use this in the US (or anywhere for that matter).I live in the Indian Ocean and use it.

However using the free networks or proxies, I could never get the streaming to work well enough to watch. So instead I used the Tor network to download the iplayer programmes/episodes, I would then strip them of the drm, and use my xbox to watch them. It's was a bit of a chore, but workable.

Since retiring my xbox and getting a revo, and installing xbmc-live on it (and setting up a VPN), I signed up to a VPN (55$/yr) to the UK, and I've managed flawless streaming, with both the iPlayer + ItvPlayer scripts.
I'm just waiting for the TvCatchup script to be converted to an add-on,
When that's fixed - I'll have the more or less total on-demand and live streaming UK TV!!


- danz0l - 2010-09-07

tinybilbo can you disable that VPN and watch US streams ? So kind of toggle on and off so to speak ?

If so can i ask you how you managed all this ? I live in the UK and would do the opposite to you i guess to get hulu etc working.

I run linux xbmclive too .


- tinybilbo - 2010-09-08

danz0l Wrote:tinybilbo can you disable that VPN and watch US streams ? So kind of toggle on and off so to speak ?

If so can i ask you how you managed all this ? I live in the UK and would do the opposite to you i guess to get hulu etc working.

I run linux xbmclive too .

Well, I'm kinda new to linux (had my revo about 10 days now),
So I just toggle the VPN via a console at the moment, ("ctl-alt-f1" and type "pon VPN" or "poff VPN" accordingly).
I might make it permanent at boot (when i work out how), since I don't live in the UK and really just want a permanent connection.
Not helpful to your situation I'm afraid Sad
I was going to check out the "launcher" script/add-on to see what that does exactly (I know it can launch things like firefox - so it might be able to run a simple script/batch-file).
Other than that, something really needs to knocked up in python, (of which I know nothing..) that could toggle the VPN on or off - I know Boxee has a script that toggles the VPN according to the site being visited (US for hulu, UK for iPlayer. etc).
Sorry I could'nt be more helpful..


- danz0l - 2010-09-08

Thanks thats helpful. Did you follow a guide on setting up VPN on linux and if so which ? Sorry to ask but i'm new to linux also and would love HULU and a few other American broadcasts for the wife to complete the experience.

Which provider did you sign up with ?


- tinybilbo - 2010-09-08

danz0l Wrote:Thanks thats helpful. Did you follow a guide on setting up VPN on linux and if so which ? Sorry to ask but i'm new to linux also and would love HULU and a few other American broadcasts for the wife to complete the experience.

Which provider did you sign up with ?

I signed up with StrongVPN, they have a "Yearly Special" package @ $55 (about 35quid), which gives you a choice of UK or US VPN.

http://strongvpn.com/packages_special.shtml

I chose the Euro-America PPTP special, but you would probably want the 3-City PPTP special, which would give you UK, SanFran, and NY - It's the same price.

I chose them, not because they were the cheapest - I did find cheaper (but not much), but because of reasonable online reviews, as well a decent help forum, which I knew I was going to need.

As for setting up the VPN on xbmc-live, I was in the dark, at first I tried StrongVPN's tut for setting up a L2TP VPN, and got nowhere fast.
After much hairpulling, it turned out that there might have been a problem with the installed version of OpenSwan (which was needed by the VPN).
So I switched to installing a PPTP client (since I had this working under windows), and I followed this guide;

https://wiki.ubuntu.com/VPN

you need the bit entitled "VPN Setup using the Command line".

However, I could only connect to the VPN, but could not route any traffic through it.
I chatted with StrongVPN's helpline, and the guy immeadiately sussed my problem (which made me happy I chose them...).

1) Basically follow the guide but add to the peers file;
/etc/ppp/peers/YOUR_COMPANY
these commands.

defaultroute
replacedefaultroute

2) Based on the guide, do NOT create the file;
/etc/ppp/ip-up.d/add-subnet
It's not needed because of the added commands

S o to recap, this is what you need to do (including the added commands)

VPN Setup using the cCommand line

Run the following:

sudo apt-get install pptp-linux

Create file /etc/ppp/peers/YOUR_COMPANY with this content:

pty "pptp YOUR_VPN_GATEWAY --nolaunchpppd"
debug
nodetach
logfd 2
noproxyarp
ipparam YOUR_COMPANY
remotename YOUR_COMPANY
name YOUR_DOMAIN_OR_SERVER_NAME\\YOUR_VPN_LOGIN
require-mppe-128
nobsdcomp
nodeflate
lock
noauth
refuse-eap
refuse-chap
refuse-mschap
defaultroute
replacedefaultroute

Add to /etc/ppp/chap-secrets:

YOUR_DOMAIN_OR_SERVER_NAME\\YOUR_VPN_LOGIN * YOUR_VPN_PASSWORD *

- Connect to VPN: sudo pon YOUR_COMPANY To disconnect, press Ctrl+C or close the terminal.

- If you do not want to see VPN connection debug output, in file /etc/ppp/peers/YOUR_COMPANY delete 3 lines: debug nodetach logfd 2

In this case, “pon YOUR_COMPANY” will run as a background process. Use “poff YOUR_COMPANY” to disconnect.


Hope this helps Smile


- danz0l - 2010-09-08

wow excellent and far more than i expected. Many thanks and will certainly look into this a bit deeper. Thanks so much Smile