source: titan/mediathek/localhoster/vidzi.py @ 39367

Last change on this file since 39367 was 39362, checked in by obi, 7 years ago

test fix kino

File size: 858 bytes
Line 
1
2import re
3import urllib
4from lib import jsunpack
5import sys
6from lib.net import Net
7
8class VidziResolver(object):
9    name = "vidzi"
10    domains = ["vidzi.tv"]
11    pattern = '(?://|\.)(vidzi\.tv)/(?:embed-)?([0-9a-zA-Z]+)'
12
13    def __init__(self):
14        self.net = Net()
15        url = str(sys.argv[1])
16        host = self.get_host_and_id(url)[0]
17        media_id = self.get_host_and_id(url)[1]
18
19        return self.get_media_url(host, media_id)
20
21    def get_host_and_id(self, url):
22        r = re.search(self.pattern, url, re.I)
23        if r:
24            return r.groups()
25        else:
26            return False
27
28    def get_media_url(self, host, media_id):
29        return helpers.get_media_url(self.get_url(host, media_id))
30
31    def get_url(self, host, media_id):
32        return 'http://%s/embed-%s.html' % (host, media_id)
33
34sys.stdout = VidziResolver()
Note: See TracBrowser for help on using the repository browser.