コード例 #1
0
ファイル: videostar.py プロジェクト: pszemus/filmkodi
def login():
    #f getVideostarCredentialsInfo() == False:
    #    raise Exception()
    params = {}
    #control.set_setting('videostar.sess', '')
    params['login'] = control.get_setting('videostar.user')
    params['password'] = control.get_setting('videostar.pass')
    params['permanent'] = 1
    url = 'https://api-pilot.wp.pl/user/login'
    result = client.request(url, post=params, headers=headers, output='cookie')
    control.log('ResultC videostar.get %s' % result)
    if result == '':
        control.infoDialog('Unauthorized')
        return None

    control.set_setting('videostar.sess', result)
    control.sleep(500)
    url = 'https://api-pilot.wp.pl/invitations/limit'
    headers['cookie'] = result
    result2 = client.request(url, headers=headers)
    if 'error' in result2:
        result2 = json.loads(result2)
        control.log('EEEEEEEEEEEE Result videostar.get %s' %
                    result2['errors'][0]['msg'])
        control.infoDialog(result2['errors'][0]['msg'].encode('utf-8'))

    control.sleep(500)
    return result
コード例 #2
0
ファイル: yoy.py プロジェクト: rrosajp/filmkodi
def getstream(id):
    try:

        if yoylogin():
            cookie = control.get_setting('yoytv.sess').strip()
            control.log('#####   cookie2: %s' % cookie)
            url = 'http://yoy.tv/channels/%s' % id
            result = client.request(url, cookie=cookie)

            if 'http://yoy.tv/accept/' in result:
                if 'true' == control.get_setting('xxxmode'):
                    control.log('EROTYK ')
                    u1 = client.parseDOM(result, 'form', ret='action')[0]
                    params = {}
                    params['_token'] = client.parseDOM(result, 'input', ret='value', attrs={'name': '_token'})[0]
                    control.log('params: %s' % params['_token'])
                    result = client.request(u1, data=params, cookie=cookie)
                else:
                    control.infoDialog(control.lang(30799).encode('utf-8') + ' ' +control.lang(30798).encode('utf-8'))
                    return None

            if '<title>Kup konto premium w portalu yoy.tv</title>' in result:
                control.infoDialog(control.lang(30485).encode('utf-8'))
                return None
            result1 = result
            try:
                myobj = client.parseDOM(result1, 'object', ret='data', attrs={'type': 'application/x-shockwave-flash'})[0].encode('utf-8')
                result = client.parseDOM(result1, 'param', ret='value', attrs={'name': 'FlashVars'})[0].encode('utf-8')
                control.log("YOY res: %s |%s| "  % (result,myobj))

                p = urlparse.parse_qs(result)
                #control.log('# %s' % query)
                control.log('# %s' % p)
                control.log('# %s' % p['fms'])
                control.log('# %s' % p['cid'])

                myurl = p['fms'][0] + '/' + p['cid'][0] + ' swfUrl=' + myobj + ' swfVfy=true tcUrl=' + p['fms'][
                    0] + '/_definst_ live=true timeout=15 pageUrl=' + url
                myurl = p['fms'][0] + '/' + p['cid'][0] + ' swfUrl=' + myobj + ' swfVfy=true live=true timeout=15 pageUrl=' + url

                #        ' swfVfy=true tcUrl=' + 'rtmp://'+myip+'/oyo/_definst_ live=true pageUrl=' + url
                control.log("########## TAB:%s" % myurl)
                return myurl

                #myurl = myurl.replace('oyo','yoy')
            except:
                pass
            result = re.compile('type: "application/x-mpegurl", src: "([^"]+)"').findall(result1)
            control.log("########## TAB:%s" % result)
            myurl = result[0]



            return myurl
        else:
            return None

    except Exception as e:
        control.log('Error yoy.getstream %s' % e)
        return None
コード例 #3
0
ファイル: yoy.py プロジェクト: undg/filmkodi
def getchanels():
    try:
        if getYoyCredentialsInfo() == False:
            if control.yesnoDialog(
                    control.lang(40004).encode('utf-8'),
                    control.lang(30481).encode('utf-8'), '', 'YOY',
                    control.lang(30483).encode('utf-8'),
                    control.lang(30482).encode('utf-8')):
                control.openSettings('1.21')
            raise Exception()
        #login()
        items = []
        for j in range(1, 10):
            try:
                url = 'http://yoy.tv/channels?live=1&country=140&page=%s' % j
                result = client.request(url)
                result = client.parseDOM(result,
                                         'a',
                                         attrs={'class': 'thumb-info team'})
                result = [(client.parseDOM(i, 'img', ret='src')[0],
                           client.parseDOM(i, 'img', ret='alt')[0])
                          for i in result]
                for i in result:
                    item = {}
                    item['id'] = i[0].replace('http://yoy.tv/channel/covers/',
                                              '').replace('.jpg?cache=32', '')
                    control.log('YOY channel %s' % item['id'])
                    item['id'] = item['id'].encode('utf-8')
                    item['title'] = control.trans(i[1].upper().encode('utf-8'))
                    items.append(item)
            except:
                control.log('YOY url: %s' % url)
                pass

        if 'true' == control.get_setting('xxxmode'):
            url = 'http://yoy.tv/channels?category=erotyka'
            result = client.request(url)
            result = client.parseDOM(result,
                                     'a',
                                     attrs={'class': 'thumb-info team'})
            result = [(client.parseDOM(i, 'img', ret='src')[0],
                       client.parseDOM(i, 'img', ret='alt')[0])
                      for i in result]
            for i in result:
                control.log('XXX: %s' % i[0])
                item = {}
                item['id'] = i[0].replace('http://yoy.tv/channel/covers/',
                                          '').replace('.jpg?cache=32', '')
                control.log('XXX Alina %s' % item['id'])
                item['id'] = item['id'].encode('utf-8')
                item['title'] = 'XXX ' + control.trans(
                    i[1].upper().encode('utf-8'))
                items.append(item)

        return items
    except Exception as e:
        control.log('Error yoy.getchanels %s' % e)
コード例 #4
0
ファイル: telewizjadanet.py プロジェクト: mrknow/filmkodi
def getstream(id):
    try:

        if login() == False:
            control.log('Błędny login')
            raise ValueError('Błędny login')

        ua = control.get_setting('telewizjada.ua')
        myheaders = {'User-Agent':ua}
        token = control.get_setting('telewizjada.token')

        mainurl = 'http://www.telewizjada.net/live.php?cid=%s' % id
        myheaders['referer']=mainurl
        sidcookie = client.request(mainurl, headers=myheaders, output='cookie')
        #control.log('SidCookie: %s' % (sidcookie))

        url='http://www.statsgather.com/activatehls/getstats.php'
        hlsresult = client.request(url, post='', headers=myheaders, cookie='hls_stats=%s' % token)
        control.log('GetSTAT Result: %s' % hlsresult)
        mastercookie = '%s;%s;%s;%s ' % (sidcookie, 'hlsplugin=%s' % token, 'cb-enabled=accepted', 'cookieView=all' )
        #control.log('MASTERCOOKIE ' + mastercookie)


        url = 'http://www.telewizjada.net/net/service/verifydevice.php'
        params = json.dumps({'action':'new', 'key':hlsresult})
        jsonmyheaders = myheaders
        jsonmyheaders['Content-Type'] = 'application/json'
        jsonmyheaders['cookie'] = mastercookie
        #result = client.request(url, post=params, headers=jsonmyheaders)
        result, h1, content, cookie10 = client.request(url, post=params, headers=jsonmyheaders,output='extended')
        refreshcookie = '%s;%s;%s;%s ' % (sidcookie, '%s' % content['Set-Cookie'].split(';')[0], 'cb-enabled=accepted', 'cookieView=all' )
        #control.log('AccessCookie: %s|%s' % (result,content['Set-Cookie']))
        control.set_setting('telewizjada.refreshcookie', refreshcookie)
        control.set_setting('telewizjada.referer',mainurl)

        result = json.loads(result)

        if result['status'] == 'Active':
            #time.sleep(1)
            control.set_setting('telewizjada.expire', result['expire'])
            expirewhen  = datetime.datetime.now() + datetime.timedelta(seconds=refreshtime)
            control.set_setting('telewizjada.tokenExpireIn', str(int(time.mktime(expirewhen.timetuple()))))

            url = 'http://www.telewizjada.net/get_channel_data.php'
            myheaders1 = {'cookie': mastercookie, 'User-Agent':ua, 'referer': mainurl}
            params = {'cid':str(id)}
            result = client.request(url, post=params, headers=myheaders1)
            result = json.loads(result)
            vidlink = '%s|Cookie=%s' % (result['channelurl'], sidcookie)
            control.log('TELEWIZJADA VID %s' % vidlink)
            return vidlink

        return None

    except Exception as e:
        control.log('Error telewizjada.net .getstream %s' % e )
コード例 #5
0
def get(url, proxy=''):
    try:
        pl_proxy = control.setting('pl_proxy')
        pl_proxy_port = control.setting('pl_proxy_port')

        if getVideostarCredentialsInfo() == False:
            if control.yesnoDialog(
                    control.lang(40001).encode('utf-8'),
                    control.lang(30481).encode('utf-8'), '', 'Trakt',
                    control.lang(30483).encode('utf-8'),
                    control.lang(30482).encode('utf-8')):
                control.openSettings('1.11')
            raise Exception()

        url = urlparse.urljoin('https://api.videostar.pl', url)
        if proxy == '':
            result = client.request(
                url,
                headers=headers,
                cookie=control.get_setting('videostar.sess'))
        else:
            myproxy = pl_proxy
            if pl_proxy_port != '': myproxy = myproxy + ':' + pl_proxy_port

            myproxy_check = is_bad_proxy(myproxy)
            if not myproxy_check == '':
                control.dialog.ok(
                    control.addonInfo('name'),
                    control.lang(40013).encode('utf-8') + ' ' +
                    myproxy_check.encode('utf-8'), '')
                control.openSettings('0.11')
                return None

            result = client.request(
                url,
                headers=headers,
                cookie=control.get_setting('videostar.sess'),
                proxy=myproxy)
        r = json.loads(result)

        if r['status'] == "error" or result == None:
            if r['errors'][0]['code'] == 1:
                login()
                control.sleep(500)
                mycookie = control.get_setting('videostar.sess')
                result = client.source(
                    url,
                    headers=headers,
                    cookie=control.get_setting('videostar.sess'))

        return result
    except Exception as e:
        control.log('Error videostar.get %s' % e)
        pass
コード例 #6
0
ファイル: wizja.py プロジェクト: Tw3ak/filmkodi
def getstream(id):
    try:

        if wizjalogin():
            cookie = control.setting('wizja.token').strip()
            ref = 'http://wizja.tv/watch.php?id=%s' % id
            result = client.request(ref, headers=HOST, cookie=cookie)
            HOST['Referer'] = ref
            url = 'http://wizja.tv/porter.php?ch=%s' % id
            result = client.request(url, headers=HOST, cookie=cookie)
            mylink = re.compile('src: "(.*?)"').findall(result)
            mykill = re.compile('<a href="killme.php\?id=(.*?)" target="_top">'
                                ).findall(result)
            control.log('AMA %s|%s' % (mylink, mykill))
            if len(mylink) > 0:
                rtmp2 = urllib.unquote(mylink[0]).decode('utf8')
                rtmp1 = re.compile(
                    'rtmp://(.*?)/(.*?)/(.*?)\?(.*?)\&streamType').findall(
                        rtmp2)
                control.log('AMA1 %s' % (rtmp1))
                control.log('AMA2 %s' % (rtmp2))

                rtmp = 'rtmp://' + rtmp1[0][0] + '/' + rtmp1[0][
                    1] + '/' + rtmp1[0][2] + '?' + rtmp1[0][
                        3] + ' app=' + rtmp1[0][1] + '?' + rtmp1[0][
                            3] + ' swfVfy=1 flashver=WIN\\2020,0,0,306 timeout=25 swfUrl=http://wizja.tv/player/StrobeMediaPlayback.swf live=true pageUrl=' + ref
                control.log('AMA3 %s' % (rtmp))

                return rtmp
            #kill other sessions
            elif len(mykill) > 0:
                control.log('Error KILL %s' % mykill)
                urlkill = 'http://wizja.tv/killme.php?id=%s' % mykill[0]
                result = client.request(urlkill, headers=HOST, cookie=cookie)
                control.sleep(300)
                url = 'http://wizja.tv/porter.php?ch=%s' % id
                result = client.request(url, headers=HOST, cookie=cookie)
                mylink = re.compile('src: "(.*?)"').findall(result)
                if len(mylink) > 0:
                    rtmp2 = urllib.unquote(mylink[0]).decode('utf8')
                    rtmp1 = re.compile(
                        'rtmp://(.*?)/(.*?)/(.*?)\?(.*?)\&streamType').findall(
                            rtmp2)
                    rtmp = 'rtmp://' + rtmp1[0][0] + '/' + rtmp1[0][
                        1] + '/' + rtmp1[0][2] + '?' + rtmp1[0][
                            3] + ' app=' + rtmp1[0][1] + '?' + rtmp1[0][
                                3] + ' swfVfy=1 flashver=WIN\\2020,0,0,306 timeout=25 swfUrl=http://wizja.tv/player/StrobeMediaPlayback.swf live=true pageUrl=' + ref
                    return rtmp
            else:
                raise Exception('WWW: ' + result)
        else:
            return
    except Exception as e:
        control.log('Error wizja.getstream %s' % e)
