Advertisement
lirva

tunein-xbmc

Mar 25th, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. diff --git a/resources/lib/tunein.py b/resources/lib/tunein.py
  2. index d03a1ee..a78cdc1 100644
  3. --- a/resources/lib/tunein.py
  4. +++ b/resources/lib/tunein.py
  5. @@ -26,6 +26,8 @@ import simplejson
  6. import urllib
  7. import urllib2
  8. import subprocess
  9. +import re
  10. +import streamtheworld as streamtheworld
  11.  
  12. import ConfigParser
  13. import xml.dom.minidom as minidom
  14. @@ -653,6 +655,7 @@ class TuneIn:
  15. stream = stream.rsplit()[0]
  16. (filepath, filename) = os.path.split(stream)
  17. (shortname, extension) = os.path.splitext(filename)
  18. +
  19. if (extension == '.pls'):
  20. req = urllib2.Request(stream)
  21. f = urllib2.urlopen(req)
  22. @@ -684,6 +687,15 @@ class TuneIn:
  23. streams.append(subnode.getAttribute('HREF'))
  24. f.close()
  25. done = True
  26. + elif (re.search('streamtheworld.com', filepath)):
  27. + ''' StreamTheWorld Support
  28. + '''
  29. + pattern = re.compile('(.*)callsign\=(.*)$')
  30. + result = pattern.match(filename)
  31. + if (result):
  32. + stw = streamtheworld.StreamTheWorld(result.group(2))
  33. + stw_url = stw.get_stream_url(result.group(2))
  34. + streams.append(stw_url)
  35. else:
  36. streams.append(stream)
  37. return streams
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement