Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
SenZmaKi committed Jun 30, 2024
1 parent 02b46bd commit 985fb3e
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions senpwai/scrapers/pahe/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,28 +320,16 @@ def get_kwik_page_link(
pahewin_link: str, browser_name: BrowserName | None = None
) -> str:
use_selenium = browser_name is not None
if DRIVER_MANAGER.driver and use_selenium:
DRIVER_MANAGER.driver.get(pahewin_link)
pahewin_html_page = DRIVER_MANAGER.driver.page_source
else:
response = CLIENT.get(pahewin_link)
if response.status_code == 403:
if browser_name is None:
raise DetectedAsBotException()
else:
DRIVER_MANAGER.setup_driver(browser_name)
driver = cast(DriverManager.type_driver, DRIVER_MANAGER.driver)
driver.get(pahewin_link)
print(driver.page_source)
time.sleep(5)
print()
print(driver.page_source)
pahewin_html_page = driver.page_source
else:
pahewin_html_page = response.text
headers = CLIENT.append_headers({"Referer": "https://animepahe.ru/play/882b2558-5755-b40b-88cf-7ec89b2b86b1/927faf1494e51b36f03f21e9476d917eebec820aa1f712b8f4645cf528374918"})
response = CLIENT.get(pahewin_link)
pahewin_html_page = response.text
print(pahewin_html_page)
print(response.status_code)
kwik_page_link = cast(
re.Match[str], KWIK_PAGE_REGEX.search(pahewin_html_page)
).group()
if kwik_page_link:
print("WORKED ONCE!!!")
return kwik_page_link

def get_direct_download_links(
Expand Down

0 comments on commit 985fb3e

Please sign in to comment.