Update for uprot

This commit is contained in:
UrloMythus
2026-05-02 21:33:05 +02:00 Unverified
parent 0f1f5478c3
commit 5d8f1249fe
+15 -3
View File
@@ -89,13 +89,18 @@ async def generate_uprot_txt(numbers,cookies,client):
logger.info(f'Uprot failed to generate captcha cookie: {e}')
return False
async def get_maxstream_link(text,client):
async def find_link(text,client):
soup = BeautifulSoup(text,'lxml',parse_only=SoupStrainer('a'))
a_tags = soup.find_all('a')
max_stream = None
for tag in a_tags:
if 'C O N T I N U E' in tag.text.upper():
if 'C O N T I N U E' in tag.text.upper() or 'CONTINUE' in tag.text.upper() :
max_stream = tag['href']
return max_stream
async def get_maxstream_link(text,client):
max_stream = await find_link(text,client)
if max_stream:
redirect = max_stream
time = 0
@@ -103,13 +108,19 @@ async def get_maxstream_link(text,client):
response = await client.head(ForwardProxy + max_stream,headers=headers,impersonate = 'chrome', allow_redirects = True, proxies = proxies)
redirect = response.url
time+=1
if time == 1000:
if time == 10:
return False
max_stream = 'https://maxstream.video/emvvv/' + response.url.split('watchfree/')[1].split('/')[1]
return max_stream
async def bypass_uprot(client,link):
try:
if 'msfi' not in link:
if 'msf' in link:
link = link.replace('msf','mse')
response = await client.get(ForwardProxy + link, headers=headers, impersonate = 'chrome', proxies = proxies)
max_stream = await find_link(response.text,client)
else:
if 'mse' in link:
link = link.replace('mse','msf')
current_directory = os.path.dirname(os.path.abspath(__file__))
@@ -122,6 +133,7 @@ async def bypass_uprot(client,link):
response = await client.post(ForwardProxy + link, cookies=cookies, headers=headers, data =data, impersonate = 'chrome', proxies = proxies)
max_stream = await get_maxstream_link(response.text,client)
return max_stream
except Exception as e:
logger.info(f'Uprot failed: {e}')
if '[Errno 2] No such file or directory' in e: