This commit is contained in:
Alhaziel01
2022-12-02 12:45:51 +01:00
parent e94cea605e
commit a6cbd81dbb

View File

@@ -25,15 +25,17 @@ def test_video_exists(page_url):
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
logger.info("(page_url='%s')" % page_url)
# from core import support
from core import support
# support.dbg()
video_urls = []
video_srcs = support.match(data, patron=r"src: '([^']+)'")
video_srcs = scrapertools.find_multiple_matches(data, r"src: '([^']+)'")
if not video_srcs:
bloque = scrapertools.find_single_match(data, "sources.*?\}")
# bloque = scrapertools.find_single_match(data, "sources.*?\}")
# video_srcs = support.match(bloque, patron=': "([^"]+)', debug=True)
video_srcs = scrapertools.find_multiple_matches(bloque, ''': ['"]([^'"]+)''')
for url in video_srcs:
video_urls.append([url.split('.')[-1] + " [Voe]", url])
video_srcs = support.match(data, patronBlock=r'sources [^\{]+{([^}]+)', patron=r'''['"]([^'"]+)[^:]+: ['"]([^'"]+)['"]''').matches
for ext, url in video_srcs:
video_urls.append([ext + " [Voe]", url])
return video_urls