Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/resources/lib/tunein.py b/resources/lib/tunein.py
- index d03a1ee..a78cdc1 100644
- --- a/resources/lib/tunein.py
- +++ b/resources/lib/tunein.py
- @@ -26,6 +26,8 @@ import simplejson
- import urllib
- import urllib2
- import subprocess
- +import re
- +import streamtheworld as streamtheworld
- import ConfigParser
- import xml.dom.minidom as minidom
- @@ -653,6 +655,7 @@ class TuneIn:
- stream = stream.rsplit()[0]
- (filepath, filename) = os.path.split(stream)
- (shortname, extension) = os.path.splitext(filename)
- +
- if (extension == '.pls'):
- req = urllib2.Request(stream)
- f = urllib2.urlopen(req)
- @@ -684,6 +687,15 @@ class TuneIn:
- streams.append(subnode.getAttribute('HREF'))
- f.close()
- done = True
- + elif (re.search('streamtheworld.com', filepath)):
- + ''' StreamTheWorld Support
- + '''
- + pattern = re.compile('(.*)callsign\=(.*)$')
- + result = pattern.match(filename)
- + if (result):
- + stw = streamtheworld.StreamTheWorld(result.group(2))
- + stw_url = stw.get_stream_url(result.group(2))
- + streams.append(stw_url)
- else:
- streams.append(stream)
- return streams
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement