Try in youtube
This commit is contained in:
+8
-5
@@ -43,11 +43,14 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
addon_dir = xbmc.translatePath( my_addon.getAddonInfo('path') )
|
addon_dir = xbmc.translatePath( my_addon.getAddonInfo('path') )
|
||||||
sys.path.append(filetools.join( addon_dir, 'resources', 'lib' ) )
|
sys.path.append(filetools.join( addon_dir, 'resources', 'lib' ) )
|
||||||
from youtube_resolver import resolve
|
from youtube_resolver import resolve
|
||||||
for stream in resolve(page_url):
|
try:
|
||||||
# title = scrapertools.find_single_match(stream['title'], '(\d+p)')
|
for stream in resolve(page_url):
|
||||||
if scrapertools.find_single_match(stream['title'], r'(\d+p)'):
|
# title = scrapertools.find_single_match(stream['title'], '(\d+p)')
|
||||||
video_urls.append([re.sub(r'(\[[^\]]+\])', '', stream['title']), stream['url']])
|
if scrapertools.find_single_match(stream['title'], r'(\d+p)'):
|
||||||
video_urls.sort(key=lambda it: int(it[0].split("p", 1)[0]))
|
video_urls.append([re.sub(r'(\[[^\]]+\])', '', stream['title']), stream['url']])
|
||||||
|
video_urls.sort(key=lambda it: int(it[0].split("p", 1)[0]))
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
return video_urls
|
return video_urls
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user