Exemplo n.º 1
0
def WyswietlanieLinkow():
    Logowanie(False)
    cookie = cache.cache_get('dramaqueen_cookie')['value']
    headersget.update({'Cookie': cookie})

    url = params['url']
    name = params['name']

    html = requests.get(url, headers=headersget, timeout=15).text
    LoginCheck(html)
    results = [
        item for item in parseDOM(
            html, 'section', attrs={'class': 'av_toggle_section ' + r'.+?'})
    ]

    if name.startswith('Odcinek '):
        index = int(re.findall('\d+', name)[0])
        avlinks = [parseDOM(item, 'a', ret='href')
                   for item in results][index - 1]
        avplayers = [parseDOM(item, 'button') for item in results][index - 1]

    elif 'tłumaczeni' in name:
        pass
    elif 'korekta' in name:
        pass
    else:

        avlinks = [parseDOM(item, 'a', ret='href') for item in results][0]
        avplayers = [parseDOM(item, 'button') for item in results][0]

    addon.SourceSelect(players=avplayers, links=avlinks, title=name)
Exemplo n.º 2
0
def WyswietlanieLinkow():

    cookie = cache.cache_get('dramaqueen_cookie')['value']
    headersget.update({'Cookie': cookie})

    url = params['url']
    name = params['name']

    if name.startswith('Odcinek '):
        index = int(re.findall('\d+', name)[0])
        rEL = requests.get(url, headers=headersget, timeout=15).content
        LoginCheck(rEL)

        results = [
            item for item in parseDOM(rEL, 'section')
            if 'https://www.dramaqueen.pl/player.html' in item
        ]
        avDlinks = [parseDOM(item, 'a', ret='href')
                    for item in results][index - 1]
        avDplayers = [parseDOM(item, 'button') for item in results][index - 1]

        addon.SourceSelect(players=avDplayers, links=avDlinks, title=name)
    elif 'tłumaczeni' in name:
        pass
    elif 'korekta' in name:
        pass
    else:
        rML = requests.get(url, headers=headersget, timeout=15).content
        LoginCheck(rML)

        results2 = [
            item for item in parseDOM(
                rML, 'section', attrs={'class': 'av_toggle_section'})
        ]
        avMlinks = [parseDOM(item, 'a', ret='href') for item in results2][0]
        avMplayers = [parseDOM(item, 'button') for item in results2][0]

        addon.SourceSelect(players=avMplayers, links=avMlinks, title=name)
Exemplo n.º 3
0
def ListLinks():

    section = params['section']
    name = params['name']
    url = params['url']
    subdir = params['subdir']
    
    result = requests.get(url, timeout=15).text
    result = parseDOM(result, 'div', attrs={'id': 'video-player-control'})[0]
    player = [re.sub('<img src(.+?)">','',item) for item in 
              parseDOM(result, 'div', attrs={'class': 'video-player-mode'})]
    link = [encryptPlayerUrl(item) for item in parseDOM(result, 'div',
            attrs={'class': 'video-player-mode'} , ret='data-hash')]

    addon.SourceSelect(players=player, links=link, title=name, subdir=subdir)
Exemplo n.º 4
0
def ListLinks():
    Logowanie()

    url = params['url']
    section = params['section']
    name = params['name']
    subdir = params['subdir']

    cookie = cache.cache_get('db_cookie')['value']
    headersget.update({'Cookie': cookie})
    headers = headersget

    html = requests.get(url, headers=headers, timeout=10).text
    result = parseDOM(html, 'table', attrs={'id': 'video-table'})[0]

    results = parseDOM(result, 'tr', attrs={'title': 'Kliknij' + r'.+?'})
    playerlink = [
        mainLink + re.sub('^/', '',
                          parseDOM(item, 'a', ret='href')[0])
        for item in results
    ]
    playername = [parseDOM(item, 'a')[0] for item in results]
    player = []

    playerdetails = [parseDOM(item, 'td') for item in results]
    playersubs = [
        re.sub('<span(.+?)span>', '',
               parseDOM(item, 'td')[2]) for item in results
    ]
    playeraudio = [parseDOM(item, 'td')[1] for item in results]
    playerquality = [parseDOM(item, 'td')[4] for item in results]

    for item in zip(playername, playersubs, playeraudio, playerquality):
        if 'VIP' in item[0]:
            playertitle = item[
                0] + '   ' + '[COLOR=red] brak obsługi [/COLOR]'  #'[COLOR=green] napisy %s - audio %s - %s [/COLOR]' % (item[1], item[2], item[3])
        else:
            playertitle = item[
                0] + '   ' + '[COLOR=green] napisy %s - audio %s - %s [/COLOR]' % (
                    item[1], item[2], item[3])
        player.append(playertitle)

    addon.SourceSelect(player, playerlink, name, subdir)