コード例 #7
0
ファイル: yoy.py プロジェクト: undg/filmkodi
def yoylogin():
    if getYoyCredentialsInfo() == False:
        raise ValueError('Brak ustawienia logiun lub hasła ')
    try:

        params = {}
        url = 'http://yoy.tv/signin'
        result, headers, content, cookie = client.request(url,
                                                          output='extended')

        params['remember_me'] = '1'
        params['email'] = control.get_setting('yoytv.user')
        params['password'] = control.get_setting('yoytv.pass')
        params['_token'] = client.parseDOM(result,
                                           'input',
                                           ret='value',
                                           attrs={'name': '_token'})[0]
        result1, headers, content, cookie = client.request(url,
                                                           post=params,
                                                           cookie=cookie,
                                                           output='extended',
                                                           redirect=False)
        mycookies = re.findall('Set-Cookie: (.*?);', '%s' % content)
        cookie = ";".join(mycookies)
        control.set_setting('yoytv.sess', cookie)
        control.log('#####   cookie1: %s' % cookie)
        url = 'http://yoy.tv/'
        result = client.request(url, cookie=cookie)

        if not 'http://yoy.tv/signout' in result:
            control.log('BBBBB LOGIN %s' % 'yoy.tv')
            control.infoDialog(control.lang(30484).encode('utf-8'))
            control.dialog.ok(
                control.addonInfo('name') + ' - YOY TV',
                control.lang(30484).encode('utf-8'), '')
            control.openSettings('1.12')
            return False
        else:
            url = 'http://yoy.tv/user/settings'
            result = client.request(url, cookie=cookie)
            premium = re.findall('Aktywne do: ([0-9 :-]+)', result)
            if len(premium) > 0:
                control.log('CCCCC LOGIN %s' % premium)
                control.infoDialog(
                    control.lang(30496) + premium[0].encode('utf-8'))

            return True

    except Exception as e:
        control.log('Yoylogin ERROR %s' % e)
        return False
コード例 #8
0
ファイル: videostar.py プロジェクト: pszemus/filmkodi
def get(url, proxy='', retry=True):
    try:
        pl_proxy = control.setting('pl_proxy')
        pl_proxy_port = control.setting('pl_proxy_port')

        if getVideostarCredentialsInfo() == False:
            control.infoDialog('Enter credentials')
            if control.yesnoDialog(
                    control.lang(40001).encode('utf-8'),
                    control.lang(30481).encode('utf-8'), '', 'Trakt',
                    control.lang(30483).encode('utf-8'),
                    control.lang(30482).encode('utf-8')):
                control.openSettings('1.11')
            return None

        full_url = urlparse.urljoin('https://api-pilot.wp.pl', url)
        if proxy == '':
            result = client.request(
                full_url,
                headers=headers,
                cookie=control.get_setting('videostar.sess'))
        else:
            myproxy = pl_proxy
            if pl_proxy_port != '': myproxy = myproxy + ':' + pl_proxy_port

            myproxy_check = is_bad_proxy(myproxy)
            if not myproxy_check == '':
                control.dialog.ok(
                    control.addonInfo('name'),
                    control.lang(40013).encode('utf-8') + ' ' +
                    myproxy_check.encode('utf-8'), '')
                control.openSettings('0.11')
                return None

            result = client.request(
                full_url,
                headers=headers,
                cookie=control.get_setting('videostar.sess'),
                proxy=myproxy)

        r = json.loads(result)

        if (r['status'] == "error" or result == None) and retry:
            login()
            result = get(url, proxy, False)

        return result
    except Exception as e:
        control.log('Error videostar.get %s' % e)
        pass
コード例 #9
0
ファイル: wizja.py プロジェクト: mrknow/filmkodi
def wizjalogin():
    try:
        params = {}
        url = 'http://wizja.tv/users/index.php'
        #result, headers, content, cookie = client.request(url, output='extended')

        params['login']='******'
        params['user_name'] = control.get_setting('wizja.user')
        params['user_password'] = control.get_setting('wizja.pass')

        #login to site
        result, headers, content, cookie = client.request(url, post=params, headers=HOST, output='extended')
        control.set_setting('wizja.token', cookie)

        #wrong login
        if  '<font color="#FF0000">Błędne hasło..</font>' in result: #zly login
            control.log('WIZJA.TV ZLY LOGIN: %s' % result)
            control.infoDialog(control.lang(30497).encode('utf-8'),time=6000)
            control.dialog.ok(control.addonInfo('name') + ' - WIZJA TV',control.lang(30497).encode('utf-8'), '')
            raise Exception()
        elif  'lub hasło.</font>' in result: #zly login
            control.log('WIZJA.TV ZLY LOGIN: %s' % result)
            control.infoDialog(control.lang(30486).encode('utf-8'),time=6000)
            control.dialog.ok(control.addonInfo('name') + ' - WIZJA TV',control.lang(30486).encode('utf-8'), '')

            raise Exception()

        elif 'Zalogowany jako :' in result:
            #no premium
            if '<font color=ff0000>Brak premium' in result:
                control.log('WIZJA.TV BRAK PREMIUM: %s' % result)
                control.infoDialog(control.lang(30490).encode('utf-8'), time=6000)
                control.dialog.ok(control.addonInfo('name') + ' - WIZJA TV', control.lang(30490).encode('utf-8'), '')

                raise Exception('NO premium')
            else:
                try:
                    premium = re.findall('Premium aktywne do (\d{4}.*?)</font>', result)[0]
                    control.set_setting('wizja.expire', premium)
                    control.infoDialog('Premium Wizja.tv do: '+ premium.encode('utf-8'), time=2000)
                except:
                    pass
                return True, cookie
        #account locked - wait 60 minutes
        elif '<font color="#FF0000">Wpisa' in result:
            control.log('WIZJA.TV zbyt wiele razy pobowales - poczekaj 60 minut: %s' % result)
            control.infoDialog(control.lang(30487).encode('utf-8'),time=6000)
            control.dialog.ok(control.addonInfo('name') + ' - WIZJA TV',control.lang(30487).encode('utf-8'), '')

            raise Exception('zbyt wiele razy pobowales - poczekaj 60 minut')
        #Other error
        else:
            control.log('WIZJA.TV inny blad: %s' % result)
            control.infoDialog(control.lang(30488).encode('utf-8'), time=6000)
            raise Exception('Inny bład: '+ result)
        return False

    except Exception as e:
        control.log('Error wizja.login %s' % e)
        return False
コード例 #10
0
ファイル: wizja.py プロジェクト: mrknow/filmkodi
def wizjachanels():
    try:
        if getWizjaCredentialsInfo() == False:
            if control.yesnoDialog(control.lang(40005).encode('utf-8'), control.lang(30481).encode('utf-8'), '',
                                   'Wizja', control.lang(30483).encode('utf-8'),
                                   control.lang(30482).encode('utf-8')):
                control.openSettings('1.18')
            raise Exception()

        if wizjalogin() == False: raise Exception()

        items = []
        url = 'http://wizja.tv/'
        result = client.request(url, headers=headers)
        result = client.parseDOM(result, 'td')

        for i in result:
            item = {}
            try:
                result2 = [(client.parseDOM(i, 'a', ret='href')[0], client.parseDOM(i, 'img', ret='src')[0])]
                item['img'] = 'http://wizja.tv/' + result2[0][1]
                item['img'] = item['img'].encode('utf-8')
                item['id'] = result2[0][0].replace('watch.php?id=','')
                item['id'] = item['id'].encode('utf-8')
                item['title'] = result2[0][1].replace('ch_logo/','').replace('.png','')
                item['title'] = item['title'].upper().encode('utf-8')
                items.append(item)
            except Exception as e:
                control.log('Error wizja.wizjachanels for %s' % e)
                pass
        return items
    except Exception as e:
        control.log('Error wizja.wizjachanels %s' % e)
コード例 #11
0
def getstream(id):
    try:
        pl_proxy = control.setting('pl_proxy')
        pl_proxy_port = control.setting('pl_proxy_port')

        url = 'https://api.videostar.pl/channels/get/%s?format_id=2' % id
        result = get(url, pl_proxy)
        control.log('Z %s' % result)
        result = json.loads(result)

        if result['status'] == 'ok':
            url = result['stream_channel']['url_base']
            result = client.request(
                url,
                headers=headers,
                cookie=control.get_setting('videostar.sess'),
                output='geturl')
            return result
        if result['status'] == 'error':
            control.infoDialog('%s' %
                               result['errors'][0]['msg'].encode('utf-8'))
            control.dialog.ok(control.addonInfo('name'),
                              result['errors'][0]['msg'].encode('utf-8'), '')

        raise Exception()
    except:
        #control.openSettings('6.1')
        control.log(
            'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'
        )
コード例 #12
0
ファイル: looknij.py プロジェクト: rrosajp/filmkodi
def weebchanels():
    try:

        items=[]
        login()
        url = 'https://looknij.in/telewizja-online/'
        result = client.request(url)
        r = client.parseDOM(result, 'div', attrs={'class': 'normal radius'})
        r = [(client.parseDOM(i, 'h3')[0],client.parseDOM(i, 'img', ret='src')[0]) for i in r]
        r = [(client.parseDOM(i[0], 'a', ret='href')[0], client.parseDOM(i[0], 'a')[0], i[1]) for i in r]
        control.log('RESULT R %s' % dump(r))

        for i in r:
            item = {}
            try:
                # control.log('Dalina %s' % result2)
                item['img'] = i[2].encode('utf-8')
                item['id'] = i[0].split('-')[-1]
                #item['id'] = item['id'].encode('utf-8')
                item['title'] = i[1].replace('[Lektor]', '').replace('  ', '')
                item['title'] = item['title'].upper().encode('utf-8')
                #control.log('RESULT I %s' % dump(item))
                # control.log('Calina %s' % item)
                item = {'title': item['title'], 'originaltitle': item['title'], 'genre': '0', 'plot': '0', 'name':item['title'], 'tagline': '0',  'poster': item['img'], 'fanart': '0', 'id':item['id'], 'service':'looknij', 'next': ''}
                items.append(item)
            except Exception as e:
                control.log('         Error wizja.looknij for %s' % e)
                pass
        return items
    except Exception as e:
        control.log('         Error wizja.looknij for %s' % e)
        pass
        return items
コード例 #13
0
ファイル: tv.py プロジェクト: anopid/filmkodi
    def imdb_user_list(self, url):
        try:
            result = client.request(url)
            result = result.decode('iso-8859-1').encode('utf-8')
            items = client.parseDOM(result, 'div', attrs = {'class': 'list_name'})
        except:
            pass

        for item in items:
            try:
                name = client.parseDOM(item, 'a')[0]
                name = client.replaceHTMLCodes(name)
                name = name.encode('utf-8')

                url = client.parseDOM(item, 'a', ret='href')[0]
                url = url.split('/list/', 1)[-1].replace('/', '')
                url = self.imdblist_link % url
                url = client.replaceHTMLCodes(url)
                url = url.encode('utf-8')

                self.list.append({'name': name, 'url': url, 'context': url})
            except:
                pass

        return self.list
コード例 #14
0
ファイル: videostar.py プロジェクト: m-malcokm/filmkodi
def get(url, params={}):
    try:
        if getVideostarCredentialsInfo() == False:
            if control.yesnoDialog(
                    control.lang(40001).encode('utf-8'),
                    control.lang(30481).encode('utf-8'), '', 'Trakt',
                    control.lang(30483).encode('utf-8'),
                    control.lang(30482).encode('utf-8')):
                control.openSettings('2.3')
            raise Exception()

        url = urlparse.urljoin('https://api.videostar.pl', url)
        result = client.request(url,
                                headers=headers,
                                cookie=control.get_setting('videostar.sess'))
        r = json.loads(result)

        if r['status'] == "error" or result == None:
            if r['errors'][0]['code'] == 1:
                login()
                control.sleep(500)
                mycookie = control.get_setting('videostar.sess')
                result = client.source(
                    url,
                    headers=headers,
                    cookie=control.get_setting('videostar.sess'))

        return result
    except Exception as e:
        control.log('Error videostar.get %s' % e)
        pass
コード例 #15
0
def streamrefresh():
    try:
        mynow = int(str(int(time.mktime(datetime.datetime.now().timetuple()))))
        expired = int(control.get_setting('telewizjada.tokenExpireIn'))
        control.log('Telewizjadanet Exp:%s Now:%s' % (expired, mynow))
        if mynow > expired:
            ua = control.get_setting('telewizjada.ua')
            refreshcookie = control.get_setting('telewizjada.refreshcookie')
            referer = control.get_setting('telewizjada.referer')
            myheaders = {
                'User-Agent': ua,
                'Content-Type': 'application/json',
                'cookie': refreshcookie,
                'referer': referer
            }
            url = 'http://www.telewizjada.net/net/service/verifydevice.php'
            params = json.dumps({"action": "old", "key": ""})
            result = client.request(url, post=params, headers=myheaders)
            control.log('Telewizjada verifydevice result: %s' % (result))
            expirewhen = datetime.datetime.now() + datetime.timedelta(
                seconds=refreshtime)
            control.set_setting('telewizjada.tokenExpireIn',
                                str(int(time.mktime(expirewhen.timetuple()))))
    except Exception as e:
        control.log('Error telewizjada.refresh %s' % e)
        raise Exception()
コード例 #16
0
    def sourcesResolve(self, url, provider):
        try:
            provider = provider.lower()

            if not provider.endswith(('_mv', '_tv', '_mv_tv')):
                sourceDict = []
                for package, name, is_pkg in pkgutil.walk_packages(__path__):
                    sourceDict.append((name, is_pkg))
                provider = [
                    i[0] for i in sourceDict
                    if i[1] == False and i[0].startswith(provider + '_')
                ][0]

            source = __import__(provider, globals(), locals(), [], -1).source()
            url = source.resolve(url)
            #control.log("[suurces]   my url 1 ************ %s " % url)
            #url = resolvers.request(url)
            #control.log("[sources]   my url 2 ************ %s " % url)

            try:
                headers = dict(urlparse.parse_qsl(url.rsplit('|', 1)[1]))
            except:
                headers = dict('')

            result = client.request(url.split('|')[0],
                                    headers=headers,
                                    output='chunk',
                                    timeout='20')
            if result == None: raise Exception()
            #control.log("!!!!!!!!!!!!!!!!!!!  %s prov: %s" % (url,provider))
            self.url = url
            return url
        except:
            return
コード例 #17
0
ファイル: __init__.py プロジェクト: mrknow/filmkodi
    def sourcesResolve(self, url, provider):
        try:
            provider = provider.lower()

            if not provider.endswith(('_mv', '_tv', '_mv_tv')):
                sourceDict = []
                for package, name, is_pkg in pkgutil.walk_packages(__path__): sourceDict.append((name, is_pkg))
                provider = [i[0] for i in sourceDict if i[1] == False and i[0].startswith(provider + '_')][0]

            source = __import__(provider, globals(), locals(), [], -1).source()
            url = source.resolve(url)
            #control.log("[suurces]   my url 1 ************ %s " % url)
            #url = resolvers.request(url)
            #control.log("[sources]   my url 2 ************ %s " % url)

            try: headers = dict(urlparse.parse_qsl(url.rsplit('|', 1)[1]))
            except: headers = dict('')

            result = client.request(url.split('|')[0], headers=headers, output='chunk', timeout='20')
            if result == None: raise Exception()
            #control.log("!!!!!!!!!!!!!!!!!!!  %s prov: %s" % (url,provider))
            self.url = url
            return url
        except:
            return
コード例 #18
0
ファイル: videostar.py プロジェクト: rrosajp/filmkodi
def getstream(id):
    try:
        pl_proxy = control.setting('pl_proxy')
        pl_proxy_port = control.setting('pl_proxy_port')


        url = 'https://api.videostar.pl/channels/get/%s?format_id=2' % id
        result = get(url,pl_proxy)
        control.log('Z %s' % result)
        result = json.loads(result)


        if result['status'] == 'ok':
            url = result['stream_channel']['url_base']
            result = client.request(url, headers=headers, cookie=control.get_setting('videostar.sess'), output='geturl')
            return result
        if result['status'] == 'error':
            if result['errors'][0]['code'] == 300:
                params = {'t':result['errors'][0]['data']['stream_token'] }
                res = get('/channels/close', headers=headers, cookie=control.get_setting('videostar.sess'), post=params)
                control.log('Z %s' % result)
                return getstream(id)

            else:
                control.infoDialog('%s' % result['errors'][0]['msg'].encode('utf-8'))
                control.dialog.ok(control.addonInfo('name'), result['errors'][0]['msg'].encode('utf-8'), '')

        raise Exception()
    except:
        #control.openSettings('6.1')
        control.log('ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ' )
コード例 #19
0
ファイル: pierwsza.py プロジェクト: mrknow/filmkodi
def get(url, params={}):
    try:

        params['api_id'] = stale.pierwszatv_apiid
        params['checksum'] = stale.pierwszatv_checksum
        url = urlparse.urljoin('http://pierwsza.tv', url)
        url = url + '?' + urllib.urlencode(params)
        headers = {'Content-Type': 'application/json'}

        result = client.request(url, headers=headers, output='response', error=True)
        if not (result[0] == '401' or result[0] == '405'): return result[1]

        result = client.request(url, headers=headers)
        #control.log('ZZZZZZZZ PIerwsza result: %s' % result)
        return result
    except:
        pass
コード例 #20
0
def get(url, params={}):
    try:

        params['api_id'] = stale.pierwszatv_apiid
        params['checksum'] = stale.pierwszatv_checksum
        url = urlparse.urljoin('http://pierwsza.tv', url)
        url = url + '?' + urllib.urlencode(params)
        headers = {'Content-Type': 'application/json'}

        result = client.request(url, headers=headers, output='response', error=True)
        if not (result[0] == '401' or result[0] == '405'): return result[1]

        result = client.request(url, headers=headers)
        #control.log('ZZZZZZZZ PIerwsza result: %s' % result)
        return result
    except:
        pass
コード例 #21
0
ファイル: itivi.py プロジェクト: undg/filmkodi
def getstream(id):
    try:
        if login():
            #control.infoDialog(control.lang(30493).encode('utf-8'), time=200)
            ref = '%s' % id
            result = client.request(ref)
            headers = {'Referer': ref}
            url = '%s' % id
            result = client2.http_get(url, headers=headers)
            control.log('itivi.getstream0 %s' % result)

            mylink = re.compile(
                "playM3U8byGrindPlayer\([\"'](.*?)[\"']\)").findall(result)
            control.log('itivi.getstream0 %s' % mylink)
            if len(mylink) > 0:
                rtmp = mylink[0].replace('flv:', '')
                for j in range(0, 5):
                    time.sleep(1)
                    try:
                        code, result2 = client.request(rtmp,
                                                       output='response2',
                                                       timeout='2')
                        control.log(
                            'Pierwsza link check nr: %s: result:%s %s|%s' %
                            (j, result2, code, len(result2)))
                        if '404 Not Found' in result2:
                            return None
                        if 'offline.mp4' in result2:
                            return None
                        if result2 == None:
                            raise Exception()
                        elif len(result2) < 1:
                            return None
                        else:
                            return rtmp
                    except:
                        pass
                #rtmp = rtmp + ' live=true timeout=15'
                return rtmp
            else:
                return None
    except Exception as e:
        control.log('Error itivi.getstream %s' % e)
        return
コード例 #22
0
ファイル: wizja.py プロジェクト: mrknow/filmkodi
def getstream(id):
    try:

        if wizjalogin():
            cookie = control.setting('wizja.token').strip()
            ref='http://wizja.tv/watch.php?id=%s' % id
            result =  client.request(ref, headers=HOST, cookie=cookie)
            HOST['Referer']=ref
            url = 'http://wizja.tv/porter.php?ch=%s' % id
            result =  client.request(url, headers=HOST, cookie=cookie)
            mylink = re.compile('src: "(.*?)"').findall(result)
            mykill = re.compile('<a href="killme.php\?id=(.*?)" target="_top">').findall(result)
            control.log('AMA %s|%s' %(mylink,mykill))
            if len(mylink)>0:
                rtmp2 = urllib.unquote(mylink[0]).decode('utf8')
                rtmp1 = re.compile('rtmp://(.*?)/(.*?)/(.*?)\?(.*?)\&streamType').findall(rtmp2)
                control.log('AMA1 %s' % (rtmp1))
                control.log('AMA2 %s' % (rtmp2))

                rtmp = 'rtmp://' + rtmp1[0][0] + '/' + rtmp1[0][1] +'/' +rtmp1[0][2]+ '?'+ rtmp1[0][3]+ ' app=' + rtmp1[0][1] + '?' +rtmp1[0][3]+' swfVfy=1 flashver=WIN\\2020,0,0,306 timeout=25 swfUrl=http://wizja.tv/player/StrobeMediaPlayback.swf live=true pageUrl='+ref
                control.log('AMA3 %s' % (rtmp))

                return rtmp
            #kill other sessions
            elif len(mykill)>0:
                control.log('Error KILL %s' % mykill)
                urlkill = 'http://wizja.tv/killme.php?id=%s' % mykill[0]
                result = client.request(urlkill , headers=HOST, cookie=cookie)
                control.sleep(300)
                url = 'http://wizja.tv/porter.php?ch=%s' % id
                result = client.request(url, headers=HOST, cookie=cookie)
                mylink = re.compile('src: "(.*?)"').findall(result)
                if len(mylink)>0:
                    rtmp2 = urllib.unquote(mylink[0]).decode('utf8')
                    rtmp1 = re.compile('rtmp://(.*?)/(.*?)/(.*?)\?(.*?)\&streamType').findall(rtmp2)
                    rtmp = 'rtmp://' + rtmp1[0][0] + '/' + rtmp1[0][1] +'/' +rtmp1[0][2]+ '?'+ rtmp1[0][3]+ ' app=' + rtmp1[0][1] + '?' +rtmp1[0][3]+' swfVfy=1 flashver=WIN\\2020,0,0,306 timeout=25 swfUrl=http://wizja.tv/player/StrobeMediaPlayback.swf live=true pageUrl='+ref
                    return rtmp
            else:
                raise Exception('WWW: '+result)
        else:
            return
    except Exception as e:
        control.log('Error wizja.getstream %s' % e)
コード例 #23
0
ファイル: yoy.py プロジェクト: rrosajp/filmkodi
def getchanels():
    try:
        if getYoyCredentialsInfo() == False:
            if control.yesnoDialog(control.lang(40004).encode('utf-8'), control.lang(30481).encode('utf-8'), '', 'YOY', control.lang(30483).encode('utf-8'), control.lang(30482).encode('utf-8')):
                control.openSettings('1.21')
            raise Exception()
        #login()
        items = []
        for j in range(1,10):
            try:
                url = 'http://yoy.tv/channels?live=1&country=140&page=%s' % j
                result = client.request(url)
                result = client.parseDOM(result, 'a', attrs = {'class': 'thumb-info team'})
                result = [(client.parseDOM(i, 'img', ret='src')[0], client.parseDOM(i, 'img', ret='alt')[0]) for i in result]
                for i in result:
                    item = {}
                    item['id'] = i[0].replace('http://yoy.tv/channel/covers/','').replace('.jpg?cache=32','')
                    control.log('YOY channel %s' % item['id'])
                    item['id']=item['id'].encode('utf-8')
                    item['title'] = control.trans(i[1].upper().encode('utf-8'))
                    items.append(item)
            except:
                control.log('YOY url: %s' % url)
                pass

        if 'true'== control.get_setting('xxxmode'):
            url = 'http://yoy.tv/channels?category=erotyka'
            result = client.request(url)
            result = client.parseDOM(result, 'a', attrs = {'class': 'thumb-info team'})
            result = [(client.parseDOM(i, 'img', ret='src')[0], client.parseDOM(i, 'img', ret='alt')[0]) for i in result]
            for i in result:
                control.log('XXX: %s' %i[0])
                item = {}
                item['id'] = i[0].replace('http://yoy.tv/channel/covers/','').replace('.jpg?cache=32','')
                control.log('XXX Alina %s' % item['id'])
                item['id']=item['id'].encode('utf-8')
                item['title'] = 'XXX '+ control.trans(i[1].upper().encode('utf-8'))
                items.append(item)

        return items
    except Exception as e:
        control.log('Error yoy.getchanels %s' % e)
