Add auto-update domains + some bug fix

This commit is contained in:
UrloMythus
2026-02-09 16:49:20 +01:00 Unverified
parent bafd7e2d07
commit cef29094dc
8 changed files with 113 additions and 12 deletions
+16 -3
View File
@@ -9,6 +9,7 @@ from Src.API.extractors.uqload import uqload
from Src.API.extractors.dropload import dropload
import logging
from Src.Utilities.config import setup_logging
from Src.Utilities.update_config import update_site
import json
import random
level = config.LEVEL
@@ -36,7 +37,15 @@ if GF_ForwardProxy == "1":
else:
ForwardProxy = ""
async def new_domain(url,data,headers,proxies,ForwardProxy,client):
url = url.split('/wp-admin')[0]
headers['Origin'] = url
headers['Referer'] = f'{url}/'
response = await client.post(ForwardProxy + f'{url}/wp-admin/admin-ajax.php', data = data, headers = headers, proxies = proxies)
if response.status_code != 200:
logger.warning(f"Guardaflix Failed to fetch search results: {response.status_code}")
result = update_site(client,['guardaplay','Guardaflix'])
return response.text
async def get_player(page_link,MFP, MFP_CREDENTIALS,client, headers,streams):
response = await client.get(ForwardProxy + page_link, headers= headers, proxies = proxies)
@@ -63,9 +72,13 @@ async def search(showname,date,MFP,MFP_CREDENTIALS,client,streams):
'term': showname,
}
response = await client.post(ForwardProxy + f'{GF_DOMAIN}/wp-admin/admin-ajax.php', headers=headers, data=data, proxies = proxies)
text = response.text
if response.status_code != 200:
logger.warning(f"Guardaflix Failed to fetch search results: {response.status_code}")
soup = BeautifulSoup(response.text,'lxml', parse_only= SoupStrainer('a'))
if response.status_code == 400:
text = await new_domain(response.url,data,headers,proxies,ForwardProxy,client)
if len(text) < 10:
logger.warning(f"Guardaflix Failed to fetch search results: {response.status_code}")
soup = BeautifulSoup(text,'lxml', parse_only= SoupStrainer('a'))
a_tags = soup.find_all('a')
for a in a_tags:
href = a['href']