Exemplo n.º 5
0
def ListLinks():

    name = params['name']
    url = params['url']
    section = params['section']
    subdir = params['subdir']

    if section == 'online':

        Logowanie()
        cookie = cache.cache_get('shinden_cookie')['value']
        headersget.update({'Cookie': cookie})
        headers = headersget

        html = requests.get(url, headers=headers, timeout=15).text
        result = [item for item in parseDOM(html, 'tbody') if 'player' in item]
        results = parseDOM(result, 'tr')

        playerinfo = [
            re.findall('data-episode=\'(.+?)\' ', item) for item in results
        ]

        code = re.findall("""_Storage\.basic.*=.*'(.*?)'""", html)[0]
        playerdata = [json.loads(item[0]) for item in playerinfo]

        playerlink = []
        player = []
        for i in playerdata:
            title = i['player'] + '[COLOR=green]%s[/COLOR]' % (
                '     ' + 'Audio' + ' ' + i['lang_audio'] +
                ('' if (i['lang_subs'] == '') or
                 (i['lang_subs'] == None) else '   SUB  ' + i['lang_subs']))
            player.append(title)
            ID = (i['online_id'])

            link = "https://api4.shinden.pl/xhr/%s/player_load?auth=%s" % (
                ID, code)
            playerlink.append(link)

        addon.SourceSelect(player, playerlink, name, subdir)
    else:
        return
Exemplo n.º 6
0
def List_Links():

    url = params['url']
    section = urllib.parse.unquote_plus(params['section'])
    page = urllib.parse.unquote_plus(params['page'])
    title = params['name']
    subdir = urllib.parse.unquote_plus(params['subdir'])

    if section == 'polecane':
        result = requests.get(url).text
        result = parseDOM(result, 'table', attrs={'class': 'lista'})
        result = parseDOM(result, 'tr', attrs={'class': 'lista_hover'})

        status = [
            parseDOM(item, 'td', attrs={'class': 'center'})[1]
            for item in result
        ]
        player = [
            parseDOM(item, 'td', attrs={'class': 'center'})[2]
            for item in result
        ]
        tlumacz = [
            parseDOM(item, 'td', attrs={'class': 'center'})[3]
            for item in result
        ]
        Player = []
        for item in zip(player, tlumacz):
            test = item[0] + '   ' + '[COLOR %s]%s[/COLOR]' % ('green',
                                                               item[1])
            Player.append(test)
        kodlinku = [
            page + 'odtwarzacz-' + parseDOM(
                item, 'span', attrs={'class': 'odtwarzacz_link'}, ret='rel')[0]
            + '.html' for item in result
        ]
        link = []
        for item in kodlinku:
            try:
                temp = requests.get(item).text
                if 'vk.com' in temp:

                    l1 = parseDOM(temp,
                                  'span',
                                  attrs={'class': 'odtwarzaj_vk'},
                                  ret='rel')[0]
                    l2 = parseDOM(temp,
                                  'span',
                                  attrs={'class': 'odtwarzaj_vk'},
                                  ret='id')[0]
                    temp = 'https://vk.com/video' + l1 + '_' + l2
                else:
                    temp = parseDOM(temp, 'iframe', ret='src')[0]
                link.append(temp)

            except:
                continue
        addon.SourceSelect(Player, link, title, subdir)

    elif section == 'multi':
        result = requests.get(url).text
        slice = GetDataBeetwenMarkers(result,
                                      '<h1 class="pod_naglowek">' + page,
                                      '</table>', False)[1]
        results = [
            item
            for item in parseDOM(slice, 'tr', attrs={'class': 'lista_hover'})
            if title in item
        ]
        kodlinku = parseDOM(results,
                            'span',
                            attrs={'class': 'odtwarzacz_link'},
                            ret='rel')

        link = []
        player = []
        for item in kodlinku:
            try:
                item = mainLink + 'odtwarzacz-' + item + '.html'
                temp = requests.get(item).text
                if 'vk.com' in temp:

                    l1 = parseDOM(temp,
                                  'span',
                                  attrs={'class': 'odtwarzaj_vk'},
                                  ret='rel')[0]
                    l2 = parseDOM(temp,
                                  'span',
                                  attrs={'class': 'odtwarzaj_vk'},
                                  ret='id')[0]
                    temp = 'https://vk.com/video' + l1 + '_' + l2
                else:
                    temp = parseDOM(temp, 'iframe', ret='src')[0]
                link.append(temp)
                player.append('Oglądaj')
            except:
                continue
        addon.SourceSelect(players=player,
                           links=link,
                           title=title,
                           subdir=subdir)

    elif section == 'other':
        result = requests.get(url).text
        results = [
            item
            for item in parseDOM(result, 'tr', attrs={'class': 'lista_hover'})
            if title in item
        ]
        kodlinku = parseDOM(results,
                            'span',
                            attrs={'class': 'odtwarzacz_link'},
                            ret='rel')

        link = []
        player = []
        for item in kodlinku:
            try:
                item = mainLink + 'odtwarzacz-' + item + '.html'
                temp = requests.get(item).text
                if 'vk.com' in temp:

                    l1 = parseDOM(temp,
                                  'span',
                                  attrs={'class': 'odtwarzaj_vk'},
                                  ret='rel')[0]
                    l2 = parseDOM(temp,
                                  'span',
                                  attrs={'class': 'odtwarzaj_vk'},
                                  ret='id')[0]
                    temp = 'https://vk.com/video' + l1 + '_' + l2
                else:
                    temp = parseDOM(temp, 'iframe', ret='src')[0]
                link.append(temp)
                player.append('Oglądaj')
            except:
                continue

        addon.SourceSelect(players=player,
                           links=link,
                           title=title,
                           subdir=subdir)