Update for uprot
This commit is contained in:
@@ -89,13 +89,18 @@ async def generate_uprot_txt(numbers,cookies,client):
|
|||||||
logger.info(f'Uprot failed to generate captcha cookie: {e}')
|
logger.info(f'Uprot failed to generate captcha cookie: {e}')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
async def get_maxstream_link(text,client):
|
|
||||||
|
async def find_link(text,client):
|
||||||
soup = BeautifulSoup(text,'lxml',parse_only=SoupStrainer('a'))
|
soup = BeautifulSoup(text,'lxml',parse_only=SoupStrainer('a'))
|
||||||
a_tags = soup.find_all('a')
|
a_tags = soup.find_all('a')
|
||||||
max_stream = None
|
max_stream = None
|
||||||
for tag in a_tags:
|
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']
|
max_stream = tag['href']
|
||||||
|
|
||||||
|
return max_stream
|
||||||
|
async def get_maxstream_link(text,client):
|
||||||
|
max_stream = await find_link(text,client)
|
||||||
if max_stream:
|
if max_stream:
|
||||||
redirect = max_stream
|
redirect = max_stream
|
||||||
time = 0
|
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)
|
response = await client.head(ForwardProxy + max_stream,headers=headers,impersonate = 'chrome', allow_redirects = True, proxies = proxies)
|
||||||
redirect = response.url
|
redirect = response.url
|
||||||
time+=1
|
time+=1
|
||||||
if time == 1000:
|
if time == 10:
|
||||||
return False
|
return False
|
||||||
max_stream = 'https://maxstream.video/emvvv/' + response.url.split('watchfree/')[1].split('/')[1]
|
max_stream = 'https://maxstream.video/emvvv/' + response.url.split('watchfree/')[1].split('/')[1]
|
||||||
return max_stream
|
return max_stream
|
||||||
|
|
||||||
async def bypass_uprot(client,link):
|
async def bypass_uprot(client,link):
|
||||||
try:
|
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:
|
if 'mse' in link:
|
||||||
link = link.replace('mse','msf')
|
link = link.replace('mse','msf')
|
||||||
current_directory = os.path.dirname(os.path.abspath(__file__))
|
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)
|
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)
|
max_stream = await get_maxstream_link(response.text,client)
|
||||||
return max_stream
|
return max_stream
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.info(f'Uprot failed: {e}')
|
logger.info(f'Uprot failed: {e}')
|
||||||
if '[Errno 2] No such file or directory' in e:
|
if '[Errno 2] No such file or directory' in e:
|
||||||
|
|||||||
Reference in New Issue
Block a user