add turbovid extractor
This commit is contained in:
@@ -127,7 +127,7 @@ async def scraping_links(atag,MFP,MFP_CREDENTIALS,client,streams,language):
|
||||
pattern = r'<a\s+href="([^"]+)"[^>]*rel="noopener"[^>]*>DeltaBit</a>'
|
||||
href = await get_host_link(pattern,atag,client)
|
||||
try:
|
||||
streams = await deltabit(href,client,streams,"Eurostreaming",proxies,ForwardProxy,language)
|
||||
streams = await deltabit(href,client,streams,"Eurostreaming",proxies,ForwardProxy,language,'Deltabit')
|
||||
except Exception as e:
|
||||
pattern = r'<a\s+href="([^"]+)"[^>]*rel="noopener"[^>]*>MixDrop</a>'
|
||||
href = await get_host_link(pattern,atag,client)
|
||||
@@ -145,7 +145,7 @@ async def scraping_links(atag,MFP,MFP_CREDENTIALS,client,streams,language):
|
||||
try:
|
||||
pattern = r'<a\s+href="([^"]+)"[^>]*rel="noopener"[^>]*>DeltaBit</a>'
|
||||
href = await get_host_link(pattern,atag,client)
|
||||
streams = await deltabit(href,client,streams,"Eurostreaming",proxies,ForwardProxy,language)
|
||||
streams = await deltabit(href,client,streams,"Eurostreaming",proxies,ForwardProxy,language,'Deltabit')
|
||||
return streams
|
||||
except Exception as e:
|
||||
return streams
|
||||
@@ -159,6 +159,14 @@ async def scraping_links(atag,MFP,MFP_CREDENTIALS,client,streams,language):
|
||||
return streams
|
||||
except Exception as e:
|
||||
return streams
|
||||
if 'Deltabit' not in atag and 'Mixdrop' not in atag and 'Maxstream' not in atag and 'Turbovid' in atag:
|
||||
try:
|
||||
pattern = r'<a\s+href="([^"]+)"[^>]*rel="noopener"?[^>]*>Turbovid</a>'
|
||||
href = await get_host_link(pattern,atag,client)
|
||||
streams = await deltabit(href,client,streams,"Eurostreaming",proxies,ForwardProxy,language,'Turbovid')
|
||||
return streams
|
||||
except Exception as e:
|
||||
return streams
|
||||
if 'DeltaBit' not in atag and 'MixDrop' not in atag and 'MaxStream' not in atag:
|
||||
logger.info("Just give up")
|
||||
return streams
|
||||
@@ -244,7 +252,7 @@ async def eurostreaming(streams,id,client,MFP,MFP_CREDENTIALS):
|
||||
async def test_euro():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
results = await eurostreaming({'streams': []},"tt0460681:11:1",client,"0",['test','test'])
|
||||
results = await eurostreaming({'streams': []},"tt1520211:1:1",client,"0",['test','test'])
|
||||
print(results)
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import re
|
||||
import time
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
from Src.Utilities.eval import eval_solver
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
Icon = config.Icon
|
||||
@@ -15,9 +16,8 @@ random_headers = Headers()
|
||||
|
||||
|
||||
|
||||
async def deltabit(page_url,client,streams,site_name,proxies,ForwardProxy,language):
|
||||
async def deltabit(page_url,client,streams,site_name,proxies,ForwardProxy,language,extractor):
|
||||
"""Extract Deltabit URL."""
|
||||
i = 0
|
||||
#Set up some headers
|
||||
headers = random_headers.generate()
|
||||
headers2 = random_headers.generate()
|
||||
@@ -46,25 +46,34 @@ async def deltabit(page_url,client,streams,site_name,proxies,ForwardProxy,langua
|
||||
name = input.get('name')
|
||||
value = input.get('value')
|
||||
data[name] = value
|
||||
data['imhuman'] = ''
|
||||
if extractor == 'Deltabit':
|
||||
imhuman = ''
|
||||
elif extractor == 'Turbovid':
|
||||
imhuman = 'Proceed+to+video'
|
||||
data['imhuman'] = imhuman
|
||||
data['referer']= page_url
|
||||
#We need to wait 2.5 seconds or the request will fail
|
||||
#We need to wait 2.5/5 seconds or the request will fail
|
||||
if extractor == 'Deltabit':
|
||||
time.sleep(2.5)
|
||||
|
||||
elif extractor == 'Turbovid':
|
||||
time.sleep(5)
|
||||
|
||||
fname = data['fname']
|
||||
#Request to the deltabit link
|
||||
response = await client.post(ForwardProxy + page_url, data = data, headers = headers, proxies = proxies)
|
||||
if extractor == 'Deltabit':
|
||||
link = re.findall(r'sources:\s*\["([^"]+)"', response.text, re.DOTALL)
|
||||
if not link:
|
||||
if not i >= 3:
|
||||
page_url = 'https://deltabit.co/q4r8w4assff4'
|
||||
link,fname = await deltabit(page_url,client,streams,site_name,proxies,ForwardProxy,language)
|
||||
i +=1
|
||||
else:
|
||||
link = link[0]
|
||||
if link:
|
||||
streams['streams'].append({'name': f"{Name}{language}",'title': f'{Icon}{site_name}\n▶️ Deltabit\n{fname}', 'url': link, 'behaviorHints': {'bingeGroup': f'{site_name.lower()}'}})
|
||||
link = link[0]
|
||||
elif extractor == 'Turbovid':
|
||||
link = await eval_solver(response.text,proxies, ForwardProxy, client)
|
||||
if not link:
|
||||
i = 0
|
||||
if not i >= 3:
|
||||
link,fname = await deltabit(page_url,client,streams,site_name,proxies,ForwardProxy,language,extractor)
|
||||
i +=1
|
||||
if link:
|
||||
streams['streams'].append({'name': f"{Name}{language}",'title': f'{Icon}{site_name}\n▶️ {extractor}\n{fname}', 'url': link, 'behaviorHints': {'bingeGroup': f'{site_name.lower()}'}})
|
||||
|
||||
|
||||
return streams
|
||||
@@ -76,7 +85,7 @@ async def deltabit(page_url,client,streams,site_name,proxies,ForwardProxy,langua
|
||||
async def test_deltabit():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
results = await deltabit("https://deltabit.co/a54ehb8w42pe",client,{'streams': []},'Deltabit', {},"","")
|
||||
results = await deltabit("https://turbovid.me/squc5gdzptgw",client,{'streams': []},'Deltabit', {},"","",'Turbovid')
|
||||
print(results)
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
|
||||
@@ -146,9 +146,13 @@ async def eval_solver(stream_link,proxies, ForwardProxy, client):
|
||||
headers = random_headers.generate()
|
||||
headers["User-Agent"] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
|
||||
headers["accept-language"] = 'en-US,en;q=0.5'
|
||||
if len(stream_link) <= 200:
|
||||
response = await client.get( ForwardProxy + stream_link, allow_redirects=True, timeout=30, headers = headers, proxies = proxies, impersonate = "chrome124")
|
||||
text = response.text
|
||||
logger.debug("Eval:",response.status_code)
|
||||
soup = BeautifulSoup(response.text, "lxml",parse_only=SoupStrainer("script"))
|
||||
else:
|
||||
text = stream_link
|
||||
soup = BeautifulSoup(text, "lxml",parse_only=SoupStrainer("script"))
|
||||
script_all = soup.find_all("script")
|
||||
for i in script_all:
|
||||
if detect(i.text):
|
||||
@@ -156,6 +160,8 @@ async def eval_solver(stream_link,proxies, ForwardProxy, client):
|
||||
if "xdrop" in stream_link:
|
||||
pattern = r'MDCore.wurl ?= ?"(.*?)"'
|
||||
|
||||
elif 'turbovid' in stream_link:
|
||||
pattern = r'sources:\s*\["([^"]+)"'
|
||||
else:
|
||||
pattern = r'file:"(.*?)"'
|
||||
match = re.search(pattern, unpacked_code)
|
||||
|
||||
Reference in New Issue
Block a user