コード例 #1
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        html = self.net.http_GET(web_url, headers=headers).content

        sources = helpers.get_dom(html, 'video_sources')
        if sources:
            sources = re.findall('name\s*=\s*[\'|"]([^\'"]+).+?streamable.+?>([^<]+)', sources[0])
            source = helpers.pick_source(helpers.sort_sources_list(sources))
            if source.startswith('//'): source = 'http:' + source
            return source.replace('&amp;', '&')

        raise ResolverError('Stream not found')
コード例 #2
0
ファイル: videa.py プロジェクト: tug912/JUL1EN094-xbmc-addons
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content

        sources = helpers.get_dom(html, 'video_sources')
        if sources:
            sources = re.findall('name\s*=\s*[\'|"]([^\'"]+).+?streamable.+?>([^<]+)', sources[0])
            sources = sorted(sources, key=lambda x: x[0])[::-1]
            source = helpers.pick_source(sources)
            if source.startswith('//'): source = 'http:' + source
            return source

        raise ResolverError('Stream not found')
コード例 #3
0
ファイル: videa.py プロジェクト: amadu80/repository.xvbmc
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        html = self.net.http_GET(web_url, headers=headers).content

        sources = helpers.get_dom(html, 'video_sources')
        if sources:
            sources = re.findall('name\s*=\s*[\'|"]([^\'"]+).+?streamable.+?>([^<]+)', sources[0])
            if sources[-1][0].lower() == 'lq': sources = sources[::-1]
            source = helpers.pick_source(sources)
            if source.startswith('//'): source = 'http:' + source
            return source

        raise ResolverError('Stream not found')