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('&', '&') raise ResolverError('Stream not found')
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')
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')