コード例 #24
0
ファイル: yoy.py プロジェクト: rrosajp/filmkodi
def yoylogin():
    if getYoyCredentialsInfo() == False:
        raise ValueError('Brak ustawienia logiun lub hasła ')
    try:

        params = {}
        url = 'http://yoy.tv/signin'
        result, headers, content, cookie = client.request(url, output='extended')

        params['remember_me']='1'
        params['email'] = control.get_setting('yoytv.user')
        params['password'] = control.get_setting('yoytv.pass')
        params['_token']=client.parseDOM(result, 'input', ret='value', attrs={'name': '_token'})[0]
        result1, headers, content, cookie = client.request(url, post=params, cookie=cookie, output='extended', redirect=False)
        mycookies = re.findall('Set-Cookie: (.*?);', '%s' % content)
        cookie = ";".join(mycookies)
        control.set_setting('yoytv.sess', cookie)
        control.log('#####   cookie1: %s' % cookie)
        url = 'http://yoy.tv/'
        result = client.request(url, cookie=cookie)

        if not 'http://yoy.tv/signout' in result:
            control.log('BBBBB LOGIN %s' % 'yoy.tv')
            control.infoDialog(control.lang(30484).encode('utf-8'))
            control.dialog.ok(control.addonInfo('name') + ' - YOY TV', control.lang(30484).encode('utf-8'), '')
            control.openSettings('1.12')
            return False
        else:
            url = 'http://yoy.tv/user/settings'
            result = client.request(url, cookie=cookie)
            premium = re.findall('Aktywne do: ([0-9 :-]+)',result)
            if len(premium)>0:
                control.log('CCCCC LOGIN %s' % premium)
                control.infoDialog(control.lang(30496) + premium[0].encode('utf-8') )

            return True

    except Exception as e:
        control.log('Yoylogin ERROR %s' % e)
        return False
コード例 #25
0
ファイル: itivi.py プロジェクト: rrosajp/filmkodi
def getstream(id):
    try:
        if login():
            #control.infoDialog(control.lang(30493).encode('utf-8'), time=200)
            ref='%s' % id
            result =  client.request(ref)
            headers={'Referer':ref}
            url = '%s' % id
            result =  client2.http_get(url, headers=headers)
            control.log('itivi.getstream0 %s' % result)

            mylink = re.compile("playM3U8byGrindPlayer\([\"'](.*?)[\"']\)").findall(result)
            control.log('itivi.getstream0 %s' % mylink)
            if len(mylink)>0:
                rtmp = mylink[0].replace('flv:','')
                for j in range(0, 5):
                    time.sleep(1)
                    try:
                        code, result2 = client.request(rtmp, output='response2', timeout='2')
                        control.log('Pierwsza link check nr: %s: result:%s %s|%s' % (j, result2,code, len(result2)))
                        if '404 Not Found' in result2:
                            return None
                        if 'offline.mp4' in result2:
                            return None
                        if result2 == None:
                            raise Exception()
                        elif len(result2) <1:
                            return None
                        else:
                            return rtmp
                    except:
                        pass
                #rtmp = rtmp + ' live=true timeout=15'
                return rtmp
            else:
                return None
    except Exception as e:
        control.log('Error itivi.getstream %s' % e)
        return
コード例 #26
0
def chanels():
    adult = control.get_setting('xxxmode')

    #if login() == False:
    #    control.log('Błędny login')
    #    raise ValueError('Błędny login')
    url = 'http://www.telewizjada.net/get_channels_cache.php'
    items = []
    try:
        result = client.request(url)
        result = json.loads(result)

        for i in result['channels']:
            try:
                if adult == 'false':
                    if i['isAdult'] == 1:
                        control.log('Adult telewizjada.chanels %s' %
                                    i['displayName'])
                        raise ValueError('Adult channel %s' % i['displayName'])
                item = {}
                item['img'] = urlparse.urljoin(base_url,
                                               i['bigThumb']).encode('utf-8')
                item['id'] = i['id']
                item['title'] = i['displayName'].upper().encode('utf-8')
                item['plot'] = i['description'].encode('utf-8')
                item = {
                    'title': item['title'],
                    'originaltitle': item['title'],
                    'genre': '0',
                    'plot': item['plot'],
                    'name': item['title'],
                    'tagline': '0',
                    'poster': item['img'],
                    'fanart': '0',
                    'id': item['id'],
                    'service': 'telewizjadanet',
                    'next': ''
                }
                items.append(item)
                #control.log('XXXXXXXXX %s' % i)

            except:
                pass
        return items

    except Exception as e:
        control.log('Error telewizjada.chanels %s' % e)
        control.dialog.ok(
            control.addonInfo('name') + ' - Telewizjada.net',
            control.lang(30602).encode('utf-8'), '')
        return
コード例 #27
0
ファイル: videostar.py プロジェクト: anopid/filmkodi
def getstream(id):
    try:
        url = 'https://api.videostar.pl/channels/get/%s?format_id=2' % id
        result = get(url)
        result = json.loads(result)
        if result['status'] == 'ok':
            url = result['stream_channel']['url_base']
            result = client.request(url, headers=headers, cookie=control.get_setting('videostar.sess'), output='geturl')
            return result

        raise Exception()
    except:
        #control.openSettings('6.1')
        control.log('ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ' )
コード例 #28
0
ファイル: videostar.py プロジェクト: anopid/filmkodi
def login():
    #f getVideostarCredentialsInfo() == False:
    #    raise Exception()
    params = {}
    #control.set_setting('videostar.sess', '')
    params['login'] = control.get_setting('videostar.user')
    params['password'] = control.get_setting('videostar.pass')
    params['permanent']=1
    url = 'https://api.videostar.pl/user/login'
    result = client.request(url, post=params, headers=headers, output='cookie')
    control.log('ResultC videostar.get %s' % result)

    control.set_setting('videostar.sess', result)
    url='https://api.videostar.pl/invitations/limit'
    headers['cookie']=result
    result2 = client.request(url, headers=headers)
    if 'error' in  result2:
        result2 = json.loads(result2)
        control.log('EEEEEEEEEEEE Result videostar.get %s' % result2['errors'][0]['msg'])
        control.infoDialog(result2['errors'][0]['msg'].encode('utf-8'))

    control.sleep(500)
    return result
コード例 #29
0
ファイル: looknij.py プロジェクト: undg/filmkodi
def weebchanels():
    try:

        items = []
        login()
        url = 'https://looknij.in/telewizja-online/'
        result = client.request(url)
        r = client.parseDOM(result, 'div', attrs={'class': 'normal radius'})
        r = [(client.parseDOM(i, 'h3')[0], client.parseDOM(i, 'img',
                                                           ret='src')[0])
             for i in r]
        r = [(client.parseDOM(i[0], 'a',
                              ret='href')[0], client.parseDOM(i[0],
                                                              'a')[0], i[1])
             for i in r]
        control.log('RESULT R %s' % dump(r))

        for i in r:
            item = {}
            try:
                # control.log('Dalina %s' % result2)
                item['img'] = i[2].encode('utf-8')
                item['id'] = i[0].split('-')[-1]
                #item['id'] = item['id'].encode('utf-8')
                item['title'] = i[1].replace('[Lektor]', '').replace('  ', '')
                item['title'] = item['title'].upper().encode('utf-8')
                #control.log('RESULT I %s' % dump(item))
                # control.log('Calina %s' % item)
                item = {
                    'title': item['title'],
                    'originaltitle': item['title'],
                    'genre': '0',
                    'plot': '0',
                    'name': item['title'],
                    'tagline': '0',
                    'poster': item['img'],
                    'fanart': '0',
                    'id': item['id'],
                    'service': 'looknij',
                    'next': ''
                }
                items.append(item)
            except Exception as e:
                control.log('         Error wizja.looknij for %s' % e)
                pass
        return items
    except Exception as e:
        control.log('         Error wizja.looknij for %s' % e)
        pass
        return items
コード例 #30
0
ファイル: videostar.py プロジェクト: rrosajp/filmkodi
def get(url, proxy=''):
    try:
        pl_proxy = control.setting('pl_proxy')
        pl_proxy_port = control.setting('pl_proxy_port')

        if getVideostarCredentialsInfo() == False:
            if control.yesnoDialog(control.lang(40001).encode('utf-8'), control.lang(30481).encode('utf-8'), '', 'Trakt', control.lang(30483).encode('utf-8'), control.lang(30482).encode('utf-8')):
                control.openSettings('1.11')
            raise Exception()

        url = urlparse.urljoin('https://api.videostar.pl', url)
        if proxy == '':
            result = client.request(url, headers=headers, cookie=control.get_setting('videostar.sess'))
        else:
            myproxy = pl_proxy
            if pl_proxy_port != '': myproxy = myproxy + ':' + pl_proxy_port

            myproxy_check = is_bad_proxy(myproxy)
            if not myproxy_check == '':
                control.dialog.ok(control.addonInfo('name'), control.lang(40013).encode('utf-8') + ' ' + myproxy_check.encode('utf-8'), '')
                control.openSettings('0.11')
                return None

            result = client.request(url, headers=headers, cookie=control.get_setting('videostar.sess'), proxy=myproxy)
        r = json.loads(result)

        if r['status'] =="error" or result==None:
            if r['errors'][0]['code'] == 1:
                login()
                control.sleep(500)
                mycookie = control.get_setting('videostar.sess')
                result = client.source(url, headers=headers, cookie=control.get_setting('videostar.sess'))

        return result
    except Exception as e:
        control.log('Error videostar.get %s' % e)
        pass
コード例 #31
0
ファイル: weeb.py プロジェクト: mrknow/filmkodi
def get(url, params={}):
    try:
        params['platform'] = HOST
        params['v'] = '0.2.0~beta'

        if getWeebCredentialsInfo():
            params['username'] = control.setting('weeb.user').strip()
            params['userpassword'] = control.setting('weeb.pass')

        url = urlparse.urljoin('http://weeb.tv', url)

        result = client.request(url, headers=headers, post=params)
        return result
    except:
        pass
コード例 #32
0
ファイル: tv.py プロジェクト: anopid/filmkodi
        def predb_items():
            try:
                years = [(self.datetime).strftime('%Y'), (self.datetime - datetime.timedelta(days = 365)).strftime('%Y')]
                months = (self.datetime - datetime.timedelta(days = 180)).strftime('%Y%m%d')

                result = ''
                for i in years:
                    result += client.request(self.scn_page % (str(i), '1'))
                    result += client.request(self.scn_page % (str(i), '2'))

                items = client.parseDOM(result, 'div', attrs = {'class': 'post'})
                items = [(client.parseDOM(i, 'a', attrs = {'class': 'p-title'}), re.compile('(\d{4}-\d{2}-\d{2})').findall(i)) for i in items]
                items = [(i[0][0], i[1][0]) for i in items if len(i[0]) > 0 and len(i[1]) > 0]
                items = [(re.sub('(\.|\(|\[|\s)(\d{4}|S\d*E\d*|3D)(\.|\)|\]|\s)(.+)', '', i[0]), re.compile('[\.|\(|\[|\s](\d{4})[\.|\)|\]|\s]').findall(i[0]), re.sub('[^0-9]', '', i[1])) for i in items]
                items = [(i[0], i[1][-1], i[2]) for i in items if len(i[1]) > 0]
                items = [i for i in items if int(months) <= int(i[2])]
                items = sorted(items,key=lambda x: x[2])[::-1]
                items = [(re.sub('(\.|\(|\[|LIMITED|UNCUT)', ' ', i[0]).strip(), i[1]) for i in items]
                items = [x for y,x in enumerate(items) if x not in items[:y]]
                items = items[:150]

                return items
            except:
                return
コード例 #33
0
ファイル: itivi.py プロジェクト: undg/filmkodi
def get(url, params={}):
    try:
        params['platform'] = HOST
        params['v'] = '0.2.0~beta'

        #if getWeebCredentialsInfo():
        #    params['username'] = control.setting('weeb.user').strip()
        #    params['userpassword'] = control.setting('weeb.pass')

        url = urlparse.urljoin(MAINURL, url)

        result = client.request(url, headers=headers, post=params)
        return result
    except:
        pass
コード例 #34
0
ファイル: looknij.py プロジェクト: undg/filmkodi
def getstream(id):
    try:
        #if login():
        url = 'https://looknij.in/tv/data/%s' % id
        headers = {'Referer': url, "X-Requested-With": "XMLHttpRequest"}
        params = {"isMobile": "false"}
        result = client.request(url, post=params, headers=headers)
        result = json.loads(result)
        #control.log('RES %s' % dump(result))
        if len(result) > 0:
            link = result['Url']
            #control.log('RES %s' % dump(link))
            return link
        return
    except Exception as e:
        control.log('Error looknij.getstream %s' % e)
        return
