Skip to content

Commit

Permalink
fixes voe (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
speedyconzales authored Dec 8, 2024
1 parent e8edd77 commit 695dce8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/html_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import urllib.request
import zipfile

from base64 import b64decode
from random import choices
from string import ascii_letters, digits
from time import time
Expand Down Expand Up @@ -62,7 +63,7 @@ def get_voe_content_link_with_selenium(provider_url):
driver.quit()
return content_link
voe_play_div = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.CLASS_NAME, 'voe-play'))
EC.presence_of_element_located((By.CSS_SELECTOR, "[aria-label='Play']"))
)
voe_play_div.click()
video_in_media_provider = WebDriverWait(driver, 10).until(
Expand All @@ -79,6 +80,13 @@ def voe_pattern_search(decoded_html):
continue
content_link = match.group("url")
if content_link_is_not_valid(content_link):
try:
content_link = b64decode(content_link).decode()
if content_link_is_not_valid(content_link):
continue
return content_link
except Exception:
pass
continue
return content_link

Expand Down

0 comments on commit 695dce8

Please sign in to comment.