diff --git a/Src/API/animeworld.py b/Src/API/animeworld.py index c88145a..83390f2 100644 --- a/Src/API/animeworld.py +++ b/Src/API/animeworld.py @@ -47,16 +47,12 @@ showname_replace = { "-": "" } async def security_cookie (response): - if "SecurityAW-gl" in response.text: - match = re.search(r'SecurityAW-gl=([^;]+)', response.text) - characters = "gl" - elif "SecurityAW-Ec" in response.text: - match = re.search(r'SecurityAW-Ec=([^;]+)', response.text) - characters = "Ec" + match = re.search(r'SecurityAW-([A-Za-z0-9]{2})=([^;]+)', response.text) if match: - Security_Cookie = match.group(1).strip() + unknown_chars = match.group(1).strip() + Security_Cookie = match.group(2).strip() cookies = { - f"SecurityAW-{characters}": Security_Cookie + f"SecurityAW-{unknown_chars}": Security_Cookie } return cookies async def get_mp4(anime_url,ismovie,episode,client): diff --git a/Src/API/streamingwatch.py b/Src/API/streamingwatch.py index 3f2424a..246b2a9 100644 --- a/Src/API/streamingwatch.py +++ b/Src/API/streamingwatch.py @@ -50,7 +50,7 @@ async def search(showname,season,episode,date,ismovie,client): if date == page_date: href = temp_href['href'] href = soup.find('a')['href'] - response = await client.get(href, allow_redirects=True, impersonate = "chrome120") + response = await client.get(href, allow_redirects=True, impersonate = "chrome124") soup = BeautifulSoup(response.text,'lxml',parse_only=SoupStrainer('iframe')) iframe = soup.find('iframe') hdplayer = iframe.get('data-lazy-src') @@ -66,14 +66,15 @@ async def search(showname,season,episode,date,ismovie,client): data_json = response.text data = json.loads(data_json) for entry in data: - if f"stagione-{season}-episodio-{episode}" in entry["slug"] and f"stagione-{season}-episodio-{episode}0" not in entry["slug"]: - content = entry["content"]["rendered"] + if f"stagione-{season}-episodio-{episode}" in entry["slug"] or f"stagione-{season}-episode-{episode}" in entry["slug"]: + if f"stagione-{season}-episodio-{episode}0" not in entry["slug"]: + content = entry["content"]["rendered"] #"content":{ # "rendered":"