コード例 #35
0
ファイル: looknij.py プロジェクト: rrosajp/filmkodi
def getstream(id):
    try:
        #if login():
        url='https://looknij.in/tv/data/%s' % id
        headers={'Referer':url, "X-Requested-With":"XMLHttpRequest"}
        params = {"isMobile":"false"}
        result =  client.request(url, post=params, headers=headers)
        result = json.loads(result)
        #control.log('RES %s' % dump(result))
        if len(result)>0:
            link = result['Url']
            #control.log('RES %s' % dump(link))
            return link
        return
    except Exception as e:
        control.log('Error looknij.getstream %s' % e)
        return
コード例 #36
0
ファイル: telewizjadanet.py プロジェクト: mrknow/filmkodi
def streamrefresh():
    try:
        mynow = int(str(int(time.mktime(datetime.datetime.now().timetuple()))))
        expired = int(control.get_setting('telewizjada.tokenExpireIn'))
        control.log('Telewizjadanet Exp:%s Now:%s' % (expired, mynow))
        if mynow>expired:
            ua = control.get_setting('telewizjada.ua')
            refreshcookie = control.get_setting('telewizjada.refreshcookie')
            referer = control.get_setting('telewizjada.referer')
            myheaders = {'User-Agent': ua, 'Content-Type':'application/json','cookie': refreshcookie,'referer':referer}
            url = 'http://www.telewizjada.net/net/service/verifydevice.php'
            params = json.dumps({"action":"old","key":""})
            result = client.request(url, post=params, headers=myheaders)
            control.log('Telewizjada verifydevice result: %s' % (result))
            expirewhen = datetime.datetime.now() + datetime.timedelta(seconds=refreshtime)
            control.set_setting('telewizjada.tokenExpireIn', str(int(time.mktime(expirewhen.timetuple()))))
    except Exception as e:
        control.log('Error telewizjada.refresh %s' % e )
        raise Exception()
コード例 #37
0
ファイル: videostar.py プロジェクト: m-malcokm/filmkodi
def getstream(id):
    try:
        url = 'https://api.videostar.pl/channels/get/%s?format_id=2' % id
        result = get(url)
        result = json.loads(result)
        if result['status'] == 'ok':
            url = result['stream_channel']['url_base']
            result = client.request(
                url,
                headers=headers,
                cookie=control.get_setting('videostar.sess'),
                output='geturl')
            return result

        raise Exception()
    except:
        #control.openSettings('6.1')
        control.log(
            'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'
        )
コード例 #38
0
ファイル: videostar.py プロジェクト: anopid/filmkodi
def get(url, params={}):
    try:
        if getVideostarCredentialsInfo() == False:
            if control.yesnoDialog(control.lang(40001).encode('utf-8'), control.lang(30481).encode('utf-8'), '', 'Trakt', control.lang(30483).encode('utf-8'), control.lang(30482).encode('utf-8')):
                control.openSettings('2.3')
            raise Exception()

        url = urlparse.urljoin('https://api.videostar.pl', url)
        result = client.request(url, headers=headers, cookie=control.get_setting('videostar.sess'))
        r = json.loads(result)

        if r['status'] =="error" or result==None:
            if r['errors'][0]['code'] == 1:
                login()
                control.sleep(500)
                mycookie = control.get_setting('videostar.sess')
                result = client.source(url, headers=headers, cookie=control.get_setting('videostar.sess'))

        return result
    except Exception as e:
        control.log('Error videostar.get %s' % e)
        pass
コード例 #39
0
ファイル: telewizjadanet.py プロジェクト: mrknow/filmkodi
def chanels():
    adult = control.get_setting('xxxmode')

    #if login() == False:
    #    control.log('Błędny login')
    #    raise ValueError('Błędny login')
    url = 'http://www.telewizjada.net/get_channels_cache.php'
    items = []
    try:
        result = client.request(url)
        result = json.loads(result)

        for i in result['channels']:
            try:
                if adult == 'false':
                    if i['isAdult'] == 1:
                        control.log('Adult telewizjada.chanels %s' % i['displayName'])
                        raise ValueError('Adult channel %s' % i['displayName'])
                item={}
                item['img'] =  urlparse.urljoin(base_url, i['bigThumb']).encode('utf-8')
                item['id'] = i['id']
                item['title'] = control.trans(i['displayName'].upper().encode("utf-8"))
                item['plot'] = i['description'].encode('utf-8')
                item = {'title': item['title'],  'genre': '0', 'plot': item['plot'],
                        'name': item['title'], 'tagline': '0', 'poster': item['img'], 'fanart': '0', 'id': item['id'],
                        'service': 'telewizjadanet', 'next': ''}
                items.append(item)
                #control.log('XXXXXXXXX %s' % i)

            except:
                pass
        return items

    except Exception as e:
        control.log('Error telewizjada.chanels %s' % e)
        control.dialog.ok(control.addonInfo('name') + ' - Telewizjada.net', control.lang(30602).encode('utf-8'), '')
        return
コード例 #40
0
ファイル: wizja.py プロジェクト: Tw3ak/filmkodi
def wizjachanels():
    try:
        if getWizjaCredentialsInfo() == False:
            if control.yesnoDialog(
                    control.lang(40005).encode('utf-8'),
                    control.lang(30481).encode('utf-8'), '', 'Wizja',
                    control.lang(30483).encode('utf-8'),
                    control.lang(30482).encode('utf-8')):
                control.openSettings('1.18')
            raise Exception()

        if wizjalogin() == False: raise Exception()

        items = []
        url = 'http://wizja.tv/'
        result = client.request(url, headers=headers)
        result = client.parseDOM(result, 'td')

        for i in result:
            item = {}
            try:
                result2 = [(client.parseDOM(i, 'a', ret='href')[0],
                            client.parseDOM(i, 'img', ret='src')[0])]
                item['img'] = 'http://wizja.tv/' + result2[0][1]
                item['img'] = item['img'].encode('utf-8')
                item['id'] = result2[0][0].replace('watch.php?id=', '')
                item['id'] = item['id'].encode('utf-8')
                item['title'] = result2[0][1].replace('ch_logo/',
                                                      '').replace('.png', '')
                item['title'] = item['title'].upper().encode('utf-8')
                items.append(item)
            except Exception as e:
                control.log('Error wizja.wizjachanels for %s' % e)
                pass
        return items
    except Exception as e:
        control.log('Error wizja.wizjachanels %s' % e)
コード例 #41
0
ファイル: tv.py プロジェクト: anopid/filmkodi
 def imdb_watchlist_id(url):
     return re.compile('/export[?]list_id=(ls\d*)').findall(client.request(url))[0]
コード例 #42
0
def getstream(id):
    try:
        control.set_setting('pierwszatv.tokenExpireIn', '')
        control.set_setting('pierwszatv.serverId', '')
        control.set_setting('pierwszatv.streamId', '')
        control.set_setting('pierwszatv.token', '')

        if getPierwszaCredentialsInfo() == False:
            if control.yesnoDialog(control.lang(40003).encode('utf-8'), control.lang(30481).encode('utf-8'), '', 'Trakt', control.lang(30483).encode('utf-8'), control.lang(30482).encode('utf-8')):
                control.set_setting('pierwszatv.user', '')
                control.set_setting('pierwszatv.password', '')
                control.openSettings('2.1')

            raise Exception()
        url = '/api/stream/create'
        params = {}
        params['id'] =id
        params['user'] =control.setting('pierwszatv.user').strip()
        params['password'] = urllib.quote_plus(control.setting('pierwszatv.password'))

        result = get(url, params)
        result = json.loads(result)

        if result['status'] == 'ok':
            #time.sleep(1)
            #control.log('x1x1x1: %s' % result['status'])
            expirein = int(int(result['tokenExpireIn'])*0.75)
            expirewhen  = datetime.datetime.now() + datetime.timedelta(seconds=expirein)
            control.set_setting('pierwszatv.tokenExpireIn', str(int(time.mktime(expirewhen.timetuple()))))
            control.set_setting('pierwszatv.serverId', result['serverId'])
            control.set_setting('pierwszatv.streamId', result['streamId'])
            control.set_setting('pierwszatv.token', result['token'])

            for i in range(0, 5):
                try:
                    r = get('/api/stream/status', {'serverId': result['serverId'] , 'streamId': result['streamId'], 'token': result['token']})
                    r = json.loads(r)
                    if r['status'] == 'ok':
                        #control.infoDialog(control.lang(30489).encode('utf-8'), time=6000)
                        for j in range(0, 20):
                            time.sleep(1)
                            control.infoDialog(control.lang(30489).encode('utf-8'), time=500)
                            try:
                                result2 = client.request(r['source']+'?token='+result['token'],safe=True, timeout='2')
                                control.log('Pierwsza link check nr: %s: result:%s' % (j,result2))


                                if result2 == None: raise Exception()
                                else: return r['source']+'?token='+result['token']
                            except:
                                pass

                        return r['source']+'?token='+result['token']
                    time.sleep(3)

                except:
                    pass
        if result['status'] == 'error':
            control.infoDialog('%s' % result['message'].encode('utf-8'))

        return None

    except Exception as e:
        control.log('Error pierwsza.getstream %s' % e )
コード例 #43
0
ファイル: tv.py プロジェクト: anopid/filmkodi
    def super_info(self, i):
        try:
            #control.log("##################><><><><> META ID  %s" % str(i))
            zero ='0'.encode('utf-8')

            if self.list[i]['metacache'] == True: raise Exception()

            try: imdb = self.list[i]['imdb']
            except: imdb = '0'

            if not imdb == '0': url = self.imdb_info_link % imdb
            else: raise Exception()

            item = client.request(url, timeout='10')
            item = json.loads(item)
            #control.log("##################><><><><> META TITLE  %s" % item['Title'])
            #control.log("##################><><><><> META ALL %s" % item)

            imdb = item['imdbID']
            if imdb == '' or imdb == None: imdb = '0'
            if not imdb == '0': imdb = 'tt' + re.sub('[^0-9]', '', str(imdb))
            imdb = imdb.encode('utf-8')
            if not imdb == '0': self.list[i].update({'imdb': imdb, 'code': imdb})

            """
            try:
                #url2 = 'http://webservice.fanart.tv/v3/movies/%s?api_key=%s' % (imdb, self.fanarttv_key)
                #item2 = client.request(url2, timeout='10')
                #item2 = json.loads(item2)
                #control.log("><><><><> ITEM4  %s" % item2['moviebackground'][0]['url'])

            except:
                pass

            try:
                tmdb = item2['tmdb_id']
                if tmdb == '' or tmdb == None: tmdb = '0'
                tmdb = re.sub('[^0-9]', '', str(tmdb))
                tmdb = tmdb.encode('utf-8')
                if not tmdb == '0': self.list[i].update({'tmdb': tmdb})
            except:
                tmdb = zero

            """
            try:
                poster = item['Poster']
                if poster == '' or poster == None: poster = '0'
                #if not poster == '0': poster = '%s%s' % (self.tmdb_poster, poster)
                poster = poster.encode('utf-8')
                if not poster == '0': self.list[i].update({'poster': poster})
            except:
                poster = zero

            """
            try:
                fanart = item2['moviebackground'][0]['url']
                if fanart == '' or fanart == None: fanart = '0'
                #if not fanart == '0': fanart = '%s%s' % (self.tmdb_image, fanart)
                fanart = fanart.encode('utf-8')
                if not fanart == '0' and self.list[i]['fanart'] == '0': self.list[i].update({'fanart': fanart})
            except:
                fanart = zero
            """

            try:
                if not imdb == '0':
                    fanart = 'http://films4u.org/imdb/bgs/'+imdb+'.jpg'
                    fanart= fanart.encode('utf-8')

                else:
                    fanart = zero
            except:
                fanart = zero

            #    http://fanart.filmkodi.com/tt0006333.jpg
            try:
                premiered = item['Released']
                premiered = re.compile('(\d{4}-\d{2}-\d{2})').findall(premiered)[0]
            except: premiered = '0'
            if premiered == '' or premiered == None: premiered = '0'
            premiered = premiered.encode('utf-8')
            if not premiered == '0': self.list[i].update({'premiered': premiered})

            #studio = item['production_companies']
            #try: studio = [x['name'] for x in studio][0]
            #except:
            studio = '0'
            #if studio == '' or studio == None: studio = '0'
            studio = studio.encode('utf-8')
            #if not studio == '0': self.list[i].update({'studio': studio})

            try: genre = item['Genre']
            except: genre = '0'
            if genre == '' or genre == None or genre == []: genre = '0'
            genre = genre.encode('utf-8')
            if not genre == '0': self.list[i].update({'genre': genre})

            try: duration = str(item['Runtime'].replace(' min',''))
            except: duration = '0'
            if duration == '' or duration == None: duration = '0'
            duration = duration.encode('utf-8')
            if not duration == '0': self.list[i].update({'duration': duration})

            try: rating = str(item['imdbRating'])
            except: rating = '0'
            if rating == '' or rating == None: rating = '0'
            rating = rating.encode('utf-8')
            if not rating == '0': self.list[i].update({'rating': rating})

            try:
                votes = str(item['imdbVotes'])
                votes = str(format(int(votes),',d'))
            except:
                votes = '0'
            if votes == '' or votes == None: votes = '0'
            votes = votes.encode('utf-8')
            if not votes == '0': self.list[i].update({'votes': votes})


            try:
                mpaa = item['Country']
            except:
                mpaa = '0'
            if mpaa == '' or mpaa == None: mpaa = '0'
            mpaa = mpaa.encode('utf-8')
            if not mpaa == '0': self.list[i].update({'mpaa': mpaa})

            try: cast = item['Actors']
            except: cast = '0'
            if cast == None or cast == '' or cast == 'N/A': cast = '0'
            cast = [x.strip() for x in cast.split(',') if not x == '']
            try: cast = [(x.encode('utf-8'), '') for x in cast]
            except: cast = []
            if cast == []: cast = '0'
            if not cast == '0': self.list[i].update({'cast': cast})

            try: writer = item['Writer']
            except: writer = '0'
            if writer  == '' or writer == None: writer= '0'
            writer = writer.encode('utf-8').replace(', ', ' / ')
            if len(writer) > 0: self.list[i].update({'writer': writer})


            """
            tagline = item['tagline']
            if (tagline == '' or tagline == None) and not plot == '0': tagline = re.compile('[.!?][\s]{1,2}(?=[A-Z])').split(plot)[0]
            elif tagline == '' or tagline == None: tagline = '0'
            try: tagline = tagline.encode('utf-8')
            except: pass
            if not tagline == '0': self.list[i].update({'tagline': tagline})
            """
            plot = item['Plot']
            if plot == '' or plot == None: plot = '0'
            plot = plot.encode('utf-8')
            if not plot == '0': self.list[i].update({'plot': plot})

            director = item['Director']
            if director == '' or director == None or director == []: director = '0'
            director = director.encode('utf-8')
            if not director == '0': self.list[i].update({'director': director})

            #self.meta.append({'imdb': imdb, 'tmdb': tmdb, 'tvdb': '0', 'lang': self.info_lang, 'item': {'code': imdb, 'imdb': imdb, 'tmdb': tmdb, 'poster': poster, 'fanart': fanart, 'premiered': premiered, 'studio': studio, 'genre': genre, 'duration': duration, 'rating': rating, 'votes': votes, 'mpaa': mpaa, 'director': director, 'writer': writer, 'cast': cast, 'plot': plot, 'tagline': tagline}})
            self.meta.append({'imdb': imdb, 'tmdb': '0', 'tvdb': '0', 'lang': self.info_lang, 'item': {'code': imdb, 'imdb': imdb, 'tmdb': '0', 'poster': poster, 'fanart': fanart, 'premiered': premiered, 'studio': studio, 'genre': genre, 'duration': duration, 'rating': rating, 'votes': votes, 'mpaa': mpaa, 'director': director, 'writer': writer, 'cast': cast, 'plot': plot, 'tagline': zero}})
            #control.log("><><><><> ITEM META IMDB %s" % imdb)

        except:
            pass
