2010-04-30, 21:31
OK,here is a patch to support various bit rates with akamai. You'll have to undo the change you have made to the settings files as well.
P.S. Thanks exobuzz for your work getting this working again.
Code:
--- IPlayer-exobuzz-529/lib/iplayer2.py 2010-04-28 14:21:38.000000000 +0100
+++ IPlayer-Active/lib/iplayer2.py 2010-04-30 20:23:18.705671038 +0100
@@ -396,16 +396,16 @@
""" True if this stream is 'signed' for the hard-of-hearing. """
return self.alternate == 'signed'
- @property
- def mediaselector_url(self):
- return "http://www.bbc.co.uk/mediaselector/4/mtis/stream/%s/iplayer_streaming_h264_flv/akamai" % self.identifier
- @property
- def media(self):
+ def mediaselector_url(self,suffix):
+ if suffix == None:
+ return "http://www.bbc.co.uk/mediaselector/4/mtis/stream/%s" % self.identifier
+ return "http://www.bbc.co.uk/mediaselector/4/mtis/stream/%s/%s" % (self.identifier, suffix)
+
+ def medialist(self,suffix = None):
"""
Returns a list of all the media available for this item.
"""
- if self.medias: return self.medias
- url = self.mediaselector_url
+ url = self.mediaselector_url(suffix)
logging.info("Stream XML URL: %s", url)
xml = httpget(url)
tree = ET.XML(xml)
@@ -413,6 +413,18 @@
medias = []
for m in tree.findall('media'):
medias.append(media(self, m))
+ return medias
+
+ @property
+ def media(self):
+ """
+ Returns a list of all the media available for this item.
+ """
+ if self.medias: return self.medias
+ medias = []
+ for m in ['iplayer_streaming_h264_flv_hd/akamai', 'iplayer_streaming_h264_flv_high/akamai', 'iplayer_streaming_h264_flv/akamai', 'iplayer_streaming_h264_flv_lo/akamai', 'iplayer_streaming_h264_flv_vlo/akamai']:
+ medias.extend(self.medialist(m))
+ medias.extend(self.medialist())
self.medias = medias
if medias == None or len(medias) == 0:
P.S. Thanks exobuzz for your work getting this working again.