Created Test Branch
This commit is contained in:
+24
-6
@@ -4,8 +4,13 @@ from Src.Utilities.info import is_movie,get_info_tmdb,get_info_imdb
|
||||
from Src.Utilities.convert import get_TMDb_id_from_IMDb_id
|
||||
from fake_headers import Headers
|
||||
import Src.Utilities.config as config
|
||||
from Src.Utilities.loadenv import load_env
|
||||
HF = config.HF
|
||||
|
||||
env_vars = load_env()
|
||||
ForwardProxy_list = config.ForwardProxy
|
||||
ForwardProxy = ForwardProxy_list[0]
|
||||
PROXY_CREDENTIALS = env_vars.get('PROXY_CREDENTIALS')
|
||||
fake_headers = Headers()
|
||||
|
||||
async def get_stayonline(link,client):
|
||||
@@ -24,9 +29,24 @@ async def get_stayonline(link,client):
|
||||
async def get_uprot(link,client):
|
||||
if "msf" in link:
|
||||
link = link.replace("msf","mse")
|
||||
|
||||
if PROXY_CREDENTIALS :
|
||||
import json
|
||||
import random
|
||||
proxy_list = json.loads(PROXY_CREDENTIALS)
|
||||
proxy = random.choice(proxy_list)
|
||||
if proxy == " ":
|
||||
proxies = {
|
||||
"http": proxy,
|
||||
"https": proxy
|
||||
}
|
||||
else:
|
||||
proxies = {}
|
||||
else:
|
||||
proxies = {}
|
||||
|
||||
headers = fake_headers.generate()
|
||||
response = await client.get(link, headers=headers, allow_redirects=True, timeout=10)
|
||||
print(ForwardProxy + link)
|
||||
response = await client.get(ForwardProxy + link, headers=headers, allow_redirects=True, timeout=10, proxies=proxies)
|
||||
soup = BeautifulSoup(response.text, "lxml")
|
||||
maxstream_url = soup.find("a")
|
||||
maxstream_url = maxstream_url.get("href")
|
||||
@@ -54,7 +74,7 @@ async def get_true_link_mixdrop(real_link,client):
|
||||
async def get_true_link_maxstream(maxstream_url,client):
|
||||
headers = fake_headers.generate()
|
||||
# Send a GET request to the Maxstream URL
|
||||
response = await client.get(maxstream_url, headers=headers, allow_redirects=True, timeout=10)
|
||||
response = await client.get(ForwardProxy + maxstream_url, headers=headers, allow_redirects=True, timeout=10)
|
||||
[s1, s2] = re.search(r"\}\('(.+)',.+,'(.+)'\.split", response.text).group(1, 2)
|
||||
terms = s2.split("|")
|
||||
urlset_index = terms.index('urlset')
|
||||
@@ -250,7 +270,7 @@ async def cb01(id,client):
|
||||
|
||||
|
||||
|
||||
'''
|
||||
|
||||
async def test_animeworld():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
@@ -261,5 +281,3 @@ async def test_animeworld():
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
asyncio.run(test_animeworld())
|
||||
'''
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ async def get_version(client):
|
||||
version = "65e52dcf34d64173542cd2dc6b8bb75b"
|
||||
return version
|
||||
|
||||
async def search(query,date,ismovie, client,SC_FAST_SEARCH):
|
||||
async def search(query,date,ismovie, client,SC_FAST_SEARCH,movie_id):
|
||||
random_headers = headers.generate()
|
||||
random_headers['Referer'] = "https://streamingcommunity.buzz/"
|
||||
random_headers['Origin'] = "https://streamingcommunity.buzz"
|
||||
@@ -65,16 +65,20 @@ async def search(query,date,ismovie, client,SC_FAST_SEARCH):
|
||||
random_headers['Referer'] = "https://streamingcommunity.buzz/"
|
||||
random_headers['Origin'] = "https://streamingcommunity.buzz"
|
||||
response = await client.get ( f'https://streamingcommunity.{SC_DOMAIN}/titles/{tid}-{slug}', headers = random_headers, allow_redirects=True,impersonate = "chrome120")
|
||||
pattern = r'<div[^>]*class="features"[^>]*>.*?<span[^>]*>(.*?)<\/span>'
|
||||
match = re.search(pattern, response.text)
|
||||
print(match.group(1).split("-")[0])
|
||||
first_air_year = match.group(1).split("-")[0]
|
||||
date = int(date)
|
||||
first_air_year = int(first_air_year)
|
||||
if first_air_year == date:
|
||||
return tid,slug
|
||||
soup = BeautifulSoup(response.text, "lxml")
|
||||
data = json.loads(soup.find("div", {"id": "app"}).get("data-page"))
|
||||
version = data['version']
|
||||
if "tt" in movie_id:
|
||||
imdb_id = data['props']['title']['imdb_id']
|
||||
if imdb_id == movie_id:
|
||||
return tid,slug,version
|
||||
else:
|
||||
tmdb_id = str(data['props']['title']['tmdb_id'])
|
||||
if tmdb_id == movie_id:
|
||||
return tid,slug,version
|
||||
elif SC_FAST_SEARCH == "1":
|
||||
return tid,slug
|
||||
version = await get_version(client)
|
||||
return tid,slug,version
|
||||
else:
|
||||
print("Couldn't find anything")
|
||||
|
||||
@@ -108,15 +112,24 @@ async def get_film(tid,version,client):
|
||||
expires = re.search(r"'expires':\s*'(\d+)'", script).group(1)
|
||||
quality = re.search(r'"quality":(\d+)', script).group(1)
|
||||
#Example url https://vixcloud.co/playlist/231315?b=1&token=bce060eec3dc9d1965a5d258dc78c964&expires=1728995040&rendition=1080p
|
||||
url = f'https://vixcloud.co/playlist/{vixid}.m3u8?token={token}&expires={expires}'
|
||||
url = f'https://vixcloud.co/playlist/{vixid}.m3u8?expires={expires}'
|
||||
if 'canPlayFHD' in query_params:
|
||||
canPlayFHD = 'h=1'
|
||||
url += "&h=1"
|
||||
if 'b' in query_params:
|
||||
b = 'b=1'
|
||||
url += "&b=1"
|
||||
if quality == "1080":
|
||||
if "&h" in url:
|
||||
url = url
|
||||
elif "&b" in url and quality == "1080":
|
||||
url = url.replace("&b=1","&h=1")
|
||||
elif quality == "1080" and "&b" and "&h" not in url:
|
||||
url = url + "&h=1"
|
||||
else:
|
||||
url = url + f"&token={token}"
|
||||
url720 = f'https://vixcloud.co/playlist/{vixid}.m3u8'
|
||||
return url,url720,quality,
|
||||
return url,url720,quality
|
||||
|
||||
async def get_season_episode_id(tid,slug,season,episode,version,client):
|
||||
random_headers = headers.generate()
|
||||
@@ -165,13 +178,22 @@ async def get_episode_link(episode_id,tid,version,client):
|
||||
expires = re.search(r"'expires':\s*'(\d+)'", script).group(1)
|
||||
quality = re.search(r'"quality":(\d+)', script).group(1)
|
||||
#Example url https://vixcloud.co/playlist/231315?b=1&token=bce060eec3dc9d1965a5d258dc78c964&expires=1728995040&rendition=1080p
|
||||
url = f'https://vixcloud.co/playlist/{vixid}.m3u8?token={token}&expires={expires}'
|
||||
url = f'https://vixcloud.co/playlist/{vixid}.m3u8?expires={expires}'
|
||||
if 'canPlayFHD' in query_params:
|
||||
canPlayFHD = 'h=1'
|
||||
url += "&h=1"
|
||||
if 'b' in query_params:
|
||||
b = 'b=1'
|
||||
url += "&b=1"
|
||||
if quality == "1080":
|
||||
if "&h" in url:
|
||||
url = url
|
||||
elif "&b" in url and quality == "1080":
|
||||
url = url.replace("&b=1","&h=1")
|
||||
elif quality == "1080" and "&b" and "&h" not in url:
|
||||
url = url + "&h=1"
|
||||
else:
|
||||
url = url + f"&token={token}"
|
||||
url720 = f'https://vixcloud.co/playlist/{vixid}.m3u8'
|
||||
return url,url720,quality
|
||||
|
||||
@@ -190,6 +212,7 @@ async def streaming_community(imdb,client,SC_FAST_SEARCH):
|
||||
general = is_movie(imdb)
|
||||
ismovie = general[0]
|
||||
imdb_id = general[1]
|
||||
|
||||
if ismovie == 0 :
|
||||
season = int(general[2])
|
||||
episode = int(general[3])
|
||||
@@ -208,7 +231,8 @@ async def streaming_community(imdb,client,SC_FAST_SEARCH):
|
||||
showname = get_info_tmdb(tmdba,ismovie,type)
|
||||
elif SC_FAST_SEARCH == "0":
|
||||
type = "StreamingCommunity"
|
||||
tmdba = await get_TMDb_id_from_IMDb_id(imdb_id,client)
|
||||
if "tt" in imdb:
|
||||
tmdba = await get_TMDb_id_from_IMDb_id(imdb_id,client)
|
||||
showname,date = get_info_tmdb(tmdba,ismovie,type)
|
||||
#HERE THE CASE IF IT IS A MOVIE
|
||||
else:
|
||||
@@ -234,31 +258,29 @@ async def streaming_community(imdb,client,SC_FAST_SEARCH):
|
||||
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
|
||||
showname = urllib.parse.quote_plus(showname)
|
||||
query = f'https://streamingcommunity.{SC_DOMAIN}/api/search?q={showname}'
|
||||
version = await get_version(client)
|
||||
tid,slug = await search(query,date,ismovie,client,SC_FAST_SEARCH)
|
||||
tid,slug,version = await search(query,date,ismovie,client,SC_FAST_SEARCH,imdb_id)
|
||||
if ismovie == 1:
|
||||
#TID means temporaly ID
|
||||
url,url720,quality = await get_film(tid,version,client)
|
||||
print("MammaMia found results for StreamingCommunity")
|
||||
return url,url720,quality
|
||||
return url,url720,quality,slug
|
||||
if ismovie == 0:
|
||||
#Uid = URL ID
|
||||
episode_id = await get_season_episode_id(tid,slug,season,episode,version,client)
|
||||
url,url720,quality = await get_episode_link(episode_id,tid,version,client)
|
||||
print("MammaMia found results for StreamingCommunity")
|
||||
return url,url720,quality
|
||||
return url,url720,quality,slug
|
||||
except Exception as e:
|
||||
print("MammaMia: StreamingCommunity failed",e)
|
||||
return None,None,None
|
||||
'''
|
||||
|
||||
async def test_animeworld():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
# Replace with actual id, for example 'anime_id:episode' format
|
||||
test_id = "tt12930350" # This is an example ID format
|
||||
test_id = "tt0101414" # This is an example ID format
|
||||
results = await streaming_community(test_id, client,"0")
|
||||
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
asyncio.run(test_animeworld())
|
||||
'''
|
||||
+16
-10
@@ -7,6 +7,8 @@ from Src.Utilities.loadenv import load_env
|
||||
HF = config.HF
|
||||
env_vars = load_env()
|
||||
PROXY_CREDENTIALS = env_vars.get('PROXY_CREDENTIALS')
|
||||
ForwardProxy_list = config.ForwardProxy
|
||||
ForwardProxy = ForwardProxy_list[0]
|
||||
TF_DOMAIN = config.TF_DOMAIN
|
||||
import urllib.parse
|
||||
async def search(showname,ismovie,date,client):
|
||||
@@ -160,15 +162,22 @@ async def true_url(protect_link,client):
|
||||
if HF == "1":
|
||||
import random
|
||||
import json
|
||||
print(PROXY_CREDENTIALS)
|
||||
proxy_list = json.loads(PROXY_CREDENTIALS)
|
||||
proxy = random.choice(proxy_list)
|
||||
proxies = {
|
||||
"http": proxy,
|
||||
"https": proxy
|
||||
}
|
||||
response = await client.get(protect_link, proxies=proxies, allow_redirects=True, impersonate = "chrome120")
|
||||
if proxy == "":
|
||||
proxies = {}
|
||||
else:
|
||||
proxies = {
|
||||
"http": proxy,
|
||||
"https": proxy
|
||||
}
|
||||
response = await client.head(protect_link, allow_redirects=True, impersonate = "chrome120", proxies = proxies)
|
||||
doodstream_url = response.url
|
||||
else:
|
||||
response = await client.get(protect_link, allow_redirects=True, impersonate = "chrome120")
|
||||
proxies = {}
|
||||
doodstream_url = protect_link
|
||||
response = await client.get(ForwardProxy + doodstream_url, allow_redirects=True, impersonate = "chrome120", proxies = proxies)
|
||||
|
||||
|
||||
if response.status_code == 200:
|
||||
@@ -185,10 +194,7 @@ async def true_url(protect_link,client):
|
||||
if match:
|
||||
# Create real link (match[0] includes all matched elements)
|
||||
url =f'https://d000d.com{match[1]}'
|
||||
if "HF" == "1" :
|
||||
rebobo = await client.get(url, headers=headers, allow_redirects=True, impersonate = "chrome120",proxies= proxies)
|
||||
else:
|
||||
rebobo = await client.get(url, headers=headers, allow_redirects=True, impersonate = "chrome120")
|
||||
rebobo = await client.get(ForwardProxy + url, headers=headers, allow_redirects=True, impersonate = "chrome120",proxies= proxies)
|
||||
real_url = f'{rebobo.text}123456789{match[2]}{real_time}'
|
||||
print("MammaMia: Found results for Tantifilm")
|
||||
return real_url
|
||||
|
||||
+38
-5
@@ -26,21 +26,23 @@ headers = {
|
||||
}
|
||||
|
||||
medialink = config.MediaProxy
|
||||
async def get_stream_link(id,site,client):
|
||||
async def get_stream_link(id,site):
|
||||
try:
|
||||
if site == "dlhd":
|
||||
stream_url = "https://xyzdddd.mizhls.ru/lb/" + webru_dlhd[id] + "/index.m3u8"
|
||||
elif site == "vary":
|
||||
stream_url = "https://webuit.mizhls.ru/lb/"+ webru_vary[id] + "/index.m3u8"
|
||||
mediaproxy = config.MediaProxy
|
||||
medialink = random.choice(mediaproxy)
|
||||
new_stream_url = f'{medialink}proxy/hls/manifest.m3u8?api_password={MEDIAFLOW_PASS}&d={stream_url}&h_Referer={Referer}&h_Origin={Origin}&h_User-Agent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F58.0.3029.110%20Safari%2F537.3'
|
||||
|
||||
return stream_url,Referer,Origin
|
||||
except Exception as e:
|
||||
return None
|
||||
async def webru(id,site,client):
|
||||
try:
|
||||
stream_url, Referer,Origin = await get_stream_link(id,site,client)
|
||||
mediaproxy = config.MediaProxy
|
||||
medialink = random.choice(mediaproxy)
|
||||
new_stream_url = f'{medialink}proxy/hls/manifest.m3u8?api_password={MEDIAFLOW_PASS}&d={stream_url}&h_Referer={Referer}&h_Origin={Origin}&h_User-Agent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F58.0.3029.110%20Safari%2F537.3'
|
||||
new_stream_url = await get_stream_link(id,site,client)
|
||||
|
||||
return new_stream_url
|
||||
except Exception as e:
|
||||
print("WebRu failed",e)
|
||||
@@ -103,4 +105,35 @@ async def get_skystreaming_url(skystreaming_link,client):
|
||||
except Exception as e:
|
||||
print("WebRu failed",e)
|
||||
return None
|
||||
'''
|
||||
|
||||
|
||||
|
||||
async def webru(id,site,client):
|
||||
try:
|
||||
print(id)
|
||||
if site == "vary":
|
||||
print("1")
|
||||
url = await get_stream_link(id,site)
|
||||
if any(keyword in id for keyword in ["cinema", "arte", "nature", "investigation", "sky-uno", "sky-serie"]):
|
||||
print("2")
|
||||
url = await get_stream_link(id,site)
|
||||
else:
|
||||
print("3")
|
||||
response = await client.get(f"https://848b3516657c-worldwide-sports-tv.baby-beamup.club/stream/tv/wwstv-it-{id}.json", impersonate = "chrome120", headers = headers)
|
||||
data = response.json()
|
||||
url = data['streams'][0]['url']
|
||||
print(url)
|
||||
return url
|
||||
except Exception as e:
|
||||
print("WorldSport failed",e)
|
||||
return None
|
||||
|
||||
|
||||
'''
|
||||
if id in skystreaming:
|
||||
i = i+1
|
||||
url,Host = await get_skystreaming(id,client)
|
||||
streams['streams'].append({'title': f'{HF}Server {i}', 'url': url, "behaviorHints": {"notWebReady": True, "proxyHeaders": {"request": {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0", "Accept": "*/*", "Accept-Language": "en-US,en;q=0.5", "Origin": "https://skystreaming.guru", "DNT": "1", "Sec-GPC": "1", "Connection": "keep-alive", "Referer": "https://skystreaming.guru/", "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "cross-site", "Pragma": "no-cache", "Cache-Control": "no-cache", "TE": "trailers","Host": Host}}}})
|
||||
|
||||
'''
|
||||
+2
-2
@@ -76,6 +76,7 @@ async def whvx(id,client):
|
||||
showname = urllib.parse.quote_plus(showname)
|
||||
response = await client.get(f'https://api.whvx.net/search', params = params, headers=headers, impersonate = "chrome120")
|
||||
data = json.loads(response.text)
|
||||
print(data)
|
||||
url = data['url']
|
||||
print(data)
|
||||
params = {
|
||||
@@ -110,7 +111,7 @@ async def whvx(id,client):
|
||||
print(resolution_links)
|
||||
return resolution_links
|
||||
|
||||
'''
|
||||
|
||||
async def test_animeworld():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
@@ -123,4 +124,3 @@ if __name__ == "__main__":
|
||||
asyncio.run(test_animeworld())
|
||||
|
||||
|
||||
'''
|
||||
Reference in New Issue
Block a user