コード例 #44
0
ファイル: wizja.py プロジェクト: Tw3ak/filmkodi
def wizjalogin():
    try:
        params = {}
        url = 'http://wizja.tv/users/index.php'
        #result, headers, content, cookie = client.request(url, output='extended')

        params['login'] = '******'
        params['user_name'] = control.get_setting('wizja.user')
        params['user_password'] = control.get_setting('wizja.pass')

        #login to site
        result, headers, content, cookie = client.request(url,
                                                          post=params,
                                                          headers=HOST,
                                                          output='extended')
        control.set_setting('wizja.token', cookie)

        #wrong login
        if '<font color="#FF0000">Błędne hasło..</font>' in result:  #zly login
            control.log('WIZJA.TV ZLY LOGIN: %s' % result)
            control.infoDialog(control.lang(30497).encode('utf-8'), time=6000)
            control.dialog.ok(
                control.addonInfo('name') + ' - WIZJA TV',
                control.lang(30497).encode('utf-8'), '')
            raise Exception()
        elif 'lub hasło.</font>' in result:  #zly login
            control.log('WIZJA.TV ZLY LOGIN: %s' % result)
            control.infoDialog(control.lang(30486).encode('utf-8'), time=6000)
            control.dialog.ok(
                control.addonInfo('name') + ' - WIZJA TV',
                control.lang(30486).encode('utf-8'), '')

            raise Exception()

        elif 'Zalogowany jako :' in result:
            #no premium
            if '<font color=ff0000>Brak premium' in result:
                control.log('WIZJA.TV BRAK PREMIUM: %s' % result)
                control.infoDialog(control.lang(30490).encode('utf-8'),
                                   time=6000)
                control.dialog.ok(
                    control.addonInfo('name') + ' - WIZJA TV',
                    control.lang(30490).encode('utf-8'), '')

                raise Exception('NO premium')
            else:
                try:
                    premium = re.findall(
                        'Premium aktywne do (\d{4}.*?)</font>', result)[0]
                    control.set_setting('wizja.expire', premium)
                    control.infoDialog('Premium Wizja.tv do: ' +
                                       premium.encode('utf-8'),
                                       time=2000)
                except:
                    pass
                return True, cookie
        #account locked - wait 60 minutes
        elif '<font color="#FF0000">Wpisa' in result:
            control.log(
                'WIZJA.TV zbyt wiele razy pobowales - poczekaj 60 minut: %s' %
                result)
            control.infoDialog(control.lang(30487).encode('utf-8'), time=6000)
            control.dialog.ok(
                control.addonInfo('name') + ' - WIZJA TV',
                control.lang(30487).encode('utf-8'), '')

            raise Exception('zbyt wiele razy pobowales - poczekaj 60 minut')
        #Other error
        else:
            control.log('WIZJA.TV inny blad: %s' % result)
            control.infoDialog(control.lang(30488).encode('utf-8'), time=6000)
            raise Exception('Inny bład: ' + result)
        return False

    except Exception as e:
        control.log('Error wizja.login %s' % e)
        return False
コード例 #45
0
ファイル: pierwsza.py プロジェクト: mrknow/filmkodi
def getstream(id):
    try:
        control.set_setting('pierwszatv.tokenExpireIn', '')
        control.set_setting('pierwszatv.serverId', '')
        control.set_setting('pierwszatv.streamId', '')
        control.set_setting('pierwszatv.token', '')

        if getPierwszaCredentialsInfo() == False:
            if control.yesnoDialog(control.lang(40003).encode('utf-8'), control.lang(30481).encode('utf-8'), '', 'Trakt', control.lang(30483).encode('utf-8'), control.lang(30482).encode('utf-8')):
                control.set_setting('pierwszatv.user', '')
                control.set_setting('pierwszatv.password', '')
                control.openSettings('1.4')

            raise Exception()
        url = '/api/stream/create'
        params = {}
        params['id'] =id
        params['user'] =control.setting('pierwszatv.user').strip()
        params['password'] = urllib.quote_plus(control.setting('pierwszatv.password'))

        result = get(url, params)
        control.log('x1x1x1: %s' % result)
        result = json.loads(result)

        if result['status'] == 'ok':
            #time.sleep(1)

            expirein = int(int(result['tokenExpireIn'])*0.75)
            expirewhen  = datetime.datetime.now() + datetime.timedelta(seconds=expirein)
            control.set_setting('pierwszatv.tokenExpireIn', str(int(time.mktime(expirewhen.timetuple()))))
            control.set_setting('pierwszatv.serverId', result['serverId'])
            control.set_setting('pierwszatv.streamId', result['streamId'])
            control.set_setting('pierwszatv.token', result['token'])

            for i in range(0, 5):
                try:
                    r = get('/api/stream/status', {'serverId': result['serverId'] , 'streamId': result['streamId'], 'token': result['token']})
                    r = json.loads(r)
                    if r['status'] == 'ok':
                        #control.infoDialog(control.lang(30489).encode('utf-8'), time=6000)
                        for j in range(0, 20):
                            time.sleep(1)
                            control.infoDialog(control.lang(30489).encode('utf-8'), time=500)
                            try:
                                result2 = client.request(r['source']+'?token='+result['token'],safe=True, timeout='2')
                                control.log('Pierwsza link check nr: %s: result:%s' % (j,result2))


                                if result2 == None: raise Exception()
                                else: return r['source']+'?token='+result['token']
                            except:
                                pass

                        return r['source']+'?token='+result['token']
                    time.sleep(3)

                except:
                    pass
        if result['status'] == 'error':
            control.infoDialog('%s' % result['message'].encode('utf-8'))
            control.dialog.ok(control.addonInfo('name'), result['message'].encode('utf-8'), '')

        return None

    except Exception as e:
        control.log('Error pierwsza.getstream %s' % e )
コード例 #46
0
ファイル: telewizjadanet.py プロジェクト: mrknow/filmkodi
def login():
    try:
        if getTelewizjadaCredentialsInfo() == False:
            if control.yesnoDialog(control.lang(40003).encode('utf-8'), control.lang(30481).encode('utf-8'), '', 'Trakt', control.lang(30483).encode('utf-8'), control.lang(30482).encode('utf-8')):
                control.set_setting('telewizjada.user', '')
                control.set_setting('telewizjada.password', '')
                control.openSettings('1.20')
        control.log('>>>>  LOGIN()' )

        expire = control.get_setting('telewizjada.expire')
        control.log('Expire1: %s' % expire)

        if expire != '':
            try:
                from datetime import datetime
                #d = datetime.strptime(expire, '%Y-%m-%d %H:%M:%S')
                d = datetime(*(time.strptime(expire, '%Y-%m-%d %H:%M:%S')[0:6]))
                control.log('Expire2: %s' % d)

                d2 = datetime.now()
                if d>d2:
                    control.log('Expire OK: %s %s' % (d,d2))
                    return True
            except: pass

        url = 'http://www.deltamediaplayer.com/index.php?option=com_users&view=login&Itemid=116'
        result, h1, content, cookie1 = client.request(url,output='extended')
        headers= {'referer':url}
        result = client.parseDOM(result, 'div', attrs={'class':'login'})[0]
        result = re.findall('<input type="hidden" name="([^"]+)" value="([^"]+)"',result)
        params = {  'username':control.get_setting('telewizjada.user'),
                    'password':control.get_setting('telewizjada.pass'),
                    'remember':'yes',
                    str(result[0][0]): urllib.quote(str(result[0][1])),
                    str(result[1][0]): urllib.quote(str(result[1][1]))
                    }
        paramslog = {  'username':control.get_setting('telewizjada.user'),
                    'password':'',
                    'remember':'yes',
                    str(result[0][0]): urllib.quote(str(result[0][1])),
                    str(result[1][0]): urllib.quote(str(result[1][1]))
                    }
        control.log('>>>>  PARAMS %s' % (paramslog))

        url='http://www.deltamediaplayer.com/index.php?option=com_users&task=user.login'

        result, h2, content, cookie2 = client.request(url, redirect=False, post=params, headers=headers, cookie=cookie1, output='extended')

        if content['Location'] != 'https://www.deltamediaplayer.com/index.php?option=com_users&view=profile':
            control.infoDialog(control.lang(30600).encode('utf-8'),time=6000)
            control.dialog.ok(control.addonInfo('name') + ' - Telewizzjada.net',control.lang(30600).encode('utf-8'), '')
            raise ValueError('Bledny login lub haslo.')


        url = 'http://www.deltamediaplayer.com/playercode/authorised/gethlsusers.php'
        headers['referer']='http://www.deltamediaplayer.com/index.php?option=com_acctexp&view=user&layout=subscriptiondetails&Itemid=119'
        headers['X-Requested-With']='XMLHttpRequest'
        headers['Content-Type'] = 'application/json'
        headers['cookie'] = '%s; %s' % (cookie1,content['Set-Cookie'].split(';')[0])
        params2=json.dumps({'browser':'Desktop;Windows;Chrome 54'})
        result = client.request(url,  post=params2, headers=headers)
        control.log('>>>>  RES r:%s ' % (result))

        r = json.loads(result)

        result = [i for i in r if i['registered'] != 0]

        if len(result)>0:
            for i in result:
                control.log('I %s' %i)

            control.log('QQQQQQQQQQQQQQ %s' % r[0]['hash'], )
            control.set_setting('telewizjada.token', r[0]['hash'])
            control.set_setting('telewizjada.os', r[0]['os'])
            control.set_setting('telewizjada.browser', r[0]['browser'])
            control.set_setting('telewizjada.device', r[0]['device'])
            control.log("Brovser: %s" % r[0]['browser'].split(' ')[0])
            ua = 'Mozilla/5.0 (%s; %s; rv:%s) Gecko/20100101 %s/%s' % (r[0]['os'], r[0]['device'], r[0]['browser'].split(' ')[-1],
                                                                       r[0]['browser'].split(' ')[0], r[0]['browser'].split(' ')[-1])
            control.log('UA %s' %ua)
            control.set_setting('telewizjada.ua', ua)
            return True

        else:
            control.infoDialog(control.lang(30601).encode('utf-8'), time=6000)
            control.dialog.ok(control.addonInfo('name') + ' - Telewizzjada.net',control.lang(30601).encode('utf-8'), '')
            raise ValueError('Brak zarejestrowanych przeglądarek.')
        return False


    except Exception as e:
        control.log('Exception telewizjada.net login %s' % e)
        return False
