Enigma2 plugin to to play various online streams (mostly Latvian).

123456789101112131415161718192021222324252627
  1. # * GNU General Public License for more details.
  2. # *
  3. # * You should have received a copy of the GNU General Public License
  4. # * along with this program; see the file COPYING. If not, write to
  5. # * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  6. # * http://www.gnu.org/copyleft/gpl.html
  7. # *
  8. # */
  9. import re
  10. __name__='eserial'
  11. def supports(url):
  12. return not _regex(url) == None
  13. # returns the steam url
  14. def resolve(url):
  15. m = _regex(url)
  16. if m:
  17. stream = re.search('(?P<url>.+?)(\&|$)',m.group('url')).group('url')
  18. show = re.search('serial=(?P<url>.+?)(\&|$)',m.group('url'))
  19. tit = re.search('srt=(?P<url>.+?)(\&|$)',m.group('url'))
  20. if show and tit:
  21. return [{'url':stream,'subs':'http://www.eserial.cz/titulky/%s/%s.srt' % (show.group('url'),tit.group('url'))}]
  22. return [{'url':stream}]
  23. def _regex(url):
  24. return re.search('eserial\.cz/video\.php\?file=(?P<url>.+?)$',url,re.IGNORECASE | re.DOTALL)