[xbmc-addons] r2281 committed - [IPlayer]...

8 views
Skip to first unread message

xbmc-...@googlecode.com

unread,
May 25, 2012, 7:40:31 PM5/25/12
to xbmc-addo...@googlegroups.com
Revision: 2281
Author: bu...@exotica.org.uk
Date: Fri May 25 16:40:08 2012
Log: [IPlayer]
2.4.15
* quick fix-ups for live channels
* properly quote search string - thanks to alastair

2.4.14

* bbc one / bbc two back on akamai
* search code changes
* don't force dvdplayer for live streams

http://code.google.com/p/xbmc-addons/source/detail?r=2281

Modified:
/trunk/plugins/video/IPlayer/addon.xml
/trunk/plugins/video/IPlayer/changelog.txt
/trunk/plugins/video/IPlayer/default.py
/trunk/plugins/video/IPlayer/description.xml
/trunk/plugins/video/IPlayer/lib/iplayer2.py
/trunk/plugins/video/IPlayer/lib/iplayer_search.py
/trunk/plugins/video/IPlayer/lib/live_tv.py

=======================================
--- /trunk/plugins/video/IPlayer/addon.xml Wed Aug 10 06:24:33 2011
+++ /trunk/plugins/video/IPlayer/addon.xml Fri May 25 16:40:08 2012
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.iplayer"
name="iPlayer"
- version="2.4.13"
+ version="2.4.15"
provider-name="BuZz, Dink">
<requires>
<import addon="xbmc.python" version="1.0"/>
=======================================
--- /trunk/plugins/video/IPlayer/changelog.txt Wed Aug 10 06:24:33 2011
+++ /trunk/plugins/video/IPlayer/changelog.txt Fri May 25 16:40:08 2012
@@ -1,5 +1,15 @@
Changes

+2.4.15
+ * quick fix-ups for live channels
+ * properly quote search string - thanks to alastair
+
+2.4.14
+
+ * bbc one / bbc two back on akamai
+ * search code changes
+ * don't force dvdplayer for live streams
+
2.4.13

* bbc one / bbc two back on akamai_hd
=======================================
--- /trunk/plugins/video/IPlayer/default.py Wed Apr 20 18:20:31 2011
+++ /trunk/plugins/video/IPlayer/default.py Fri May 25 16:40:08 2012
@@ -556,24 +556,14 @@

if not searchterm:
searchterm = iplayer_search.prompt_for_search()
- iplayer_search.save_search(SEARCH_FILE, tvradio, searchterm)
-
+ if searchterm != None and len(searchterm) >= 3:
+ iplayer_search.save_search(SEARCH_FILE, tvradio, searchterm)
+ else:
+ return
+
logging.info("searchterm=" + searchterm)
feed = iplayer.feed(tvradio, searchterm=searchterm)

- listitem = xbmcgui.ListItem(label=' Delete this search - ' +
searchterm)
- listitem.setIconImage(get_plugin_thumbnail('search'))
- listitem.setThumbnailImage(get_plugin_thumbnail('search'))
- listitem.setProperty('tracknumber', '0')
-
- url = "%s?deletesearch=%s&tvradio=%s" % (sys.argv[0],
urllib.quote_plus(searchterm), urllib.quote_plus(tvradio))
- ok = xbmcplugin.addDirectoryItem(
- handle=__plugin_handle__,
- url=url,
- listitem=listitem,
- isFolder=False,
- )
-
list_feed_listings(feed, 'list')

def search_delete(tvradio, searchterm):
=======================================
--- /trunk/plugins/video/IPlayer/description.xml Wed Aug 10 06:24:33 2011
+++ /trunk/plugins/video/IPlayer/description.xml Fri May 25 16:40:08 2012
@@ -23,7 +23,7 @@
<title>IPlayer</title>

<!-- (required) Major.minor.build -->
- <version>2.4.13</version>
+ <version>2.4.15</version>

<!-- (required) author name & email. at least one author name is
required -->
<authors>
=======================================
--- /trunk/plugins/video/IPlayer/lib/iplayer2.py Wed Apr 20 18:20:31 2011
+++ /trunk/plugins/video/IPlayer/lib/iplayer2.py Fri May 25 16:40:08 2012
@@ -783,7 +783,7 @@
path = ['search']
if self.tvradio:
path += [self.tvradio]
- path += ['?q=%s' % self.searchterm]
+ path += ['?q=%s' % urllib.quote_plus(self.searchterm)]
elif self.channel:
path = [self.channel]
if self.atoz:
=======================================
--- /trunk/plugins/video/IPlayer/lib/iplayer_search.py Mon Oct 26 13:32:00
2009
+++ /trunk/plugins/video/IPlayer/lib/iplayer_search.py Fri May 25 16:40:08
2012
@@ -2,7 +2,7 @@

# Python libs
import os, string, sys, xbmc
-from sets import Set
+from sets import Set

def load_search(file, tvradio):
# load the list of search terms for the current search type
@@ -54,10 +54,11 @@
def prompt_for_search():
# prompt the user to input search text
kb = xbmc.Keyboard('', 'Search for')
+
kb.doModal()
if not kb.isConfirmed():
- xbmcplugin.endOfDirectory(handle=handle, succeeded=False)
-
- searchterm = kb.getText()
+ return None;
+
+ searchterm = kb.getText().strip()
return searchterm

=======================================
--- /trunk/plugins/video/IPlayer/lib/live_tv.py Wed Aug 10 06:24:33 2011
+++ /trunk/plugins/video/IPlayer/lib/live_tv.py Fri May 25 16:40:08 2012
@@ -15,13 +15,13 @@
live_tv_channels = {
'bbc_one_london' : (1, 'bbc_one_live', 'BBC One', 'bbc_one.png'),
'bbc_two_england': (2, 'bbc_two_live', 'BBC Two', 'bbc_two.png'),
- 'bbc_three' : (3, 'bbc_three_live', 'BBC Three', 'bbc_three.png'),
- 'bbc_four' : (4, 'bbc_four_live', 'BBC Four', 'bbc_four.png'),
- 'cbbc' : (5, 'bbc_three_live', 'CBBC', 'cbbc.png'),
- 'cbeebies' : (6, 'bbc_four_live', 'Cbeebies', 'cbeebies.png'),
+ 'bbc_three' : (3, 'bbc_three', 'BBC Three', 'bbc_three.png'),
+ 'bbc_four' : (4, 'bbc_four', 'BBC Four', 'bbc_four.png'),
+ 'cbbc' : (5, 'bbc_three', 'CBBC', 'cbbc.png'),
+ 'cbeebies' : (6, 'bbc_four', 'Cbeebies', 'cbeebies.png'),
'bbc_news24' : (7, 'journalism_bbc_news_channel', 'BBC
News', 'bbc_news24.png'),
- 'bbc_parliament' : (8, 'bbc_parliament_live', 'BBC
Parliament', 'bbc_parliament.png'),
- 'bbc_alba' : (9, 'bbc_alba_live', 'BBC ALBA', 'bbc_alba.png'),
+ 'bbc_parliament' : (8, 'bbc_parliament', 'BBC
Parliament', 'bbc_parliament.png'),
+ 'bbc_alba' : (9, 'bbc_alba', 'BBC ALBA', 'bbc_alba.png'),
'bbc_redbutton' : (10, 'bbc_redbutton_live', 'BBC Red
Button', 'bbc_one.png')
}

@@ -31,31 +31,46 @@
root = doc.documentElement
return root

-def fetch_stream_info(channel, bitrate, req_provider):
+def fetch_stream_info(channel, req_bitrate, req_provider):
(sort, stream_id, label, thumb) = live_tv_channels[channel]

- if bitrate <= 480: quality = 'iplayer_streaming_h264_flv_lo_live'
- elif bitrate == 800: quality = 'iplayer_streaming_h264_flv_live'
- elif bitrate >= 1500: quality = 'iplayer_streaming_h264_flv_high_live'
+ provider = req_provider;
+
+ if req_bitrate <= 480: quality = 1
+ elif req_bitrate == 800: quality = 2
+ elif req_bitrate >= 1500: quality = 3
+
+ if quality == 1: quality_attr = 'iplayer_streaming_h264_flv_lo_live'
+ elif quality == 2: quality_attr = 'iplayer_streaming_h264_flv_live'
+ elif quality == 3: quality_attr
= 'iplayer_streaming_h264_flv_high_live'

# bbc news 24 uses different service names for the streams
- if channel == "bbc_news24":
- if bitrate <= 480: quality
= 'journalism_uk_stream_h264_flv_lo_live'
- elif bitrate == 800: quality
= 'journalism_uk_stream_h264_flv_med_live'
- elif bitrate >= 1500: quality
= 'journalism_uk_stream_h264_flv_high_live'
-
- if channel == "bbc_parliament" or channel == "bbc_alba":
- quality = 'iplayer_streaming_vp6_flv_lo_live'
+ if channel == 'bbc_news24':
+ if quality == 1: quality_attr
= 'journalism_uk_stream_h264_flv_lo_live'
+ elif quality == 2: quality_attr
= 'journalism_uk_stream_h264_flv_med_live'
+ elif quality == 3: quality_attr
= 'journalism_uk_stream_h264_flv_high_live'
+
+ if stream_id == 'bbc_three' or stream_id == 'bbc_four':
+ if quality == 1: quality_attr
= 'pc_stream_audio_video_simulcast_uk_v_lm_p004'
+ elif quality == 2: quality_attr
= 'pc_stream_audio_video_simulcast_uk_v_lm_p005'
+ elif quality == 3: quality_attr
= 'pc_stream_audio_video_simulcast_uk_v_lm_p006'
+
+ if channel == 'bbc_parliament' or channel == 'bbc_alba':
+ quality_attr = ''
+ provider = ''
+
+ if channel == 'bbc_redbutton':
+ provider = ''

# if user chooses a stream type that doesn't exist for live, switch
to "auto" mode
- if req_provider != "akamai" and req_provider != "limelight":
- req_provider = ""
-
- # bbc one switched to "akamai_hd" instead of "akamai" (29/04/2011 -
beg/05/2011, 10/08/2011 - )
- if ( channel == "bbc_one_london" or channel == channel
== "bbc_two_england" ) and req_provider == "akamai":
- req_provider = "akamai_hd"
-
- surl = 'http://www.bbc.co.uk/mediaselector/4/mtis/stream/%s/%s/%s' %
(stream_id, quality, req_provider)
+ if req_provider != 'akamai' and req_provider != 'limelight':
+ provider = ''
+
+ # bbc one seem to switch between "akamai_hd" and "akamai"
+ #if ( channel == "bbc_one_london" or channel == "bbc_two_england" )
and req_provider == "akamai":
+ # req_provider = "akamai_hd"
+
+ surl = 'http://www.bbc.co.uk/mediaselector/4/mtis/stream/%s/%s/%s' %
(stream_id, quality_attr, provider)
logging.info("getting media information from %s" % surl)
root = parseXML(surl)
mbitrate = 0
@@ -130,7 +145,7 @@
play = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
play.clear()
play.add(url,listitem)
- player = xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER)
+ player = xbmc.Player(xbmc.PLAYER_CORE_AUTO)
player.play(play)
if showDialog: pDialog.close()

Reply all
Reply to author
Forward
0 new messages