コード例 #47
0
ファイル: yoy.py プロジェクト: undg/filmkodi
def getstream(id):
    try:

        if yoylogin():
            cookie = control.get_setting('yoytv.sess').strip()
            control.log('#####   cookie2: %s' % cookie)
            url = 'http://yoy.tv/channels/%s' % id
            result = client.request(url, cookie=cookie)

            if 'http://yoy.tv/accept/' in result:
                if 'true' == control.get_setting('xxxmode'):
                    control.log('EROTYK ')
                    u1 = client.parseDOM(result, 'form', ret='action')[0]
                    params = {}
                    params['_token'] = client.parseDOM(
                        result, 'input', ret='value', attrs={'name':
                                                             '_token'})[0]
                    control.log('params: %s' % params['_token'])
                    result = client.request(u1, data=params, cookie=cookie)
                else:
                    control.infoDialog(
                        control.lang(30799).encode('utf-8') + ' ' +
                        control.lang(30798).encode('utf-8'))
                    return None

            if '<title>Kup konto premium w portalu yoy.tv</title>' in result:
                control.infoDialog(control.lang(30485).encode('utf-8'))
                return None
            result1 = result
            try:
                myobj = client.parseDOM(
                    result1,
                    'object',
                    ret='data',
                    attrs={'type':
                           'application/x-shockwave-flash'})[0].encode('utf-8')
                result = client.parseDOM(result1,
                                         'param',
                                         ret='value',
                                         attrs={'name': 'FlashVars'
                                                })[0].encode('utf-8')
                control.log("YOY res: %s |%s| " % (result, myobj))

                p = urlparse.parse_qs(result)
                #control.log('# %s' % query)
                control.log('# %s' % p)
                control.log('# %s' % p['fms'])
                control.log('# %s' % p['cid'])

                myurl = p['fms'][0] + '/' + p['cid'][
                    0] + ' swfUrl=' + myobj + ' swfVfy=true tcUrl=' + p['fms'][
                        0] + '/_definst_ live=true timeout=15 pageUrl=' + url
                myurl = p['fms'][0] + '/' + p['cid'][
                    0] + ' swfUrl=' + myobj + ' swfVfy=true live=true timeout=15 pageUrl=' + url

                #        ' swfVfy=true tcUrl=' + 'rtmp://'+myip+'/oyo/_definst_ live=true pageUrl=' + url
                control.log("########## TAB:%s" % myurl)
                return myurl

                #myurl = myurl.replace('oyo','yoy')
            except:
                pass
            result = re.compile('type: "application/x-mpegurl", src: "([^"]+)"'
                                ).findall(result1)
            control.log("########## TAB:%s" % result)
            myurl = result[0]

            return myurl
        else:
            return None

    except Exception as e:
        control.log('Error yoy.getstream %s' % e)
        return None
コード例 #48
0
ファイル: tv.py プロジェクト: anopid/filmkodi
        def predb_list(i):
            try:
                url = self.imdb_by_query % (urllib.quote_plus(i[0]), i[1])
                item = client.request(url, timeout='10')
                item = json.loads(item)

                title = item['Title']
                title = client.replaceHTMLCodes(title)
                title = title.encode('utf-8')

                year = item['Year']
                year = re.sub('[^0-9]', '', str(year))
                year = year.encode('utf-8')

                name = '%s (%s)' % (title, year)
                try: name = name.encode('utf-8')
                except: pass

                imdb = item['imdbID']
                if imdb == None or imdb == '' or imdb == 'N/A': raise Exception()
                imdb = 'tt' + re.sub('[^0-9]', '', str(imdb))
                imdb = imdb.encode('utf-8')

                poster = item['Poster']
                if poster == None or poster == '' or poster == 'N/A': poster = '0'
                if not ('_SX' in poster or '_SY' in poster): poster = '0'
                poster = re.sub('_SX\d*|_SY\d*|_CR\d+?,\d+?,\d+?,\d*','_SX500', poster)
                poster = poster.encode('utf-8')

                genre = item['Genre']
                if genre == None or genre == '' or genre == 'N/A': genre = '0'
                genre = genre.replace(', ', ' / ')
                genre = genre.encode('utf-8')

                duration = item['Runtime']
                if duration == None or duration == '' or duration == 'N/A': duration = '0'
                duration = re.sub('[^0-9]', '', str(duration))
                duration = duration.encode('utf-8')

                rating = item['imdbRating']
                if rating == None or rating == '' or rating == 'N/A' or rating == '0.0': rating = '0'
                rating = rating.encode('utf-8')

                votes = item['imdbVotes']
                try: votes = str(format(int(votes),',d'))
                except: pass
                if votes == None or votes == '' or votes == 'N/A': votes = '0'
                votes = votes.encode('utf-8')

                mpaa = item['Rated']
                if mpaa == None or mpaa == '' or mpaa == 'N/A': mpaa = '0'
                mpaa = mpaa.encode('utf-8')

                director = item['Director']
                if director == None or director == '' or director == 'N/A': director = '0'
                director = director.replace(', ', ' / ')
                director = re.sub(r'\(.*?\)', '', director)
                director = ' '.join(director.split())
                director = director.encode('utf-8')

                writer = item['Writer']
                if writer == None or writer == '' or writer == 'N/A': writer = '0'
                writer = writer.replace(', ', ' / ')
                writer = re.sub(r'\(.*?\)', '', writer)
                writer = ' '.join(writer.split())
                writer = writer.encode('utf-8')

                cast = item['Actors']
                if cast == None or cast == '' or cast == 'N/A': cast = '0'
                cast = [x.strip() for x in cast.split(',') if not x == '']
                try: cast = [(x.encode('utf-8'), '') for x in cast]
                except: cast = []
                if cast == []: cast = '0'

                plot = item['Plot']
                if plot == None or plot == '' or plot == 'N/A': plot = '0'
                plot = client.replaceHTMLCodes(plot)
                plot = plot.encode('utf-8')

                tagline = re.compile('[.!?][\s]{1,2}(?=[A-Z])').split(plot)[0]
                try: tagline = tagline.encode('utf-8')
                except: pass

                self.list.append({'title': title, 'originaltitle': title, 'year': year, 'premiered': '0', 'studio': '0', 'genre': genre, 'duration': duration, 'rating': rating, 'votes': votes, 'mpaa': mpaa, 'director': director, 'writer': writer, 'cast': cast, 'plot': plot, 'tagline': tagline, 'name': name, 'code': imdb, 'imdb': imdb, 'tmdb': '0', 'tvdb': '0', 'tvrage': '0', 'poster': poster, 'banner': '0', 'fanart': '0'})
            except:
                pass
コード例 #49
0
def getstream(id):
    try:

        if login() == False:
            control.log('Błędny login')
            raise ValueError('Błędny login')

        ua = control.get_setting('telewizjada.ua')
        myheaders = {'User-Agent': ua}
        token = control.get_setting('telewizjada.token')

        mainurl = 'http://www.telewizjada.net/live.php?cid=%s' % id
        myheaders['referer'] = mainurl
        sidcookie = client.request(mainurl, headers=myheaders, output='cookie')
        #control.log('SidCookie: %s' % (sidcookie))

        url = 'http://www.statsgather.com/activatehls/getstats.php'
        hlsresult = client.request(url,
                                   post='',
                                   headers=myheaders,
                                   cookie='hls_stats=%s' % token)
        control.log('GetSTAT Result: %s' % hlsresult)
        mastercookie = '%s;%s;%s;%s ' % (sidcookie, 'hlsplugin=%s' % token,
                                         'cb-enabled=accepted',
                                         'cookieView=all')
        #control.log('MASTERCOOKIE ' + mastercookie)

        url = 'http://www.telewizjada.net/net/service/verifydevice.php'
        params = json.dumps({'action': 'new', 'key': hlsresult})
        jsonmyheaders = myheaders
        jsonmyheaders['Content-Type'] = 'application/json'
        jsonmyheaders['cookie'] = mastercookie
        #result = client.request(url, post=params, headers=jsonmyheaders)
        result, h1, content, cookie10 = client.request(url,
                                                       post=params,
                                                       headers=jsonmyheaders,
                                                       output='extended')
        refreshcookie = '%s;%s;%s;%s ' % (
            sidcookie, '%s' % content['Set-Cookie'].split(';')[0],
            'cb-enabled=accepted', 'cookieView=all')
        #control.log('AccessCookie: %s|%s' % (result,content['Set-Cookie']))
        control.set_setting('telewizjada.refreshcookie', refreshcookie)
        control.set_setting('telewizjada.referer', mainurl)

        result = json.loads(result)

        if result['status'] == 'Active':
            #time.sleep(1)
            control.set_setting('telewizjada.expire', result['expire'])
            expirewhen = datetime.datetime.now() + datetime.timedelta(
                seconds=refreshtime)
            control.set_setting('telewizjada.tokenExpireIn',
                                str(int(time.mktime(expirewhen.timetuple()))))

            url = 'http://www.telewizjada.net/get_channel_data.php'
            myheaders1 = {
                'cookie': mastercookie,
                'User-Agent': ua,
                'referer': mainurl
            }
            params = {'cid': str(id)}
            result = client.request(url, post=params, headers=myheaders1)
            result = json.loads(result)
            vidlink = '%s|Cookie=%s' % (result['channelurl'], sidcookie)
            control.log('TELEWIZJADA VID %s' % vidlink)
            return vidlink

        return None

    except Exception as e:
        control.log('Error telewizjada.net .getstream %s' % e)
コード例 #50
0
ファイル: tv.py プロジェクト: anopid/filmkodi
    def imdb_list(self, url, idx=True):
        try:
            if url == self.imdbwatchlist_link:
                def imdb_watchlist_id(url):
                    return re.compile('/export[?]list_id=(ls\d*)').findall(client.request(url))[0]
                url = cache.get(imdb_watchlist_id, 8640, url)
                url = self.imdblist_link % url


            headers = {'Accept-Language': 'en-US'}
            result = str(client.request(url,headers=headers))

            try:
                if idx == True: raise Exception()
                pages = client.parseDOM(result, 'div', attrs = {'class': 'desc'})[0]
                pages = re.compile('Page \d+? of (\d*)').findall(pages)[0]
                for i in range(1, int(pages)):
                    u = url.replace('&start=1', '&start=%s' % str(i*100+1))
                    result += str(client.request(u))
            except:
                pass

            result = result.replace('\n','')
            result = result.decode('iso-8859-1').encode('utf-8')
            items = client.parseDOM(result, 'tr', attrs = {'class': '.+?'})
            items += client.parseDOM(result, 'div', attrs = {'class': 'list_item.+?'})
        except:
            return

        try:
            next = client.parseDOM(result, 'span', attrs = {'class': 'pagination'})
            next += client.parseDOM(result, 'div', attrs = {'class': 'pagination'})
            name = client.parseDOM(next[-1], 'a')[-1]
            if 'laquo' in name: raise Exception()
            next = client.parseDOM(next, 'a', ret='href')[-1]
            next = url.replace(urlparse.urlparse(url).query, urlparse.urlparse(next).query)
            next = client.replaceHTMLCodes(next)
            next = next.encode('utf-8')
        except:
            next = ''

        for item in items:
            try:
                try: title = client.parseDOM(item, 'a')[1]
                except: pass
                try: title = client.parseDOM(item, 'a', attrs = {'onclick': '.+?'})[-1]
                except: pass
                title = client.replaceHTMLCodes(title)
                title = title.encode('utf-8')

                year = client.parseDOM(item, 'span', attrs = {'class': 'year_type'})[0]
                year = re.compile('(\d{4})').findall(year)[-1]
                year = year.encode('utf-8')

                if int(year) > int((self.datetime).strftime('%Y')): raise Exception()

                name = '%s (%s)' % (title, year)
                try: name = name.encode('utf-8')
                except: pass

                imdb = client.parseDOM(item, 'a', ret='href')[0]
                imdb = 'tt' + re.sub('[^0-9]', '', imdb.rsplit('tt', 1)[-1])
                imdb = imdb.encode('utf-8')

                poster = '0'
                try: poster = client.parseDOM(item, 'img', ret='src')[0]
                except: pass
                try: poster = client.parseDOM(item, 'img', ret='loadlate')[0]
                except: pass
                if not ('_SX' in poster or '_SY' in poster): poster = '0'
                poster = re.sub('_SX\d*|_SY\d*|_CR\d+?,\d+?,\d+?,\d*','_SX500', poster)
                poster = client.replaceHTMLCodes(poster)
                poster = poster.encode('utf-8')

                genre = client.parseDOM(item, 'span', attrs = {'class': 'genre'})
                genre = client.parseDOM(genre, 'a')
                genre = ' / '.join(genre)
                if genre == '': genre = '0'
                genre = client.replaceHTMLCodes(genre)
                genre = genre.encode('utf-8')

                try: duration = re.compile('(\d+?) mins').findall(item)[-1]
                except: duration = '0'
                duration = client.replaceHTMLCodes(duration)
                duration = duration.encode('utf-8')

                try: rating = client.parseDOM(item, 'span', attrs = {'class': 'rating-rating'})[0]
                except: rating = '0'
                try: rating = client.parseDOM(rating, 'span', attrs = {'class': 'value'})[0]
                except: rating = '0'
                if rating == '' or rating == '-': rating = '0'
                rating = client.replaceHTMLCodes(rating)
                rating = rating.encode('utf-8')

                try: votes = client.parseDOM(item, 'div', ret='title', attrs = {'class': 'rating rating-list'})[0]
                except: votes = '0'
                try: votes = re.compile('[(](.+?) votes[)]').findall(votes)[0]
                except: votes = '0'
                if votes == '': votes = '0'
                votes = client.replaceHTMLCodes(votes)
                votes = votes.encode('utf-8')

                try: mpaa = client.parseDOM(item, 'span', attrs = {'class': 'certificate'})[0]
                except: mpaa = '0'
                try: mpaa = client.parseDOM(mpaa, 'span', ret='title')[0]
                except: mpaa = '0'
                if mpaa == '' or mpaa == 'NOT_RATED': mpaa = '0'
                mpaa = mpaa.replace('_', '-')
                mpaa = client.replaceHTMLCodes(mpaa)
                mpaa = mpaa.encode('utf-8')

                director = client.parseDOM(item, 'span', attrs = {'class': 'credit'})
                director += client.parseDOM(item, 'div', attrs = {'class': 'secondary'})
                try: director = [i for i in director if 'Director:' in i or 'Dir:' in i][0]
                except: director = '0'
                director = director.split('With:', 1)[0].strip()
                director = client.parseDOM(director, 'a')
                director = ' / '.join(director)
                if director == '': director = '0'
                director = client.replaceHTMLCodes(director)
                director = director.encode('utf-8')

                cast = client.parseDOM(item, 'span', attrs = {'class': 'credit'})
                cast += client.parseDOM(item, 'div', attrs = {'class': 'secondary'})
                try: cast = [i for i in cast if 'With:' in i or 'Stars:' in i][0]
                except: cast = '0'
                cast = cast.split('With:', 1)[-1].strip()
                cast = client.replaceHTMLCodes(cast)
                cast = cast.encode('utf-8')
                cast = client.parseDOM(cast, 'a')
                if cast == []: cast = '0'

                plot = '0'
                try: plot = client.parseDOM(item, 'span', attrs = {'class': 'outline'})[0]
                except: pass
                try: plot = client.parseDOM(item, 'div', attrs = {'class': 'item_description'})[0]
                except: pass
                plot = plot.rsplit('<span>', 1)[0].strip()
                if plot == '': plot = '0'
                plot = client.replaceHTMLCodes(plot)
                plot = plot.encode('utf-8')

                fanart = 'http://films4u.org/imdb/bgs/'+imdb+'.jpg'
                fanart = fanart.encode('utf-8')


                tagline = re.compile('[.!?][\s]{1,2}(?=[A-Z])').split(plot)[0]
                try: tagline = tagline.encode('utf-8')
                except: pass

                self.list.append({'title': title, 'originaltitle': title, 'year': year, 'premiered': '0', 'studio': '0', 'genre': genre, 'duration': duration, 'rating': rating, 'votes': votes, 'mpaa': mpaa, 'director': director, 'writer': '0', 'cast': cast, 'plot': plot, 'tagline': tagline, 'name': name, 'code': imdb, 'imdb': imdb, 'tmdb': '0', 'tvdb': '0', 'tvrage': '0', 'poster': poster, 'banner': '0', 'fanart': fanart, 'next': next})
            except:
                pass

        return self.list
コード例 #51
0
def login():
    try:
        if getTelewizjadaCredentialsInfo() == False:
            if control.yesnoDialog(
                    control.lang(40003).encode('utf-8'),
                    control.lang(30481).encode('utf-8'), '', 'Trakt',
                    control.lang(30483).encode('utf-8'),
                    control.lang(30482).encode('utf-8')):
                control.set_setting('telewizjada.user', '')
                control.set_setting('telewizjada.password', '')
                control.openSettings('1.20')
        control.log('>>>>  LOGIN()')

        expire = control.get_setting('telewizjada.expire')
        control.log('Expire1: %s' % expire)

        if expire != '':
            try:
                from datetime import datetime
                #d = datetime.strptime(expire, '%Y-%m-%d %H:%M:%S')
                d = datetime(
                    *(time.strptime(expire, '%Y-%m-%d %H:%M:%S')[0:6]))
                control.log('Expire2: %s' % d)

                d2 = datetime.now()
                if d > d2:
                    control.log('Expire OK: %s %s' % (d, d2))
                    return True
            except:
                pass

        url = 'http://www.deltamediaplayer.com/index.php?option=com_users&view=login&Itemid=116'
        result, h1, content, cookie1 = client.request(url, output='extended')
        headers = {'referer': url}
        result = client.parseDOM(result, 'div', attrs={'class': 'login'})[0]
        result = re.findall(
            '<input type="hidden" name="([^"]+)" value="([^"]+)"', result)
        params = {
            'username': control.get_setting('telewizjada.user'),
            'password': control.get_setting('telewizjada.pass'),
            'remember': 'yes',
            str(result[0][0]): urllib.quote(str(result[0][1])),
            str(result[1][0]): urllib.quote(str(result[1][1]))
        }
        paramslog = {
            'username': control.get_setting('telewizjada.user'),
            'password': '',
            'remember': 'yes',
            str(result[0][0]): urllib.quote(str(result[0][1])),
            str(result[1][0]): urllib.quote(str(result[1][1]))
        }
        control.log('>>>>  PARAMS %s' % (paramslog))

        url = 'http://www.deltamediaplayer.com/index.php?option=com_users&task=user.login'

        result, h2, content, cookie2 = client.request(url,
                                                      redirect=False,
                                                      post=params,
                                                      headers=headers,
                                                      cookie=cookie1,
                                                      output='extended')

        if content[
                'Location'] != 'https://www.deltamediaplayer.com/index.php?option=com_users&view=profile':
            control.infoDialog(control.lang(30600).encode('utf-8'), time=6000)
            control.dialog.ok(
                control.addonInfo('name') + ' - Telewizzjada.net',
                control.lang(30600).encode('utf-8'), '')
            raise ValueError('Bledny login lub haslo.')

        url = 'http://www.deltamediaplayer.com/playercode/authorised/gethlsusers.php'
        headers[
            'referer'] = 'http://www.deltamediaplayer.com/index.php?option=com_acctexp&view=user&layout=subscriptiondetails&Itemid=119'
        headers['X-Requested-With'] = 'XMLHttpRequest'
        headers['Content-Type'] = 'application/json'
        headers['cookie'] = '%s; %s' % (cookie1,
                                        content['Set-Cookie'].split(';')[0])
        params2 = json.dumps({'browser': 'Desktop;Windows;Chrome 54'})
        result = client.request(url, post=params2, headers=headers)
        control.log('>>>>  RES r:%s ' % (result))

        r = json.loads(result)

        result = [i for i in r if i['registered'] != 0]

        if len(result) > 0:
            for i in result:
                control.log('I %s' % i)

            control.log('QQQQQQQQQQQQQQ %s' % r[0]['hash'], )
            control.set_setting('telewizjada.token', r[0]['hash'])
            control.set_setting('telewizjada.os', r[0]['os'])
            control.set_setting('telewizjada.browser', r[0]['browser'])
            control.set_setting('telewizjada.device', r[0]['device'])
            control.log("Brovser: %s" % r[0]['browser'].split(' ')[0])
            ua = 'Mozilla/5.0 (%s; %s; rv:%s) Gecko/20100101 %s/%s' % (
                r[0]['os'], r[0]['device'], r[0]['browser'].split(' ')[-1],
                r[0]['browser'].split(' ')[0], r[0]['browser'].split(' ')[-1])
            control.log('UA %s' % ua)
            control.set_setting('telewizjada.ua', ua)
            return True

        else:
            control.infoDialog(control.lang(30601).encode('utf-8'), time=6000)
            control.dialog.ok(
                control.addonInfo('name') + ' - Telewizzjada.net',
                control.lang(30601).encode('utf-8'), '')
            raise ValueError('Brak zarejestrowanych przeglądarek.')
        return False

    except Exception as e:
        control.log('Exception telewizjada.net login %s' % e)
        return False
コード例 #52
0
def getstream(id):
    try:

        if yoylogin():
            cookie = control.get_setting('yoytv.sess').strip()
            control.log('#####   cookie2: %s' % cookie)
            url = 'http://yoy.tv/channels/%s' % id
            result = client.request(url, cookie=cookie)

            if 'http://yoy.tv/accept/' in result:
                if 'true' == control.get_setting('xxxmode'):
                    control.log('EROTYK ')
                    u1 = client.parseDOM(result, 'form', ret='action')[0]
                    params = {}
                    params['_token'] = client.parseDOM(result, 'input', ret='value', attrs={'name': '_token'})[0]
                    control.log('params: %s' % params['_token'])
                    result = client.request(u1, data=params, cookie=cookie)
                else:
                    control.infoDialog(control.lang(30799).encode('utf-8') + ' ' +control.lang(30798).encode('utf-8'))
                    return None

            if '<title>Kup konto premium w portalu yoy.tv</title>' in result:
                control.infoDialog(control.lang(30485).encode('utf-8'))
                return None

            myobj = client.parseDOM(result, 'object', ret='data', attrs={'type': 'application/x-shockwave-flash'})[0].encode('utf-8')
            result = client.parseDOM(result, 'param', ret='value', attrs={'name': 'FlashVars'})[0].encode('utf-8')
            control.log("YOY res: %s |%s| "  % (result,myobj))

            p = urlparse.parse_qs(result)
            #control.log('# %s' % query)
            control.log('# %s' % p)
            control.log('# %s' % p['fms'])
            control.log('# %s' % p['cid'])

            #lpi = result.index("s=") + result.index("=") * 3
            #control.log('# %s' )
            #rpi = result.index("&", lpi) - result.index("d") * 2
            #dp=[]
            #cp=result[lpi:rpi].split('.')
            #for i, item in enumerate(cp):
            #    j = 2 ^ i ^ ((i ^ 3) >> 1)
            #    k = 255 - int(cp[j])
            #    dp.append(k)
            #myip = '.'.join(map(str, dp))
            #control.log("YOY myip: %s " % (myip))

            #myplaypath='%s?email=%s&secret=%s&hash=%s' %(result['cid'],result['email'],result['secret'],result['hash'])
            #myurl = 'rtmp://'+myip + ' app=yoy/_definst_ playpath=' + myplaypath + ' swfUrl=' + myobj + \
            #        ' swfVfy=true tcUrl=' + 'rtmp://'+myip+'/yoy/_definst_ live=true timeout=15 pageUrl=' + url

            myurl = p['fms'][0] + '/' + p['cid'][0] + ' swfUrl=' + myobj + ' swfVfy=true tcUrl=' + p['fms'][
                0] + '/_definst_ live=true timeout=15 pageUrl=' + url
            myurl = p['fms'][0] + '/' + p['cid'][0] + ' swfUrl=' + myobj + ' swfVfy=true live=true timeout=15 pageUrl=' + url

            #        ' swfVfy=true tcUrl=' + 'rtmp://'+myip+'/oyo/_definst_ live=true pageUrl=' + url
            control.log("########## TAB:%s" % myurl)
            #myurl = myurl.replace('oyo','yoy')


            return myurl
        else:
            return None

    except Exception as e:
        control.log('Error yoy.getstream %s' % e)
        return None