MammaMia version 2.0.0
This commit is contained in:
+30
-15
@@ -1,11 +1,19 @@
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
import datetime
|
||||
import logging
|
||||
import json
|
||||
from Src.Utilities.info import get_info_kitsu
|
||||
import Src.Utilities.config as config
|
||||
import re
|
||||
from fake_headers import Headers
|
||||
import Src.Utilities.config as config
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
Icon = config.Icon
|
||||
Name = config.Name
|
||||
|
||||
random_headers = Headers()
|
||||
proxies = {}
|
||||
from Src.Utilities.loadenv import load_env
|
||||
@@ -55,7 +63,7 @@ async def security_cookie (response):
|
||||
f"SecurityAW-{unknown_chars}": Security_Cookie
|
||||
}
|
||||
return cookies
|
||||
async def get_mp4(anime_url,ismovie,episode,client):
|
||||
async def get_mp4(anime_url,ismovie,episode,client,i,streams):
|
||||
cookies = {}
|
||||
if ForwardProxy != "":
|
||||
response = await client.get(ForwardProxy + anime_url,allow_redirects=True,impersonate = "chrome124",proxies=proxies)
|
||||
@@ -82,12 +90,18 @@ async def get_mp4(anime_url,ismovie,episode,client):
|
||||
response = await client.head(url)
|
||||
if response.status_code == 404:
|
||||
url = None
|
||||
return url
|
||||
if url:
|
||||
if i == 0:
|
||||
language = "Original"
|
||||
elif i == 1:
|
||||
language = "Italian"
|
||||
streams['streams'].append({'title': f'{Icon}Animeworld {language}', 'url': url,'behaviorHints': {'bingeGroup': 'animeworld'}})
|
||||
return streams
|
||||
|
||||
|
||||
|
||||
|
||||
async def search(showname,date,ismovie,episode,client):
|
||||
async def search(showname,date,ismovie,episode,client,streams):
|
||||
search_year = date[:4]
|
||||
headers = random_headers.generate()
|
||||
link = f'{AW_DOMAIN}/filter?year={search_year}&sort=2&keyword={showname}'
|
||||
@@ -99,7 +113,7 @@ async def search(showname,date,ismovie,episode,client):
|
||||
cookies = {}
|
||||
soup = BeautifulSoup(response.text,'lxml')
|
||||
anime_list = soup.find_all('a', class_=['poster', 'tooltipstered'])
|
||||
final_urls = []
|
||||
i = 0
|
||||
for anime in anime_list:
|
||||
anime_info_url = f'{AW_DOMAIN}/{anime["data-tip"]}'
|
||||
response = await client.get(ForwardProxy + anime_info_url,allow_redirects=True, impersonate = "chrome124", cookies = cookies, proxies = proxies)
|
||||
@@ -118,12 +132,13 @@ async def search(showname,date,ismovie,episode,client):
|
||||
release_date == (datetime.datetime.strptime(date, "%Y-%m-%d") + datetime.timedelta(days=1)).strftime("%Y-%m-%d") or
|
||||
release_date == (datetime.datetime.strptime(date, "%Y-%m-%d") - datetime.timedelta(days=1)).strftime("%Y-%m-%d")):
|
||||
anime_url = f'{AW_DOMAIN}{anime["href"]}'
|
||||
final_url = await get_mp4(anime_url,ismovie,episode,client)
|
||||
if final_url:
|
||||
final_urls.append(final_url)
|
||||
return final_urls
|
||||
streams = await get_mp4(anime_url,ismovie,episode,client,i,streams)
|
||||
i+=1
|
||||
logger.info(f"AnimeWorld Found Results for current ID")
|
||||
|
||||
async def animeworld(id,client):
|
||||
return streams
|
||||
|
||||
async def animeworld(streams,id,client):
|
||||
try:
|
||||
kitsu_id = id.split(":")[1]
|
||||
ismovie = 1 if len(id.split(":")) == 2 else 0
|
||||
@@ -142,11 +157,11 @@ async def animeworld(id,client):
|
||||
showname = showname.split("’")[0]
|
||||
if ":" in showname:
|
||||
showname = showname.split(":")[0]
|
||||
final_urls = await search(showname,date,ismovie,episode,client)
|
||||
return final_urls
|
||||
streams = await search(showname,date,ismovie,episode,client,streams)
|
||||
return streams
|
||||
except Exception as e:
|
||||
print("Animeworld failed",e)
|
||||
return None
|
||||
logger.warning(f"Animeworld failed {e}")
|
||||
return streams
|
||||
|
||||
async def test_animeworld():
|
||||
async with AsyncSession() as client:
|
||||
@@ -200,7 +215,7 @@ async def old_search(showname,date,ismovie,episode,client):
|
||||
'keyword': showname,
|
||||
}
|
||||
|
||||
response = await client.post(f'https://www.animeworld.{AW_DOMAIN}/api/search/v2', params=params, cookies=cookies, headers=headers,allow_redirects=True, impersonate = "chrome124")
|
||||
response = await client.post(f'https://www.animeworld.{AW_DOMAIN}/api/search/v2', params=params, cookies=cookies, headers=headers,allow_redirects=True)
|
||||
|
||||
data = json.loads(response.text)
|
||||
final_urls = []
|
||||
@@ -221,7 +236,7 @@ async def old_search(showname,date,ismovie,episode,client):
|
||||
params = {
|
||||
'keyword': showname,
|
||||
}
|
||||
response = await client.post(ForwardProxy + f'https://www.animeworld.{AW_DOMAIN}/api/search/v2', params=params, cookies=cookies, headers=headers, allow_redirects=True, impersonate = "chrome124", proxies = proxies)
|
||||
response = await client.post(ForwardProxy + f'https://www.animeworld.{AW_DOMAIN}/api/search/v2', params=params, cookies=cookies, headers=headers, allow_redirects=True, proxies = proxies)
|
||||
data = json.loads(response.text)
|
||||
for anime in data["animes"]:
|
||||
release_date = anime["release"]
|
||||
|
||||
+41
-146
@@ -5,6 +5,11 @@ 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
|
||||
from Src.API.extractors.mixdrop import mixdrop
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
CB_DOMAIN = config.CB_DOMAIN
|
||||
CB_PROXY = config.CB_PROXY
|
||||
MX_PROXY = config.MX_PROXY
|
||||
@@ -13,6 +18,7 @@ proxies2 = {}
|
||||
env_vars = load_env()
|
||||
import random
|
||||
import json
|
||||
from Src.Utilities.mfp import build_mfp
|
||||
if MX_PROXY == "1":
|
||||
PROXY_CREDENTIALS = env_vars.get('PROXY_CREDENTIALS')
|
||||
proxy_list = json.loads(PROXY_CREDENTIALS)
|
||||
@@ -65,86 +71,15 @@ async def get_stayonline(link,client):
|
||||
return real_url
|
||||
|
||||
|
||||
async def get_uprot(link,client):
|
||||
if "msf" in link:
|
||||
link = link.replace("msf","mse")
|
||||
headers = fake_headers.generate()
|
||||
response = await client.get(ForwardProxy2 + link, headers=headers, allow_redirects=True, timeout=10, proxies=proxies2, impersonate = "chrome124")
|
||||
soup = BeautifulSoup(response.text, "lxml")
|
||||
maxstream_url = soup.find("a")
|
||||
maxstream_url = maxstream_url.get("href")
|
||||
return maxstream_url
|
||||
|
||||
async def get_true_link_mixdrop(real_link,client,MFP):
|
||||
try:
|
||||
import string
|
||||
if "club" in real_link:
|
||||
real_link = real_link.replace("club","ps").split('/2')[0]
|
||||
|
||||
if MFP == "1":
|
||||
return real_link
|
||||
headers = fake_headers.generate()
|
||||
response = await client.get(real_link, headers=headers, allow_redirects=True,timeout = 30, impersonate = "chrome124")
|
||||
[s1, s2] = re.search(r"\}\('(.+)',.+,'(.+)'\.split", response.text).group(1, 2)
|
||||
schema = s1.split(";")[2][5:-1]
|
||||
terms = s2.split("|")
|
||||
charset = string.digits + string.ascii_letters
|
||||
d = dict()
|
||||
for i in range(len(terms)):
|
||||
d[charset[i]] = terms[i] or charset[i]
|
||||
s = 'https:'
|
||||
for c in schema:
|
||||
s += d[c] if c in d else c
|
||||
print(s)
|
||||
return s
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return None
|
||||
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(ForwardProxy2 + maxstream_url, headers=headers, allow_redirects=True, timeout=10,proxies = proxies2, impersonate = "chrome124")
|
||||
[s1, s2] = re.search(r"\}\('(.+)',.+,'(.+)'\.split", response.text).group(1, 2)
|
||||
terms = s2.split("|")
|
||||
urlset_index = terms.index('urlset')
|
||||
hls_index = terms.index('hls')
|
||||
sources_index = terms.index('sources')
|
||||
result = terms[urlset_index + 1 : hls_index]
|
||||
reversed_elements = result[::-1]
|
||||
first_part = terms[hls_index +1 : sources_index]
|
||||
reversed_first_part = first_part[::-1]
|
||||
first_url_part = ""
|
||||
for first_part in reversed_first_part:
|
||||
if "0" in first_part:
|
||||
first_url_part += first_part
|
||||
else:
|
||||
first_url_part += first_part + "-"
|
||||
|
||||
|
||||
|
||||
base_url = f"https://{first_url_part}.host-cdn.net/hls/"
|
||||
if len(reversed_elements) == 1:
|
||||
final_url = base_url + "," + reversed_elements[0] + ".urlset/master.m3u8"
|
||||
lenght = len(reversed_elements)
|
||||
i = 1
|
||||
for element in reversed_elements:
|
||||
base_url += element + ","
|
||||
if lenght == i:
|
||||
base_url += ".urlset/master.m3u8"
|
||||
else:
|
||||
i += 1
|
||||
final_url = base_url
|
||||
return final_url
|
||||
|
||||
async def search_movie(showname,date,client):
|
||||
try:
|
||||
showname = showname.replace(" ","+").replace("ò","o").replace("è","e").replace("à","a").replace("ù","u").replace("ì","i")
|
||||
headers = fake_headers.generate()
|
||||
headers['Referer'] = f'{CB_DOMAIN}/'
|
||||
query = f'{CB_DOMAIN}/?s={showname}'
|
||||
response = await client.get(ForwardProxy + query,headers=headers, impersonate = "chrome124", proxies = proxies)
|
||||
response = await client.get(ForwardProxy + query,headers=headers, proxies = proxies)
|
||||
if response.status_code != 200:
|
||||
print(f"CB01 Failed to fetch search results: {response.status_code}")
|
||||
logger.warning(f"CB01 Failed to fetch search results: {response.status_code}")
|
||||
soup = BeautifulSoup(response.text, 'lxml',parse_only=SoupStrainer('div', class_='card-content'))
|
||||
cards = soup.find_all('div', class_='card-content')
|
||||
year_pattern = re.compile(r'(19|20)\d{2}')
|
||||
@@ -162,7 +97,7 @@ async def search_movie(showname,date,client):
|
||||
if year == date : # Check if the year is 2011
|
||||
return href
|
||||
except Exception as e:
|
||||
print(f'MammaMia: Error in search_series cb01: {e}')
|
||||
logger.warning(f'MammaMia: Error in search_series cb01: {e}')
|
||||
|
||||
|
||||
async def search_series(showname,date,client):
|
||||
@@ -171,9 +106,9 @@ async def search_series(showname,date,client):
|
||||
headers = fake_headers.generate()
|
||||
headers['Referer'] = f'{CB_DOMAIN}/serietv/'
|
||||
query = f'{CB_DOMAIN}/serietv/?s={showname}'
|
||||
response = await client.get(ForwardProxy + query,headers=headers,impersonate = "chrome124", proxies = proxies)
|
||||
response = await client.get(ForwardProxy + query,headers=headers, proxies = proxies)
|
||||
if response.status_code != 200:
|
||||
print(f"CB01 Failed to fetch search results: {response.status_code}")
|
||||
logger.warning(f"CB01 Failed to fetch search results: {response.status_code}")
|
||||
soup = BeautifulSoup(response.text, 'lxml',parse_only=SoupStrainer('div', class_='card-content'))
|
||||
cards = soup.find_all('div', class_='card-content')
|
||||
year_pattern = re.compile(r'(19|20)\d{2}')
|
||||
@@ -193,42 +128,24 @@ async def search_series(showname,date,client):
|
||||
if year == date : # Check if the year is 2011
|
||||
return href
|
||||
except Exception as e:
|
||||
print(f'MammaMia: Error in search_series cb01: {e}')
|
||||
logger.warning(f'MammaMia: Error in search_series cb01: {e}')
|
||||
|
||||
async def movie_redirect_url(link,client,MFP):
|
||||
async def movie_redirect_url(link,client,MFP,MFP_CREDENTIALS,streams):
|
||||
headers = fake_headers.generate()
|
||||
response = await client.get(ForwardProxy + link, headers=headers, allow_redirects=True, timeout=10, impersonate = "chrome124", proxies = proxies)
|
||||
response = await client.get(ForwardProxy + link, headers=headers, allow_redirects=True, timeout=10, proxies = proxies)
|
||||
# Extract the redirect URL from the HTML
|
||||
soup = BeautifulSoup(response.text, "lxml",parse_only=SoupStrainer('div'))
|
||||
redirect_url = soup.find("div", id="iframen2").get("data-src")
|
||||
print(redirect_url)
|
||||
if "stayonline" in redirect_url:
|
||||
mixdrop_real_link = await get_stayonline(redirect_url,client)
|
||||
final_url = await get_true_link_mixdrop(mixdrop_real_link,client,MFP)
|
||||
if final_url != None:
|
||||
return final_url
|
||||
else:
|
||||
redirect_url = soup.find("div", id="iframen1").get("data-src")
|
||||
if "stayonline" in redirect_url:
|
||||
redirect_url =await get_stayonline(redirect_url,client)
|
||||
maxstream_real_link = await get_uprot(redirect_url,client)
|
||||
final_url = await get_true_link_maxstream(maxstream_real_link,client)
|
||||
return(final_url)
|
||||
streams = await mixdrop(mixdrop_real_link,client,MFP,MFP_CREDENTIALS,streams,"CB01",proxies,ForwardProxy,"")
|
||||
|
||||
else:
|
||||
redirect_url = soup.find("div", id="iframen1").get("data-src")
|
||||
if "stayonline" in redirect_url:
|
||||
redirect_url =await get_stayonline(redirect_url,client)
|
||||
maxstream_real_link = await get_uprot(redirect_url,client)
|
||||
final_url = await get_true_link_maxstream(maxstream_real_link,client)
|
||||
return(final_url)
|
||||
|
||||
return redirect_url
|
||||
async def series_redirect_url(link,season,episode,client,MFP):
|
||||
return streams
|
||||
async def series_redirect_url(link,season,episode,client,MFP,MFP_CREDENTIALS,streams):
|
||||
if len(episode) == 1:
|
||||
episode = f'0{episode}'
|
||||
headers = fake_headers.generate()
|
||||
response = await client.get(ForwardProxy + link, headers=headers, allow_redirects=True, timeout=10,impersonate = "chrome124", proxies = proxies)
|
||||
response = await client.get(ForwardProxy + link, headers=headers, allow_redirects=True, timeout=10, proxies = proxies)
|
||||
soup = BeautifulSoup(response.text, "lxml")
|
||||
seasons_text = soup.find_all('div', class_='sp-head')
|
||||
for season_text in seasons_text:
|
||||
@@ -236,47 +153,25 @@ async def series_redirect_url(link,season,episode,client,MFP):
|
||||
if f'STAGIONE' in text and f'{season}' in text:
|
||||
text = text.replace("STAGIONE","").replace("ITA", "")
|
||||
if "A" in text:
|
||||
if len(season) == 1:
|
||||
season = f'0{season}'
|
||||
sp_body = season_text.find_next('div', class_='sp-body')
|
||||
link_tag = sp_body.find('a')
|
||||
uprot_long = link_tag.get('href')
|
||||
response = await client.get(ForwardProxy + uprot_long, headers=headers, allow_redirects=True, timeout=10, impersonate = "chrome124", proxies = proxies)
|
||||
season = "01"
|
||||
episode = "04"
|
||||
pattern1 = rf"(?i)\S*?\.{season}x{episode}\S*?\.mkv.*?href=['\"](.*?)['\"]"
|
||||
pattern2 = rf"\S*\.S{season}E{episode}\S*?\.mkv|\.mp4|\.avi.*?href=['\"](.*?)['\"]"
|
||||
match = re.search(pattern1, response.text)
|
||||
if match:
|
||||
maxstream_link = match.group(1)
|
||||
else:
|
||||
match = re.search(pattern2, response.text)
|
||||
if match:
|
||||
maxstream_link = match.group(1)
|
||||
if "stayonline" in maxstream_link:
|
||||
maxstream_link =await get_stayonline(maxstream_link,client)
|
||||
maxstream_real_link = await get_uprot(maxstream_link,client)
|
||||
final_url = await get_true_link_maxstream(maxstream_real_link,client)
|
||||
return final_url
|
||||
return streams
|
||||
else:
|
||||
pattern = re.compile(r'4×03\s*–.*?<a href="(.*?)".*?>Maxstream</a>\s*–.*?<a href="(.*?)".*?>Mixdrop</a>', re.DOTALL)
|
||||
match = pattern.search(response.text)
|
||||
maxstream_link = match.group(1)
|
||||
mixdrop_link = match.group(2)
|
||||
print(f"Maxstream: {maxstream_link}")
|
||||
print(f"Mixdrop: {mixdrop_link}")
|
||||
mixdrop_real_link = await get_stayonline(mixdrop_link,client)
|
||||
final_url = await get_true_link_mixdrop(mixdrop_real_link,client,MFP)
|
||||
if final_url == None:
|
||||
if "stayonline" in maxstream_link:
|
||||
maxstream_link =await get_stayonline(maxstream_link,client)
|
||||
maxstream_real_link = await get_uprot(maxstream_link,client)
|
||||
final_url = await get_true_link_maxstream(maxstream_real_link,client)
|
||||
return final_url
|
||||
episode = episode.zfill(2)
|
||||
match = re.search(rf'{season}×{episode}\s*–\s*<a[^>]*href="[^"]*"[^>]*>[^<]*</a>\s– <a[^>]*href="[^"]*',response.text)
|
||||
if match:
|
||||
links = match.group(0)
|
||||
soup = BeautifulSoup(links,'lxml',parse_only=SoupStrainer('a'))
|
||||
mixdrop_a = soup.find_all('a')[1]
|
||||
mixdrop_link = mixdrop_a['href']
|
||||
mixdrop_real_link = await get_stayonline(mixdrop_link,client)
|
||||
streams = await mixdrop(mixdrop_real_link,client,MFP,MFP_CREDENTIALS,streams,"CB01",proxies,ForwardProxy,"")
|
||||
return streams
|
||||
|
||||
|
||||
|
||||
async def cb01(id,client,MFP):
|
||||
|
||||
|
||||
|
||||
async def cb01(streams,id,MFP,MFP_CREDENTIALS,client):
|
||||
try:
|
||||
general = await is_movie(id)
|
||||
ismovie = general[0]
|
||||
@@ -290,17 +185,17 @@ async def cb01(id,client,MFP):
|
||||
season = general[2]
|
||||
episode = general[3]
|
||||
link = await search_series(showname,date,client)
|
||||
final_url = await series_redirect_url(link,season,episode,client,MFP)
|
||||
return final_url
|
||||
streams = await series_redirect_url(link,season,episode,client,MFP,MFP_CREDENTIALS,streams)
|
||||
return streams
|
||||
elif ismovie == 1:
|
||||
season = None
|
||||
episode = None
|
||||
link = await search_movie(showname,date,client)
|
||||
redirect_url = await movie_redirect_url(link,client,MFP)
|
||||
return redirect_url
|
||||
streams = await movie_redirect_url(link,client,MFP,MFP_CREDENTIALS,streams)
|
||||
return streams
|
||||
except Exception as e:
|
||||
print(f'MammaMia: Error in cb01: {e}')
|
||||
return None
|
||||
logger.warning(f'MammaMia: Error in cb01: {e}')
|
||||
return streams
|
||||
|
||||
|
||||
|
||||
@@ -324,9 +219,9 @@ 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 = "tt0045247" # This is an example ID format
|
||||
test_id = "tt32360916:1:1" # This is an example ID format
|
||||
MFP = "0"
|
||||
results = await cb01(test_id, client,MFP)
|
||||
results = await cb01({'streams': []},test_id,MFP,['test','test'],client)
|
||||
print(results)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{}
|
||||
{'PHPSESSID': 'aq7rf8gu6nd9fuk0r711899blp', 'captch4': 'bc3c5526ddc7d0a3ad827e7848f5678f'}
|
||||
+8
-4
@@ -1,5 +1,9 @@
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
import Src.Utilities.config as config
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
tivu = {
|
||||
"dazn-zona-a": "801",
|
||||
}
|
||||
@@ -171,7 +175,7 @@ async def tivu_get(id,client):
|
||||
description = hour_range + " " + program_name
|
||||
return description
|
||||
except Exception as e:
|
||||
print(e)
|
||||
logger.warning(f"EPG {e}")
|
||||
description = f'Watch {id}'
|
||||
return description
|
||||
|
||||
@@ -194,10 +198,10 @@ async def epg_guide(id,client):
|
||||
data = response.json()
|
||||
description = data['description'].replace("- EPG by epg-guide.com","").replace("No description","")
|
||||
title = data['title']
|
||||
print("MammaMia: EPG FOUND")
|
||||
logger.info("MammaMia: EPG FOUND")
|
||||
return description,title
|
||||
except Exception as e:
|
||||
print(e)
|
||||
logger.debug(e)
|
||||
description = f'Watch {id}'
|
||||
title = ""
|
||||
return description,title
|
||||
|
||||
+54
-115
@@ -2,11 +2,16 @@ from Src.Utilities.info import get_info_tmdb, is_movie, get_info_imdb
|
||||
import Src.Utilities.config as config
|
||||
from fake_headers import Headers
|
||||
from urllib.parse import quote
|
||||
from Src.Utilities.loadenv import load_env
|
||||
from Src.Utilities.loadenv import load_env
|
||||
from Src.API.extractors.mixdrop import mixdrop
|
||||
from Src.API.extractors.deltabit import deltabit
|
||||
import re
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
from bs4 import BeautifulSoup,SoupStrainer
|
||||
env_vars = load_env()
|
||||
from fake_headers import Headers
|
||||
random_headers = Headers()
|
||||
try:
|
||||
import pytesseract
|
||||
@@ -17,11 +22,11 @@ except Exception as e:
|
||||
import base64
|
||||
from io import BytesIO
|
||||
import time
|
||||
from Src.Utilities.eval import eval_solver
|
||||
import os
|
||||
import json
|
||||
import difflib
|
||||
import random
|
||||
from Src.Utilities.mfp import build_mfp
|
||||
ES_DOMAIN = config.ES_DOMAIN
|
||||
|
||||
ES_PROXY = config.ES_PROXY
|
||||
@@ -45,82 +50,6 @@ else:
|
||||
|
||||
|
||||
|
||||
|
||||
'''
|
||||
OK <a href="https://uprot.net/msf/fwbtgsssmt0q" target="_blank" rel="noopener">MaxStream</a> – <a href="https://clicka.cc/delta/6svqpze62r8z" target="_blank" rel="noopener">DeltaBit</a> – <a href="https://clicka.cc/tv/5eumjxxt" target="_blank" rel="noopener">Turbovid</a>
|
||||
pattern = r'href="([^"]+)"'
|
||||
match = re.search(pattern, text)
|
||||
href_value = match.group(1)
|
||||
'''
|
||||
async def mixdrop(url,MFP,client):
|
||||
"""Extract Mixdrop URL."""
|
||||
if "club" in url:
|
||||
url = url.replace("club", "cv").split("/2")[0]
|
||||
if "cfd" in url:
|
||||
url = url.replace("cfd", "cv").replace("emb","e").split("/2")[0]
|
||||
if MFP == "1":
|
||||
return url,""
|
||||
headers = {"accept-language": "en-US,en;q=0.5"}
|
||||
final_url = f"https:{await eval_solver(url, proxies , ForwardProxy, client)}"
|
||||
return final_url,""
|
||||
|
||||
async def deltabit(page_url,client):
|
||||
"""Extract Deltabit URL."""
|
||||
i = 0
|
||||
#Set up some headers
|
||||
headers = random_headers.generate()
|
||||
headers2 = random_headers.generate()
|
||||
|
||||
#Get the redirected link, so the actual deltabit link.
|
||||
page_url_response = await client.get(ForwardProxy + page_url,headers={**headers, 'Range': 'bytes=0-0'}, proxies=proxies)
|
||||
page_url = page_url_response.url
|
||||
print("Page_URl is",page_url)
|
||||
|
||||
#Change the referer and user agent of the generated headers
|
||||
headers2['referer'] = 'https://safego.cc/'
|
||||
headers2['user-agent'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36'
|
||||
|
||||
#Request to the deltabit link
|
||||
response = await client.get(ForwardProxy + page_url, headers = headers2, allow_redirects = True, proxies = proxies)
|
||||
page_url = response.url
|
||||
|
||||
#Often deltabit redirects to another deltabit link. We need the redirected link to put it in the headers.
|
||||
origin = page_url.split('/')[2]
|
||||
headers['origin'] = f'https://{origin}'
|
||||
headers['referer'] = page_url
|
||||
headers['user-agent'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36'
|
||||
|
||||
#We check the page for the data such as hash and fname.
|
||||
soup = BeautifulSoup(response.text, 'lxml', parse_only=SoupStrainer('input'))
|
||||
data = {}
|
||||
for input in soup:
|
||||
name = input.get('name')
|
||||
value = input.get('value')
|
||||
data[name] = value
|
||||
data['imhuman'] = ''
|
||||
data['referer']= page_url
|
||||
|
||||
#We need to wait 2.5 seconds or the request will fail
|
||||
time.sleep(2.5)
|
||||
|
||||
|
||||
|
||||
fname = data['fname']
|
||||
#Request to the deltabit link
|
||||
response = await client.post(ForwardProxy + page_url, data = data, headers = headers, proxies = proxies)
|
||||
link = re.findall(r'sources:\s*\["([^"]+)"', response.text, re.DOTALL)
|
||||
print(link)
|
||||
if not link:
|
||||
if not i >= 3:
|
||||
link,fname = await deltabit(page_url,client)
|
||||
i +=1
|
||||
else:
|
||||
link = link[0]
|
||||
|
||||
|
||||
return link,fname
|
||||
|
||||
|
||||
def convert_numbers(base64_data):
|
||||
image_data = base64.b64decode(base64_data)
|
||||
image = Image.open(BytesIO(image_data))
|
||||
@@ -154,7 +83,7 @@ async def real_page(safego_url,client):
|
||||
if len(soup)>= 1:
|
||||
return soup.a['href']
|
||||
else:
|
||||
print("Getting numbers")
|
||||
logger.info("Getting numbers")
|
||||
numbers,cookies = await get_numbers(safego_url,client)
|
||||
numbers = convert_numbers(numbers)
|
||||
data = {'captch4': numbers}
|
||||
@@ -166,7 +95,7 @@ async def real_page(safego_url,client):
|
||||
soup = BeautifulSoup(response.text,'lxml', parse_only=SoupStrainer('a'))
|
||||
return soup.a['href']
|
||||
except Exception as e:
|
||||
print(e)
|
||||
logger.info(f"ES{e}")
|
||||
async def get_host_link(pattern,atag,client):
|
||||
match = re.search(pattern, atag)
|
||||
headers = random_headers.generate()
|
||||
@@ -176,45 +105,54 @@ async def get_host_link(pattern,atag,client):
|
||||
href_value = response.url
|
||||
href = await real_page(href_value,client)
|
||||
return href
|
||||
async def scraping_links(atag,MFP,client):
|
||||
async def scraping_links(atag,MFP,MFP_CREDENTIALS,client,streams,language):
|
||||
#Check which hosts are avaiable and extract the links from one of them. Turbovid uses Cloudflare therefore is not avaiable. Maxstream has a captcha.
|
||||
if "MixDrop" and "DeltaBit" in atag:
|
||||
if "MixDrop" in atag and "DeltaBit" in atag:
|
||||
pattern = r'<a\s+href="([^"]+)"[^>]*rel="noopener"[^>]*>DeltaBit</a>'
|
||||
href = await get_host_link(pattern,atag,client)
|
||||
try:
|
||||
full_url,name = await deltabit(href,client)
|
||||
streams = await deltabit(href,client,streams,"Eurostreaming",proxies,ForwardProxy,language)
|
||||
except Exception as e:
|
||||
pattern = r'<a\s+href="([^"]+)"[^>]*rel="noopener"[^>]*>MixDrop</a>'
|
||||
href = await get_host_link(pattern,atag,client)
|
||||
full_url,name = await mixdrop(href,MFP,client)
|
||||
return full_url,name
|
||||
streams = await mixdrop(href,client,MFP,MFP_CREDENTIALS,streams,"Eurostreaming",proxies,ForwardProxy,language)
|
||||
return streams
|
||||
if "MixDrop" in atag and "DeltaBit" not in atag:
|
||||
pattern = r'<a\s+href="([^"]+)"[^>]*rel="noopener"[^>]*>MixDrop</a>'
|
||||
href = await get_host_link(pattern,atag,client)
|
||||
full_url,name = await mixdrop(href,MFP,client)
|
||||
return full_url,name
|
||||
try:
|
||||
pattern = r'<a\s+href="([^"]+)"[^>]*rel="noopener"[^>]*>MixDrop</a>'
|
||||
href = await get_host_link(pattern,atag,client)
|
||||
streams = await mixdrop(href,client,MFP,MFP_CREDENTIALS,streams,"Eurostreaming",proxies,ForwardProxy,language)
|
||||
return streams
|
||||
except Exception as e:
|
||||
return streams
|
||||
if 'DeltaBit' in atag and "MixDrop" not in atag:
|
||||
pattern = r'<a\s+href="([^"]+)"[^>]*rel="noopener"[^>]*>DeltaBit</a>'
|
||||
href = await get_host_link(pattern,atag,client)
|
||||
full_url,name = await deltabit(href,client)
|
||||
return full_url,name
|
||||
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)
|
||||
return streams
|
||||
except Exception as e:
|
||||
return streams
|
||||
if 'DeltaBit' not in atag and 'MixDrop' not in atag:
|
||||
print("Just give up")
|
||||
return None,""
|
||||
logger.info("Just give up")
|
||||
return streams
|
||||
|
||||
async def episodes_find(description,season,episode,MFP,client):
|
||||
async def episodes_find(description,season,episode,MFP,MFP_CREDENTIALS,client,streams):
|
||||
t = 0
|
||||
episode = episode.zfill(2)
|
||||
pattern = rf'{season}×{episode}\s*(.*?)(?=<br\s*/?>)'
|
||||
match = re.findall(pattern, description)
|
||||
urls= {}
|
||||
if match:
|
||||
for episode_details in match:
|
||||
if "href" in episode_details:
|
||||
full_url,name = await scraping_links(episode_details.split(' – ', 1)[1],MFP,client)
|
||||
if full_url:
|
||||
urls[full_url] = name
|
||||
return urls
|
||||
async def search(showname,date,season,episode,MFP,client):
|
||||
if t == 0:
|
||||
language = "\nITA"
|
||||
elif t == 1:
|
||||
language = "\nSUB-ITA"
|
||||
t +=1
|
||||
streams = await scraping_links(episode_details.split(' – ', 1)[1],MFP,MFP_CREDENTIALS,client,streams,language)
|
||||
return streams
|
||||
async def search(showname,date,season,episode,MFP,MFP_CREDENTIALS,client,streams):
|
||||
headers = random_headers.generate()
|
||||
|
||||
response = await client.get(ForwardProxy + f"{ES_DOMAIN}/wp-json/wp/v2/search?search={quote(showname)}&_fields=id", proxies = proxies, headers = headers)
|
||||
@@ -228,8 +166,8 @@ async def search(showname,date,season,episode,MFP,client):
|
||||
description = description['content']['rendered']
|
||||
ratio = difflib.SequenceMatcher(None, title, showname).ratio()
|
||||
if ratio >=0.96:
|
||||
urls = await episodes_find(description,season,episode,MFP,client)
|
||||
return urls
|
||||
streams = await episodes_find(description,season,episode,MFP,MFP_CREDENTIALS,client,streams)
|
||||
return streams
|
||||
else:
|
||||
year_pattern = re.compile(r'(?<!/)(19|20)\d{2}(?!/)')
|
||||
match = year_pattern.search(description)
|
||||
@@ -246,13 +184,13 @@ async def search(showname,date,season,episode,MFP,client):
|
||||
if match:
|
||||
year = match.group(0)
|
||||
if abs(int(year) - int(date)) <=1:
|
||||
urls = await episodes_find(description,season,episode,MFP,client)
|
||||
return urls
|
||||
streams = await episodes_find(description,season,episode,MFP,MFP_CREDENTIALS,client,streams)
|
||||
return streams
|
||||
return streams
|
||||
|
||||
|
||||
|
||||
|
||||
async def eurostreaming(id,client,MFP):
|
||||
async def eurostreaming(streams,id,client,MFP,MFP_CREDENTIALS):
|
||||
try:
|
||||
general = await is_movie(id)
|
||||
ismovie = general[0]
|
||||
@@ -262,16 +200,17 @@ async def eurostreaming(id,client,MFP):
|
||||
season = str(general[2])
|
||||
episode = str(general[3])
|
||||
elif ismovie == 1:
|
||||
return None
|
||||
return streams
|
||||
if "tmdb" in id:
|
||||
showname,date = get_info_tmdb(clean_id,ismovie,type)
|
||||
else:
|
||||
showname,date = await get_info_imdb(clean_id,ismovie,type,client)
|
||||
print(showname)
|
||||
urls = await search(showname,date, season,episode,MFP,client)
|
||||
return urls
|
||||
logger.info(f"ES {showname}")
|
||||
streams = await search(showname,date, season,episode,MFP,MFP_CREDENTIALS,client,streams)
|
||||
return streams
|
||||
except Exception as e:
|
||||
print(e)
|
||||
logger.warning(f"ES {e}")
|
||||
return streams
|
||||
|
||||
|
||||
|
||||
@@ -279,7 +218,7 @@ async def eurostreaming(id,client,MFP):
|
||||
async def test_euro():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
results = await eurostreaming("tt2261391:6:1",client,0)
|
||||
results = await eurostreaming({'streams': []},"tt9253284:1:4",client,"0",['test','test'])
|
||||
print(results)
|
||||
|
||||
async def test_deltabit():
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
from fake_headers import Headers
|
||||
import Src.Utilities.config as config
|
||||
from bs4 import BeautifulSoup,SoupStrainer
|
||||
import re
|
||||
import time
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
Icon = config.Icon
|
||||
Name = config.Name
|
||||
random_headers = Headers()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
async def deltabit(page_url,client,streams,site_name,proxies,ForwardProxy,language):
|
||||
"""Extract Deltabit URL."""
|
||||
i = 0
|
||||
#Set up some headers
|
||||
headers = random_headers.generate()
|
||||
headers2 = random_headers.generate()
|
||||
|
||||
#Get the redirected link, so the actual deltabit link.
|
||||
page_url_response = await client.get(ForwardProxy + page_url,headers={**headers, 'Range': 'bytes=0-0'}, proxies=proxies)
|
||||
page_url = page_url_response.url
|
||||
logger.info(f"Page_URl is {page_url}")
|
||||
|
||||
#Change the referer and user agent of the generated headers
|
||||
headers2['referer'] = 'https://safego.cc/'
|
||||
headers2['user-agent'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36'
|
||||
|
||||
#Request to the deltabit link
|
||||
response = await client.get(ForwardProxy + page_url, headers = headers2, allow_redirects = True, proxies = proxies)
|
||||
page_url = response.url
|
||||
#Often deltabit redirects to another deltabit link. We need the redirected link to put it in the headers.
|
||||
origin = page_url.split('/')[2]
|
||||
headers['origin'] = f'https://{origin}'
|
||||
headers['referer'] = page_url
|
||||
headers['user-agent'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36'
|
||||
#We check the page for the data such as hash and fname.
|
||||
soup = BeautifulSoup(response.text, 'lxml', parse_only=SoupStrainer('input'))
|
||||
data = {}
|
||||
for input in soup:
|
||||
name = input.get('name')
|
||||
value = input.get('value')
|
||||
data[name] = value
|
||||
data['imhuman'] = ''
|
||||
data['referer']= page_url
|
||||
#We need to wait 2.5 seconds or the request will fail
|
||||
time.sleep(2.5)
|
||||
|
||||
|
||||
fname = data['fname']
|
||||
#Request to the deltabit link
|
||||
response = await client.post(ForwardProxy + page_url, data = data, headers = headers, proxies = proxies)
|
||||
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)
|
||||
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()}'}})
|
||||
|
||||
|
||||
return streams
|
||||
@@ -0,0 +1,18 @@
|
||||
import Src.Utilities.config as config
|
||||
from Src.Utilities.eval import eval_solver
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
Icon = config.Icon
|
||||
Name = config.Name
|
||||
|
||||
|
||||
|
||||
async def dropload(player_link,client,streams,site_name, proxies, ForwardProxy):
|
||||
url = await eval_solver(player_link, proxies,ForwardProxy, client)
|
||||
if url:
|
||||
streams['streams'].append({'name': f"{Name}",'title': f'{Icon}{site_name}\n▶️ Dropload', 'url': url, 'behaviorHints': {'proxyHeaders': {"request": {"User-Agent": 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36'}}, 'notWebReady': True, 'bingeGroup': f'{site_name.lower()}'}})
|
||||
logger.info(f"{site_name} on Dropload found results for the current ID")
|
||||
|
||||
return streams
|
||||
@@ -0,0 +1,41 @@
|
||||
import Src.Utilities.config as config
|
||||
Icon = config.Icon
|
||||
Name = config.Name
|
||||
import re
|
||||
from fake_headers import Headers
|
||||
random_headers = Headers()
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
async def hdplayer(hdplayer,client,streams,Referer,site_name,proxies,ForwardProxy):
|
||||
headers = random_headers.generate()
|
||||
response = await client.get(hdplayer, allow_redirects=True, headers = headers)
|
||||
match = re.search(r'sources:\s*\[\s*\{\s*file\s*:\s*"([^"]*)"', response.text)
|
||||
url = match.group(1)
|
||||
if url:
|
||||
#Fix for Exoplayer which needs .m3u8 in the url to play the file
|
||||
url = url + ".m3u8"
|
||||
streams['streams'].append({'name': f"{Name}\n720/1080p",'title': f'{Icon}{site_name}\n ▶️ HDPlayer', 'url': url, 'behaviorHints': {'proxyHeaders': {"request": {"Referer": Referer}}, 'notWebReady': True, 'bingeGroup': f'{site_name.lower()}'}})
|
||||
logger.info(f"{site_name} on HDPlayer found results for the current ID")
|
||||
|
||||
return streams
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#Testing
|
||||
async def test_hdplayer():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
results = await hdplayer("https://hdplayer.gives/embed/udnjutxECQGuwsU",client,{'streams': []},'https://hdplayer.gives/', "StreamingWatch", {},'')
|
||||
print(results)
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
asyncio.run(test_hdplayer())
|
||||
@@ -0,0 +1,94 @@
|
||||
import requests
|
||||
from Crypto.Cipher import AES
|
||||
import json
|
||||
import re
|
||||
from rich.prompt import Prompt
|
||||
from rich.console import Console
|
||||
from fake_headers import Headers
|
||||
import Src.Utilities.config as config
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
Icon = config.Icon
|
||||
Name = config.Name
|
||||
'''
|
||||
This script was done mostly by @Arrowar, creator of https://github.com/Arrowar/StreamingCommunity/
|
||||
It was modified for the use in MammaMia
|
||||
'''
|
||||
|
||||
|
||||
random_headers = Headers()
|
||||
|
||||
KEY = b'kiemtienmua911ca' # 16 byte
|
||||
IV = b'1234567890oiuytr' # 16 byte
|
||||
|
||||
|
||||
async def fetch_response(client,referer,player_url,url,id, proxies, ForwardProxy):
|
||||
headers = random_headers.generate()
|
||||
headers['referer'] = player_url
|
||||
data = {
|
||||
'id': id,
|
||||
'w': '2560',
|
||||
'h': '1440',
|
||||
'r': referer,
|
||||
}
|
||||
response = await client.get(ForwardProxy + url, headers=headers, params = data, proxies = proxies)
|
||||
return response.text
|
||||
|
||||
def hex_to_bytes(hex_str):
|
||||
hex_str = re.sub(r'[^0-9a-fA-F]', '', hex_str)
|
||||
|
||||
if len(hex_str) % 2 != 0:
|
||||
hex_str = '0' + hex_str
|
||||
|
||||
return bytes(int(hex_str[i:i+2], 16) for i in range(0, len(hex_str), 2))
|
||||
|
||||
def decrypt_aes_cbc(ciphertext_bytes, key, iv):
|
||||
cipher = AES.new(key, AES.MODE_CBC, iv)
|
||||
decrypted = cipher.decrypt(ciphertext_bytes)
|
||||
|
||||
pad_len = decrypted[-1]
|
||||
if 1 <= pad_len <= 16:
|
||||
decrypted = decrypted[:-pad_len]
|
||||
|
||||
return decrypted
|
||||
|
||||
|
||||
|
||||
async def loadm(player_link,client,streams,referer,site_name,proxies,ForwardProxy):
|
||||
parts = player_link.split('#')
|
||||
id = parts[1]
|
||||
player_url = parts[0]
|
||||
api = player_url + 'api/v1/video'
|
||||
#It downloads m (crypted informations) from the API"
|
||||
response_hex = await fetch_response(client,referer,player_url,api,id, proxies, ForwardProxy)
|
||||
#Convert Hex in Bytes
|
||||
ciphertext_bytes = hex_to_bytes(response_hex)
|
||||
#We decrypt AES-CBC encryption with Key,IV and the bytes
|
||||
decrypted_bytes = decrypt_aes_cbc(ciphertext_bytes, KEY, IV)
|
||||
decrypted_str = decrypted_bytes.decode('utf-8')
|
||||
data = json.loads(decrypted_str)
|
||||
#We get the hls
|
||||
hls = data['cf']
|
||||
title = data['title']
|
||||
if hls:
|
||||
streams['streams'].append({'name': f"{Name}",'title': f'{Icon}{site_name}\n▶️ Loadm\n{title}', 'url': hls, 'behaviorHints': {'proxyHeaders': {"request": {"Referer": player_url}}, 'notWebReady': True, 'bingeGroup': f'{site_name.lower()}'}})
|
||||
logger.info(f"{site_name} on Loadm found results for the current ID")
|
||||
return streams
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#Testing
|
||||
async def test_loadm():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
results = await loadm("https://loadm.cam/#6wx1p",client,{'streams': []},'guardoserie.live', 'Guardoserie', {},"")
|
||||
print(results)
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
asyncio.run(test_loadm())
|
||||
|
||||
# https://loadm.cam/#cfnqx
|
||||
@@ -0,0 +1,31 @@
|
||||
import Src.Utilities.config as config
|
||||
Icon = config.Icon
|
||||
Name = config.Name
|
||||
from Src.Utilities.mfp import build_mfp
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
from Src.Utilities.eval import eval_solver
|
||||
|
||||
|
||||
async def mixdrop(url,client,MFP,MFP_CREDENTIALS,streams,site_name,proxies,ForwardProxy,language):
|
||||
"""Extract Mixdrop URL."""
|
||||
if "club" in url:
|
||||
url = url.replace("club", "cv").split("/2")[0]
|
||||
if "cfd" in url:
|
||||
url = url.replace("cfd", "cv").replace("emb","e").split("/2")[0]
|
||||
if MFP == "1":
|
||||
url = await build_mfp(MFP_CREDENTIALS,url,"Mixdrop",client)
|
||||
if url and "https%3ANone" not in url:
|
||||
logger.info(f"{site_name} on Mixdrop found results for the current ID")
|
||||
streams['streams'].append({'name': f"{Name} 🕵️♂️\n{language}",'title': f'{Icon}{site_name}\n▶️ MixDrop', 'url': url, 'behaviorHints':{'bingeGroup': f'{site_name.lower()}'}})
|
||||
|
||||
else:
|
||||
headers = {"accept-language": "en-US,en;q=0.5"}
|
||||
url = await eval_solver(url, proxies , ForwardProxy, client)
|
||||
if url:
|
||||
url = "https:" + url
|
||||
logger.info(f"{site_name} on Mixdrop found results for the current ID")
|
||||
streams['streams'].append({'name': f"{Name}{language}",'title': f'{Icon}{site_name}\n▶️ MixDrop', 'url': url, 'behaviorHints': {'proxyHeaders': {"request": {"User-Agent": 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36'}}, 'notWebReady': True, 'bingeGroup': f'{site_name.lower()}'}})
|
||||
return streams
|
||||
@@ -0,0 +1,18 @@
|
||||
import Src.Utilities.config as config
|
||||
from Src.Utilities.eval import eval_solver
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
Icon = config.Icon
|
||||
Name = config.Name
|
||||
|
||||
|
||||
|
||||
|
||||
async def supervideo(supervideo_link,client,streams, site_name, proxies,ForwardProxy):
|
||||
url = await eval_solver(supervideo_link,proxies, ForwardProxy, client)
|
||||
if url:
|
||||
streams['streams'].append({'name': f"{Name}",'title': f'{Icon}{site_name}\n▶️ Supervideo', 'url': url, 'behaviorHints': {'bingeGroup': f'{site_name.lower()}'}})
|
||||
logger.info(f"{site_name} on SuperVideo found results for the current ID")
|
||||
return streams
|
||||
@@ -0,0 +1,28 @@
|
||||
from fake_headers import Headers
|
||||
import Src.Utilities.config as config
|
||||
Icon = config.Icon
|
||||
Name = config.Name
|
||||
from Src.Utilities.mfp import build_mfp
|
||||
from fake_headers import Headers
|
||||
import re
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
random_headers = Headers()
|
||||
|
||||
async def uqload(player_link,client,MFP,MFP_CREDENTIALS,streams,site_name,proxies,ForwardProxy):
|
||||
headers = random_headers.generate()
|
||||
if MFP == "1":
|
||||
url = await build_mfp(MFP_CREDENTIALS, player_link, "Uqload",client)
|
||||
streams['streams'].append({'name': f"{Name} 🕵️♂️",'title': f'{Icon}Guardaflix\n▶️ Uqload', 'url': url, 'behaviorHints': {'proxyHeaders': {"request": {"User-Agent": 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36'}}, 'notWebReady': True, 'bingeGroup': 'guardaflix'}})
|
||||
return streams
|
||||
response = await client.get(ForwardProxy + player_link, headers = headers, proxies = proxies)
|
||||
video_url_match = re.search(r'sources: \["(.*?)"]', response.text)
|
||||
title = re.search(r'title: "(.*?)"', response.text).group(1)
|
||||
if video_url_match:
|
||||
url = video_url_match.group(1)
|
||||
if url:
|
||||
streams['streams'].append({'name': f"{Name}",'title': f'{Icon}{site_name}\n▶️ Uqload\n{title}', 'url': url, 'behaviorHints': {'proxyHeaders': {"request": {"User-Agent": 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36'}}, 'notWebReady': True, 'bingeGroup': f'{site_name.lower()}'}})
|
||||
logger.info(f"{site_name} on Uqload found results for the current ID")
|
||||
return streams
|
||||
@@ -0,0 +1,71 @@
|
||||
from fake_headers import Headers
|
||||
import re
|
||||
from bs4 import BeautifulSoup,SoupStrainer
|
||||
random_headers = Headers()
|
||||
import Src.Utilities.config as config
|
||||
Icon = config.Icon
|
||||
Name = config.Name
|
||||
from Src.Utilities.mfp import build_mfp
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
SC_DOMAIN = config.SC_DOMAIN
|
||||
User_Agent= "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
|
||||
|
||||
|
||||
async def vixcloud(link,client,MFP,MFP_CREDENTIALS,streams,site_name,proxies,ForwardProxy):
|
||||
if MFP == "1":
|
||||
final_url = await build_mfp(MFP_CREDENTIALS, link, "VixCloud",client)
|
||||
quality = ""
|
||||
mfp_icon = '🕵️♂️'
|
||||
else:
|
||||
mfp_icon = ''
|
||||
headers = random_headers.generate()
|
||||
headers['Referer'] = f"{SC_DOMAIN}/"
|
||||
headers['Origin'] = f"{SC_DOMAIN}"
|
||||
headers['User-Agent'] = User_Agent
|
||||
headers['user-agent'] = User_Agent
|
||||
response = await client.get(link)
|
||||
if response.status_code != 200:
|
||||
logger.warning("Failed to extract URL components, Invalid Request")
|
||||
soup = BeautifulSoup(response.text, "lxml", parse_only=SoupStrainer("body"))
|
||||
if soup:
|
||||
script = soup.find("body").find("script").text
|
||||
token = re.search(r"'token':\s*'(\w+)'", script).group(1)
|
||||
expires = re.search(r"'expires':\s*'(\d+)'", script).group(1)
|
||||
server_url = re.search(r"url:\s*'([^']+)'", script).group(1)
|
||||
try:
|
||||
quality = re.search(r'"quality":(\d+)', script).group(1)
|
||||
except:
|
||||
quality = ""
|
||||
if "?b=1" in server_url:
|
||||
final_url = f'{server_url}&token={token}&expires={expires}'
|
||||
else:
|
||||
final_url = f"{server_url}?token={token}&expires={expires}"
|
||||
if "window.canPlayFHD = true" in script:
|
||||
final_url += "&h=1"
|
||||
if final_url:
|
||||
logger.info(f"Vixcloud Found Results for the current ID")
|
||||
streams['streams'].append({"name":f'{Name} {mfp_icon}\n{quality}', 'title': f'{Icon} StreamingCommunity\n▶️ Vixcloud','url': final_url,'behaviorHints': {'proxyHeaders': {"request": {"user-agent": User_Agent}}, 'notWebReady': True, 'bingeGroup': f'{site_name.lower()}{quality}'}})
|
||||
|
||||
return streams
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#Testing
|
||||
async def test_vixcloud():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
results = await vixcloud("https://vixsrc.to/tv/204082/1/3/",client,"0",['',''],{'streams': []},'guardoserie.live', {},'')
|
||||
print(results)
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
asyncio.run(test_vixcloud())
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
from Src.Utilities.info import get_info_tmdb, is_movie, get_info_imdb
|
||||
import Src.Utilities.config as config
|
||||
from fake_headers import Headers
|
||||
from Src.Utilities.loadenv import load_env
|
||||
from urllib.parse import quote
|
||||
from bs4 import BeautifulSoup, SoupStrainer
|
||||
from Src.API.extractors.loadm import loadm
|
||||
from Src.API.extractors.uqload import uqload
|
||||
from Src.API.extractors.dropload import dropload
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
env_vars = load_env()
|
||||
random_headers = Headers()
|
||||
GF_DOMAIN = config.GF_DOMAIN
|
||||
|
||||
GF_PROXY = config.GF_PROXY
|
||||
proxies = {}
|
||||
if GF_PROXY == "1":
|
||||
PROXY_CREDENTIALS = env_vars.get('PROXY_CREDENTIALS')
|
||||
proxy_list = json.loads(PROXY_CREDENTIALS)
|
||||
proxy = random.choice(proxy_list)
|
||||
if proxy == "":
|
||||
proxies = {}
|
||||
else:
|
||||
proxies = {
|
||||
"http": proxy,
|
||||
"https": proxy
|
||||
}
|
||||
GF_ForwardProxy = config.GF_ForwardProxy
|
||||
if GF_ForwardProxy == "1":
|
||||
ForwardProxy = env_vars.get('ForwardProxy')
|
||||
else:
|
||||
ForwardProxy = ""
|
||||
|
||||
|
||||
|
||||
async def get_player(page_link,MFP, MFP_CREDENTIALS,client, headers,streams):
|
||||
response = await client.get(ForwardProxy + page_link, headers= headers, proxies = proxies)
|
||||
soup = BeautifulSoup(response.text,'lxml', parse_only=SoupStrainer('iframe'))
|
||||
iframe = soup.find('iframe')
|
||||
player_link = iframe.get('data-src') or iframe.get('src')
|
||||
if "loadm" in player_link:
|
||||
referer = page_link.split('//')[1].split('/')[0]
|
||||
streams = await loadm(player_link,client,streams,referer,"Guardaflix", proxies, ForwardProxy)
|
||||
elif "uqload" in player_link:
|
||||
streams = await uqload(player_link,client,MFP,MFP_CREDENTIALS,streams,"Guardaflix", proxies, ForwardProxy)
|
||||
elif "dropload" in player_link:
|
||||
streams = await dropload(player_link,client,streams,"Guardaflix", proxies, ForwardProxy)
|
||||
return streams
|
||||
|
||||
async def search(showname,date,MFP,MFP_CREDENTIALS,client,streams):
|
||||
headers = random_headers.generate()
|
||||
headers['Origin'] = f'{GF_DOMAIN}'
|
||||
headers['Referer'] = f'{GF_DOMAIN}/'
|
||||
headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
|
||||
showname = quote(showname)
|
||||
data = {
|
||||
'action': 'action_tr_search_suggest',
|
||||
'nonce': '20115729b4',
|
||||
'term': showname,
|
||||
}
|
||||
response = await client.post(ForwardProxy + f'{GF_DOMAIN}/wp-admin/admin-ajax.php', headers=headers, data=data, proxies = proxies)
|
||||
soup = BeautifulSoup(response.text,'lxml', parse_only= SoupStrainer('a'))
|
||||
a_tags = soup.find_all('a')
|
||||
for a in a_tags:
|
||||
href = a['href']
|
||||
logger.info(href)
|
||||
response = await client.get(ForwardProxy + href, headers = headers, proxies = proxies)
|
||||
soup = BeautifulSoup(response.text,'lxml', parse_only = SoupStrainer(['iframe', 'span']))
|
||||
year = soup.find('span',class_='year fa-calendar far').text
|
||||
if year == date:
|
||||
iframe = soup.find('iframe')
|
||||
page_link = iframe.get('data-src') or iframe.get('src')
|
||||
streams = await get_player(page_link,MFP,MFP_CREDENTIALS,client, headers,streams)
|
||||
return streams
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
async def guardaflix(streams,id,client,MFP,MFP_CREDENTIALS):
|
||||
try:
|
||||
general = await is_movie(id)
|
||||
ismovie = general[0]
|
||||
clean_id = general[1]
|
||||
type = "Guardaflix"
|
||||
if ismovie == 0:
|
||||
return streams
|
||||
if "tmdb" in id:
|
||||
showname,date = get_info_tmdb(clean_id,ismovie,type)
|
||||
else:
|
||||
showname,date = await get_info_imdb(clean_id,ismovie,type,client)
|
||||
logger.info(showname)
|
||||
streams = await search(showname,date,MFP,MFP_CREDENTIALS,client,streams)
|
||||
return streams
|
||||
except Exception as e:
|
||||
logger.warning(f'GF {e}')
|
||||
return streams
|
||||
|
||||
|
||||
|
||||
|
||||
async def test_guardaflix():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
results = await guardaflix({'streams': []},"tt16426418",client,"0",['test','test'])
|
||||
print(results)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
asyncio.run(test_guardaflix())
|
||||
+15
-44
@@ -4,8 +4,12 @@ import re
|
||||
import Src.Utilities.config as config
|
||||
from fake_headers import Headers
|
||||
from Src.Utilities.loadenv import load_env
|
||||
from Src.Utilities.eval import eval_solver
|
||||
from Src.API.extractors.supervideo import supervideo
|
||||
import json, random
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
env_vars = load_env()
|
||||
GH_PROXY = config.GH_PROXY
|
||||
proxies = {}
|
||||
@@ -25,49 +29,16 @@ if GH_ForwardProxy == "1":
|
||||
ForwardProxy = env_vars.get('ForwardProxy')
|
||||
else:
|
||||
ForwardProxy = ""
|
||||
#Get domain
|
||||
|
||||
GHD_DOMAIN = config.GHD_DOMAIN
|
||||
|
||||
random_headers = Headers()
|
||||
|
||||
|
||||
async def get_supervideo_link(link,client):
|
||||
headers = random_headers.generate()
|
||||
response = await client.get(ForwardProxy + link, headers=headers, allow_redirects=True,timeout = 30, proxies = proxies)
|
||||
s2 = re.search(r"\}\('(.+)',.+,'(.+)'\.split", response.text).group(2)
|
||||
terms = s2.split("|")
|
||||
file_index = terms.index('file')
|
||||
#I start to loop from file cause hfs it's one or two position after it usually.
|
||||
|
||||
for i in range(file_index,len(terms)):
|
||||
if "hfs" in terms[i]:
|
||||
hfs = terms[i]
|
||||
break
|
||||
urlset_index = terms.index('urlset')
|
||||
hls_index = terms.index('hls')
|
||||
result = terms[urlset_index + 1 : hls_index]
|
||||
#If the len is >1 then you have to merge the elements from the last to the first
|
||||
reversed_elements = result[::-1]
|
||||
base_url =f"https://{hfs}.serversicuro.cc/hls/"
|
||||
if len(reversed_elements) == 1:
|
||||
final_url = base_url + "," + reversed_elements[0] + ".urlset/master.m3u8"
|
||||
lenght = len(reversed_elements)
|
||||
i = 1
|
||||
for element in reversed_elements:
|
||||
base_url += element + ","
|
||||
if lenght == i:
|
||||
base_url += ".urlset/master.m3u8"
|
||||
else:
|
||||
i += 1
|
||||
final_url = base_url
|
||||
return final_url
|
||||
|
||||
async def search(clean_id,client):
|
||||
headers = random_headers.generate()
|
||||
response = await client.get(ForwardProxy + f"{GHD_DOMAIN}/set-movie-a/{clean_id}", allow_redirects=True, impersonate = "chrome124", headers = headers, proxies = proxies)
|
||||
response = await client.get(ForwardProxy + f"{GHD_DOMAIN}/set-movie-a/{clean_id}", allow_redirects=True, headers = headers, proxies = proxies)
|
||||
if response.status_code != 200:
|
||||
print(f"GuardaHD Failed to fetch search results: {response.status_code}")
|
||||
logger.warning(f"GuardaHD Failed to fetch search results: {response.status_code}")
|
||||
soup = BeautifulSoup(response.text,'lxml',parse_only=SoupStrainer('li'))
|
||||
li_tag = soup.find('li')
|
||||
href = "https:" + li_tag['data-link']
|
||||
@@ -75,26 +46,26 @@ async def search(clean_id,client):
|
||||
|
||||
|
||||
|
||||
async def guardahd(id,client):
|
||||
async def guardahd(streams,id,client):
|
||||
try:
|
||||
general = await is_movie(id)
|
||||
ismovie = general[0]
|
||||
clean_id = general[1]
|
||||
if ismovie == 0:
|
||||
return None
|
||||
return streams
|
||||
supervideo_link = await search(clean_id,client)
|
||||
final_url = await eval_solver(supervideo_link,proxies, ForwardProxy, client)
|
||||
return final_url
|
||||
streams = await supervideo(supervideo_link, client,streams,"GuardaHD",proxies, ForwardProxy)
|
||||
return streams
|
||||
except Exception as e:
|
||||
print("MammaMia: GuardaHD Failed",e)
|
||||
return None
|
||||
logger.warning(f"MammaMia: GuardaHD Failed {e}")
|
||||
return streams
|
||||
|
||||
async def test_script():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
# Replace with actual id, for example 'anime_id:episode' format
|
||||
test_id = "tt9218128" # This is an example ID format
|
||||
results = await guardahd(test_id, client)
|
||||
test_id = "tt16426418" # This is an example ID format
|
||||
results = await guardahd({'streams': []},test_id, client)
|
||||
print(results)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
+57
-75
@@ -6,9 +6,14 @@ from fake_headers import Headers
|
||||
from Src.Utilities.loadenv import load_env
|
||||
import json, random
|
||||
from Src.Utilities.info import get_info_imdb,get_info_tmdb
|
||||
from Src.Utilities.eval import eval_solver
|
||||
import urllib.parse
|
||||
from Src.Utilities.convert import get_IMDB_id_from_TMDb_id
|
||||
from Src.API.extractors.supervideo import supervideo
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
|
||||
env_vars = load_env()
|
||||
GS_PROXY = config.GS_PROXY
|
||||
proxies = {}
|
||||
@@ -32,60 +37,28 @@ else:
|
||||
GS_DOMAIN = config.GS_DOMAIN
|
||||
random_headers = Headers()
|
||||
|
||||
async def get_supervideo_link(link,client):
|
||||
headers = random_headers.generate()
|
||||
response = await client.get(ForwardProxy + link, headers=headers, allow_redirects=True,timeout = 30, proxies = proxies)
|
||||
s2 = re.search(r"\}\('(.+)',.+,'(.+)'\.split", response.text).group(2)
|
||||
terms = s2.split("|")
|
||||
file_index = terms.index('file')
|
||||
#I start to loop from file cause hfs it's one or two position after it usually.
|
||||
|
||||
for i in range(file_index,len(terms)):
|
||||
if "hfs" in terms[i]:
|
||||
hfs = terms[i]
|
||||
break
|
||||
urlset_index = terms.index('urlset')
|
||||
hls_index = terms.index('hls')
|
||||
result = terms[urlset_index + 1 : hls_index]
|
||||
#If the len is >1 then you have to merge the elements from the last to the first
|
||||
reversed_elements = result[::-1]
|
||||
base_url =f"https://{hfs}.serversicuro.cc/hls/"
|
||||
if len(reversed_elements) == 1:
|
||||
final_url = base_url + "," + reversed_elements[0] + ".urlset/master.m3u8"
|
||||
lenght = len(reversed_elements)
|
||||
i = 1
|
||||
for element in reversed_elements:
|
||||
base_url += element + ","
|
||||
if lenght == i:
|
||||
base_url += ".urlset/master.m3u8"
|
||||
else:
|
||||
i += 1
|
||||
final_url = base_url
|
||||
return final_url
|
||||
|
||||
|
||||
|
||||
async def search_imdb(clean_id,client):
|
||||
try:
|
||||
headers = random_headers.generate()
|
||||
response = await client.get(ForwardProxy + f'{GS_DOMAIN}/?story={clean_id}&do=search&subaction=search', allow_redirects=True, impersonate = "chrome124", headers = headers, proxies = proxies)
|
||||
response = await client.get(ForwardProxy + f'{GS_DOMAIN}/?story={clean_id}&do=search&subaction=search', allow_redirects=True, headers = headers, proxies = proxies)
|
||||
if response.status_code != 200:
|
||||
print(f"Guardaserie Failed to fetch search results: {response.status_code}")
|
||||
logger.warning(f"Guardaserie Failed to fetch search results: {response.status_code}")
|
||||
soup = BeautifulSoup(response.text,'lxml',parse_only=SoupStrainer('div',class_="mlnh-2"))
|
||||
div_mlnh2 = soup.select_one('div.mlnh-2:nth-of-type(2)')
|
||||
a_tag = div_mlnh2.find('h2').find('a')
|
||||
href = a_tag['href']
|
||||
return href
|
||||
except Exception as e:
|
||||
logger.warning(f'GS {e}')
|
||||
return None
|
||||
|
||||
async def search(showname,date,client):
|
||||
try:
|
||||
headers = random_headers.generate()
|
||||
showname = urllib.parse.quote(showname)
|
||||
response = await client.get(ForwardProxy + f'{GS_DOMAIN}/?story={showname}&do=search&subaction=search', allow_redirects=True, impersonate = "chrome124", headers = headers, proxies = proxies)
|
||||
response = await client.get(ForwardProxy + f'{GS_DOMAIN}/?story={showname}&do=search&subaction=search', allow_redirects=True, impersonate = "chrome124", headers = headers, proxies = proxies)
|
||||
if response.status_code != 200:
|
||||
print(f"Guardaserie Failed to fetch search results: {response.status_code}")
|
||||
logger.warning(f"Guardaserie Failed to fetch search results: {response.status_code}")
|
||||
soup = BeautifulSoup(response.text,'lxml',parse_only=SoupStrainer('div'))
|
||||
div_mlnew = soup.find_all('div', class_='mlnew')
|
||||
for mlnew in div_mlnew:
|
||||
@@ -104,7 +77,7 @@ async def search(showname,date,client):
|
||||
async def player_url(page_url, season, episode,client):
|
||||
try:
|
||||
headers = random_headers.generate()
|
||||
response = await client.get(ForwardProxy + page_url, allow_redirects=True, impersonate = "chrome124", headers = headers, proxies = proxies)
|
||||
response = await client.get(ForwardProxy + page_url, allow_redirects=True, headers = headers, proxies = proxies)
|
||||
soup = BeautifulSoup(response.text,'lxml',parse_only=SoupStrainer('a'))
|
||||
a_tag = soup.find('a', id = f"serie-{season}_{episode}")
|
||||
href = a_tag['data-link']
|
||||
@@ -116,19 +89,55 @@ async def player_url(page_url, season, episode,client):
|
||||
|
||||
|
||||
|
||||
async def guardaserie(id,client):
|
||||
async def guardaserie(streams,id,client):
|
||||
try:
|
||||
general = await is_movie(id)
|
||||
ismovie = general[0]
|
||||
clean_id = general[1]
|
||||
season = general[2]
|
||||
episode = general[3]
|
||||
'''
|
||||
if ismovie == 1:
|
||||
return streams
|
||||
if ismovie == 0:
|
||||
season = general[2]
|
||||
episode = general[3]
|
||||
type = "Guardaserie"
|
||||
page_url = await search_imdb(clean_id,client)
|
||||
supervideo_link =await player_url(page_url,season,episode,client)
|
||||
if supervideo_link:
|
||||
streams = await supervideo(supervideo_link, client, streams,"Guardaserie",proxies, ForwardProxy)
|
||||
return streams
|
||||
else:
|
||||
logger.warning(" GS Couldn't find iframe source")
|
||||
return streams
|
||||
except Exception as e:
|
||||
logger.warning(f"MammaMia: Guardaserie Failed{e}")
|
||||
return streams
|
||||
|
||||
|
||||
async def test_script():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
# Replace with actual id, for example 'anime_id:episode' format
|
||||
test_id = "tt10919420:1:1" # This is an example ID format tt0460649
|
||||
results = await guardaserie({'streams': []},test_id, client)
|
||||
print(results)
|
||||
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
asyncio.run(test_script())
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'''
|
||||
if "tt" not in clean_id:
|
||||
clean_id = await get_IMDB_id_from_TMDb_id(clean_id,client)
|
||||
print(clean_id)
|
||||
'''
|
||||
type = "Guardaserie"
|
||||
'''
|
||||
'''
|
||||
if "tt" in id:
|
||||
showname,date = await get_info_imdb(clean_id,ismovie,type,client)
|
||||
else:
|
||||
@@ -136,34 +145,7 @@ async def guardaserie(id,client):
|
||||
showname = showname.replace("'"," ")
|
||||
if "Guru" in showname:
|
||||
showname = showname.split("-")[0]
|
||||
'''
|
||||
if ismovie == 1:
|
||||
return None
|
||||
'''
|
||||
page_url = await search_imdb(clean_id,client)
|
||||
'''
|
||||
'''
|
||||
'''
|
||||
page_url = await search(showname,date,client)
|
||||
'''
|
||||
supervideo_link =await player_url(page_url,season,episode,client)
|
||||
if supervideo_link:
|
||||
final_url = await eval_solver(supervideo_link,proxies, ForwardProxy, client)
|
||||
return final_url
|
||||
else:
|
||||
print("Couldn't find iframe source")
|
||||
return None
|
||||
except Exception as e:
|
||||
print("MammaMia: Guardaserie Failed",e)
|
||||
return None
|
||||
|
||||
|
||||
async def test_script():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
# Replace with actual id, for example 'anime_id:episode' format
|
||||
test_id = "tt6226232:3:18" # This is an example ID format tt0460649
|
||||
results = await guardaserie(test_id, client)
|
||||
print(results)
|
||||
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
asyncio.run(test_script())
|
||||
'''
|
||||
@@ -0,0 +1,139 @@
|
||||
from Src.Utilities.info import get_info_tmdb, is_movie, get_info_imdb
|
||||
import Src.Utilities.config as config
|
||||
from fake_headers import Headers
|
||||
from Src.Utilities.loadenv import load_env
|
||||
from urllib.parse import quote
|
||||
from bs4 import BeautifulSoup, SoupStrainer
|
||||
import re
|
||||
from Src.API.extractors.uqload import uqload
|
||||
from Src.API.extractors.loadm import loadm
|
||||
from Src.API.extractors.dropload import dropload
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
env_vars = load_env()
|
||||
random_headers = Headers()
|
||||
GO_DOMAIN = config.GO_DOMAIN
|
||||
|
||||
GO_PROXY = config.GO_PROXY
|
||||
proxies = {}
|
||||
if GO_PROXY == "1":
|
||||
PROXY_CREDENTIALS = env_vars.get('PROXY_CREDENTIALS')
|
||||
proxy_list = json.loads(PROXY_CREDENTIALS)
|
||||
proxy = random.choice(proxy_list)
|
||||
if proxy == "":
|
||||
proxies = {}
|
||||
else:
|
||||
proxies = {
|
||||
"http": proxy,
|
||||
"https": proxy
|
||||
}
|
||||
GO_ForwardProxy = config.GO_ForwardProxy
|
||||
if GO_ForwardProxy == "1":
|
||||
ForwardProxy = env_vars.get('ForwardProxy')
|
||||
else:
|
||||
ForwardProxy = ""
|
||||
|
||||
|
||||
|
||||
async def get_player(page_link,MFP,MFP_CREDENTIALS,client, headers, streams):
|
||||
response = await client.get(ForwardProxy + page_link, headers= headers, proxies = proxies)
|
||||
soup = BeautifulSoup(response.text,'lxml', parse_only=SoupStrainer('iframe'))
|
||||
iframe = soup.find('iframe')
|
||||
player_link = iframe.get('data-src') or iframe.get('src')
|
||||
urls = []
|
||||
if "loadm" in player_link:
|
||||
referer = page_link.split('//')[1].split('/')[0]
|
||||
streams = await loadm(player_link,client,streams,referer,"Guardoserie", proxies,ForwardProxy)
|
||||
elif "uqload" in player_link:
|
||||
streams = await uqload(player_link,client,MFP,MFP_CREDENTIALS,streams,"Guardoserie",proxies,ForwardProxy)
|
||||
elif "dropload" in player_link:
|
||||
streams = await dropload(player_link,client,streams,"Guardoserie",proxies,ForwardProxy)
|
||||
return streams
|
||||
|
||||
|
||||
async def search(showname,date,season,episode,MFP, MFP_CREDENTIALS,ismovie,client,streams,):
|
||||
headers = random_headers.generate()
|
||||
headers['Origin'] = f'{GO_DOMAIN}'
|
||||
headers['Referer'] = f'{GO_DOMAIN}/'
|
||||
headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
|
||||
showname = quote(showname)
|
||||
data = f's={showname}&action=searchwp_live_search&swpengine=default&swpquery={showname}'
|
||||
response = await client.post(ForwardProxy + f'{GO_DOMAIN}/wp-admin/admin-ajax.php', data = data, headers = headers, proxies = proxies)
|
||||
soup = BeautifulSoup(response.text,'lxml', parse_only= SoupStrainer('a', class_='ss-title'))
|
||||
a_tags = soup.find_all('a')
|
||||
for a in a_tags:
|
||||
href = a['href']
|
||||
response = await client.get(ForwardProxy + href, headers = headers, proxies = proxies)
|
||||
pattern = r'(?<=/release-year\/)(\d{4})(?=\/" rel="tag">)'
|
||||
match = re.search(pattern, response.text)
|
||||
if match:
|
||||
year = match.group(0)
|
||||
if year == date:
|
||||
if ismovie == 0:
|
||||
soup = BeautifulSoup(response.text, 'lxml', parse_only= SoupStrainer('div', class_='les-content'))
|
||||
divs = soup.find_all('div', class_='les-content')
|
||||
actual_div = divs[int(season)-1]
|
||||
episodes_a = actual_div.find_all('a')
|
||||
actual_episode = episodes_a[int(episode)-1]
|
||||
page_link = actual_episode['href']
|
||||
logger.info(page_link)
|
||||
elif ismovie == 1:
|
||||
page_link = href
|
||||
streams = await get_player(page_link,MFP,MFP_CREDENTIALS,client, headers,streams)
|
||||
return streams
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
async def guardoserie(streams,id,client,MFP,MFP_CREDENTIALS):
|
||||
try:
|
||||
general = await is_movie(id)
|
||||
ismovie = general[0]
|
||||
clean_id = general[1]
|
||||
type = "Guardoserie"
|
||||
if ismovie == 0 :
|
||||
season = str(general[2])
|
||||
episode = str(general[3])
|
||||
elif ismovie == 1:
|
||||
season = None
|
||||
episode = None
|
||||
if "tmdb" in id:
|
||||
showname,date = get_info_tmdb(clean_id,ismovie,type)
|
||||
else:
|
||||
showname,date = await get_info_imdb(clean_id,ismovie,type,client)
|
||||
logger.info(f'GO {showname}')
|
||||
streams = await search(showname,date, season,episode,MFP,MFP_CREDENTIALS,ismovie,client,streams)
|
||||
return streams
|
||||
except Exception as e:
|
||||
logger.warning(f'GO {e}')
|
||||
return streams
|
||||
|
||||
|
||||
|
||||
|
||||
async def test_guardoserie():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
results = await guardoserie({'streams': []},"tt16426418",client,"1",['test','test'])
|
||||
print(results)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
asyncio.run(test_guardoserie())
|
||||
+26
-353
@@ -1,14 +1,16 @@
|
||||
from bs4 import BeautifulSoup,SoupStrainer
|
||||
from Src.Utilities.convert import get_TMDb_id_from_IMDb_id
|
||||
from Src.Utilities.info import get_info_tmdb, is_movie, get_info_imdb
|
||||
from Src.Utilities.info import is_movie
|
||||
import Src.Utilities.config as config
|
||||
import json
|
||||
import random
|
||||
import re
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
from fake_headers import Headers
|
||||
from Src.Utilities.loadenv import load_env
|
||||
import urllib.parse
|
||||
from Src.API.extractors.vixcloud import vixcloud
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
User_Agent= "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0"
|
||||
|
||||
env_vars = load_env()
|
||||
@@ -51,354 +53,36 @@ else:
|
||||
ForwardProxy = ""
|
||||
#Get domain
|
||||
SC_DOMAIN = config.SC_DOMAIN
|
||||
Public_Instance = config.Public_Instance
|
||||
Alternative_Link = env_vars.get('ALTERNATIVE_LINK')
|
||||
headers = Headers()
|
||||
#GET VERSION OF STREAMING COMMUNITY:
|
||||
async def get_version(client):
|
||||
#Extract the version from the main page of the site
|
||||
#You can extract it from any page of the site but I chose one of the lightiest
|
||||
|
||||
try:
|
||||
random_headers = headers.generate()
|
||||
random_headers['Referer'] = f"{SC_DOMAIN}/"
|
||||
random_headers['Origin'] = f"{SC_DOMAIN}"
|
||||
base_url = f'{SC_DOMAIN}/richiedi-un-titolo'
|
||||
response = await client.get(ForwardProxy + base_url, headers=random_headers, allow_redirects = True, impersonate="chrome124", proxies = proxies)
|
||||
#Soup the response
|
||||
soup = BeautifulSoup(response.text, "lxml")
|
||||
|
||||
# Extract version
|
||||
version = json.loads(soup.find("div", {"id": "app"}).get("data-page"))['version']
|
||||
return version
|
||||
except Exception as e:
|
||||
print("Couldn't find the version",e)
|
||||
version = "65e52dcf34d64173542cd2dc6b8bb75b"
|
||||
return version
|
||||
|
||||
async def search(query,date,ismovie, client,SC_FAST_SEARCH,movie_id):
|
||||
'''
|
||||
This function is used to search for a movie or a show in the Streaming Community website using the API
|
||||
After it checks if the imdb id given is the same as the one in the website
|
||||
We need to convert imdb id to tmdb id because often imdb ids are missing
|
||||
'''
|
||||
random_headers = headers.generate()
|
||||
random_headers['Referer'] = f"{SC_DOMAIN}/"
|
||||
random_headers['Origin'] = f"{SC_DOMAIN}"
|
||||
random_headers['Accept'] = 'application/json' # Assuming the API returns JSON
|
||||
random_headers['Content-Type'] = 'application/json'
|
||||
#Do a request to get the ID of serie/move and it's slug in the URL
|
||||
response = await client.get(ForwardProxy + query, headers = random_headers, allow_redirects=True, impersonate = "chrome124", proxies = proxies)
|
||||
print(response)
|
||||
response = response.json()
|
||||
for item in response['data']:
|
||||
tid = item['id']
|
||||
slug = item['slug']
|
||||
type = item['type']
|
||||
if type == "tv":
|
||||
type = 0
|
||||
elif type == "movie":
|
||||
type = 1
|
||||
if type == ismovie:
|
||||
#Added a Check to see if the result is what it is supposed to be
|
||||
if SC_FAST_SEARCH == "0":
|
||||
random_headers = headers.generate()
|
||||
random_headers['Referer'] = f"{SC_DOMAIN}/"
|
||||
random_headers['Origin'] = f"{SC_DOMAIN}"
|
||||
response = await client.get ( ForwardProxy + f'{SC_DOMAIN}/it/titles/{tid}-{slug}', headers = random_headers, allow_redirects=True,impersonate = "chrome124", proxies = proxies)
|
||||
soup = BeautifulSoup(response.text, "lxml")
|
||||
data = json.loads(soup.find("div", {"id": "app"}).get("data-page"))
|
||||
version = data['version']
|
||||
if "tt" in movie_id:
|
||||
movie_id = str(await get_TMDb_id_from_IMDb_id(movie_id,client))
|
||||
print(movie_id)
|
||||
#Here we need to convert because the IMDB ID is often bugged
|
||||
tmdb_id = str(data['props']['title']['tmdb_id'])
|
||||
if tmdb_id == movie_id:
|
||||
return tid,slug,version
|
||||
elif SC_FAST_SEARCH == "1":
|
||||
version = await get_version(client)
|
||||
return tid,slug,version
|
||||
else:
|
||||
print("Couldn't find anything")
|
||||
|
||||
|
||||
async def get_film(tid,version,client,MFP):
|
||||
''''
|
||||
This function is used to get the link of the m3u8 from the Streaming Community player,vixcloud
|
||||
'''
|
||||
random_headers = headers.generate()
|
||||
random_headers['Referer'] = f"{SC_DOMAIN}/"
|
||||
random_headers['Origin'] = f"{SC_DOMAIN}"
|
||||
random_headers['x-inertia'] = "true"
|
||||
random_headers['x-inertia-version'] = version
|
||||
random_headers['User-Agent'] = User_Agent
|
||||
random_headers['user-agent'] = User_Agent
|
||||
#Access the iframe
|
||||
url = f'{SC_DOMAIN}/it/iframe/{tid}'
|
||||
if MFP == "1":
|
||||
url = f'{SC_DOMAIN}/it/iframe/{tid}'
|
||||
quality = "Unknown"
|
||||
return url,quality
|
||||
response = await client.get(ForwardProxy + url, headers=random_headers, allow_redirects=True,impersonate = "chrome124", proxies = proxies)
|
||||
iframe = BeautifulSoup(response.text, 'lxml')
|
||||
#Get the link of iframe
|
||||
iframe = iframe.find('iframe').get("src")
|
||||
#Get the ID containted in the src of iframe
|
||||
vixid = iframe.split("/embed/")[1].split("?")[0]
|
||||
parsed_url = urlparse(iframe)
|
||||
query_params = parse_qs(parsed_url.query)
|
||||
random_headers = headers.generate()
|
||||
random_headers['Referer'] = f"{SC_DOMAIN}/"
|
||||
random_headers['Origin'] = f"{SC_DOMAIN}"
|
||||
random_headers['x-inertia'] = "true"
|
||||
random_headers['x-inertia-version'] = version
|
||||
random_headers['User-Agent'] = User_Agent
|
||||
random_headers['user-agent'] = User_Agent
|
||||
#Get real token and expires by looking at the page in the iframe, vixcloud/embed
|
||||
resp = await client.get(ForwardProxy + iframe, headers = random_headers, allow_redirects=True,impersonate= "chrome124", proxies = proxies2)
|
||||
soup= BeautifulSoup(resp.text, "lxml")
|
||||
script = soup.find("body").find("script").text
|
||||
token = re.search(r"'token':\s*'(\w+)'", script).group(1)
|
||||
expires = re.search(r"'expires':\s*'(\d+)'", script).group(1)
|
||||
quality = re.search(r'"quality":(\d+)', script).group(1)
|
||||
base_url = re.search(r"url:\s*'(https?://[^']+)'", 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}'
|
||||
if 'canPlayFHD' in query_params:
|
||||
canPlayFHD = 'h=1'
|
||||
url += "&h=1"
|
||||
if 'b=1' in base_url:
|
||||
url += "&b=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}"
|
||||
'''
|
||||
return url,quality
|
||||
|
||||
async def get_season_episode_id(tid,slug,season,episode,version,client):
|
||||
'''
|
||||
This function is used to get the ID of the episode in the Streaming Community website
|
||||
'''
|
||||
random_headers = headers.generate()
|
||||
random_headers['Referer'] = f"{SC_DOMAIN}/"
|
||||
random_headers['Origin'] = f"{SC_DOMAIN}"
|
||||
random_headers['x-inertia'] = "true"
|
||||
random_headers['x-inertia-version'] = version
|
||||
random_headers['accept'] = 'text/html, application/xhtml+xml'
|
||||
random_headers['accept-language'] = 'it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7'
|
||||
|
||||
#Set some basic headers for the request
|
||||
#Get episode ID
|
||||
response = await client.get(ForwardProxy + f'{SC_DOMAIN}/it/titles/{tid}-{slug}/season-{season}', headers=random_headers, allow_redirects=True, impersonate = "chrome124", proxies = proxies)
|
||||
# Print the json got
|
||||
json_response = response.json().get('props', {}).get('loadedSeason', {}).get('episodes', [])
|
||||
for dict_episode in json_response:
|
||||
if dict_episode['number'] == episode:
|
||||
return dict_episode['id']
|
||||
|
||||
|
||||
|
||||
async def extractor(link,client):
|
||||
random_headers = headers.generate()
|
||||
random_headers['Referer'] = f"{SC_DOMAIN}/"
|
||||
random_headers['Origin'] = f"{SC_DOMAIN}"
|
||||
random_headers['User-Agent'] = User_Agent
|
||||
random_headers['user-agent'] = User_Agent
|
||||
response = await client.get(link)
|
||||
if response.status_code != 200:
|
||||
print("Failed to extract URL components, Invalid Request")
|
||||
soup = BeautifulSoup(response.text, "lxml", parse_only=SoupStrainer("body"))
|
||||
if soup:
|
||||
script = soup.find("body").find("script").text
|
||||
token = re.search(r"'token':\s*'(\w+)'", script).group(1)
|
||||
expires = re.search(r"'expires':\s*'(\d+)'", script).group(1)
|
||||
server_url = re.search(r"url:\s*'([^']+)'", script).group(1)
|
||||
quality = re.search(r'"quality":(\d+)', script).group(1)
|
||||
if "?b=1" in server_url:
|
||||
final_url = f'{server_url}&token={token}&expires={expires}'
|
||||
else:
|
||||
final_url = f"{server_url}?token={token}&expires={expires}"
|
||||
if "window.canPlayFHD = true" in script:
|
||||
final_url += "&h=1"
|
||||
return final_url,quality
|
||||
|
||||
|
||||
async def get_episode_link(episode_id,tid,version,client,MFP):
|
||||
''''
|
||||
This function is used to get the link of the m3u8 from the Streaming Community player,vixcloud
|
||||
'''
|
||||
#The parameters for the request
|
||||
random_headers = headers.generate()
|
||||
random_headers['Referer'] = f"{SC_DOMAIN}/"
|
||||
random_headers['Origin'] = f"{SC_DOMAIN}"
|
||||
random_headers['User-Agent'] = User_Agent
|
||||
random_headers['user-agent'] = User_Agent
|
||||
params = {
|
||||
'episode_id': episode_id,
|
||||
'next_episode': '1'
|
||||
}
|
||||
#Let's try to get the link from iframe source
|
||||
# Make a request to get iframe source
|
||||
if MFP == "1":
|
||||
url = f'{SC_DOMAIN}/it/iframe/{tid}?episode_id={episode_id}&next_episode=1'
|
||||
quality = "Unknown"
|
||||
return url,quality
|
||||
response = await client.get(ForwardProxy + f"{SC_DOMAIN}/it/iframe/{tid}", params=params, headers = random_headers, allow_redirects=True, impersonate = "chrome124", proxies = proxies)
|
||||
|
||||
# Parse response with BeautifulSoup to get iframe source
|
||||
soup = BeautifulSoup(response.text, "lxml")
|
||||
iframe = soup.find("iframe").get("src")
|
||||
vixid = iframe.split("/embed/")[1].split("?")[0]
|
||||
random_headers = headers.generate()
|
||||
random_headers['Referer'] = f"{SC_DOMAIN}/"
|
||||
random_headers['Origin'] = f"{SC_DOMAIN}"
|
||||
random_headers['x-inertia'] = "true"
|
||||
random_headers['x-inertia-version'] = version
|
||||
random_headers['User-Agent'] = User_Agent
|
||||
random_headers['user-agent'] = User_Agent
|
||||
parsed_url = urlparse(iframe)
|
||||
query_params = parse_qs(parsed_url.query)
|
||||
#Get real token and expires by looking at the page in the iframe, vixcloud/embed
|
||||
resp = await client.get(ForwardProxy + iframe, headers = random_headers, allow_redirects=True, impersonate = "chrome124", proxies = proxies2)
|
||||
soup= BeautifulSoup(resp.text, "lxml")
|
||||
script = soup.find("body").find("script").text
|
||||
token = re.search(r"'token':\s*'(\w+)'", script).group(1)
|
||||
expires = re.search(r"'expires':\s*'(\d+)'", script).group(1)
|
||||
quality = re.search(r'"quality":(\d+)', script).group(1)
|
||||
base_url = re.search(r"url:\s*'(https?://[^']+)'", 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}'
|
||||
if 'canPlayFHD' in query_params:
|
||||
canPlayFHD = 'h=1'
|
||||
url += "&h=1"
|
||||
if 'b=1' in base_url:
|
||||
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}"
|
||||
'''
|
||||
return url,quality
|
||||
|
||||
|
||||
async def streamingcommunity_site(imdb,client,SC_FAST_SEARCH,MFP):
|
||||
general = await is_movie(imdb)
|
||||
async def vixsrc(streams,id,client,MFP,MFP_CREDENTIALS):
|
||||
general = await is_movie(id)
|
||||
ismovie = general[0]
|
||||
imdb_id = general[1]
|
||||
clean_id = general[1]
|
||||
if "tt" in id:
|
||||
tmdb_id = await get_TMDb_id_from_IMDb_id(clean_id,client)
|
||||
else:
|
||||
tmdb_id = clean_id
|
||||
if ismovie == 0 :
|
||||
season = int(general[2])
|
||||
episode = int(general[3])
|
||||
#Check if fast search is enabled or disabled
|
||||
if SC_FAST_SEARCH == "1":
|
||||
type = "StreamingCommunityFS"
|
||||
if "tt" in imdb:
|
||||
#Get showname
|
||||
showname = await get_info_imdb(imdb_id,ismovie,type,client)
|
||||
date = None
|
||||
else:
|
||||
#I just set n season to None to avoid bugs, but it is not needed if Fast search is enabled
|
||||
date = None
|
||||
#else just equals them
|
||||
tmdba = imdb_id.replace("tmdb:","")
|
||||
showname = get_info_tmdb(tmdba,ismovie,type)
|
||||
elif SC_FAST_SEARCH == "0":
|
||||
type = "StreamingCommunity"
|
||||
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
|
||||
site_url = f'{SC_DOMAIN}/tv/{tmdb_id}/{general[2]}/{general[3]}/'
|
||||
else:
|
||||
if SC_FAST_SEARCH == "1":
|
||||
type = "StreamingCommunityFS"
|
||||
if "tt" in imdb:
|
||||
#Get showname
|
||||
date = None
|
||||
showname = await get_info_imdb(imdb_id,ismovie,type,client)
|
||||
else:
|
||||
date = None
|
||||
tmdba = imdb_id.replace("tmdb:","")
|
||||
showname = get_info_tmdb(tmdba,ismovie,type)
|
||||
elif SC_FAST_SEARCH == "0":
|
||||
type = "StreamingCommunity"
|
||||
if "tt" in imdb:
|
||||
#Get showname
|
||||
showname,date = await get_info_imdb(imdb_id,ismovie,type,client)
|
||||
else:
|
||||
tmdba = imdb_id.replace("tmdb:","")
|
||||
showname,date = get_info_tmdb(tmdba,ismovie,type)
|
||||
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
|
||||
showname = urllib.parse.quote_plus(showname)
|
||||
query = f'{SC_DOMAIN}/api/search?q={showname}'
|
||||
tid,slug,version = await search(query,date,ismovie,client,SC_FAST_SEARCH,imdb_id)
|
||||
if ismovie == 1:
|
||||
#TID means temporaly ID
|
||||
url,quality = await get_film(tid,version,client,MFP)
|
||||
print("MammaMia found results for StreamingCommunity")
|
||||
return url,quality,slug
|
||||
if ismovie == 0:
|
||||
#Uid = URL ID
|
||||
episode_id = await get_season_episode_id(tid,slug,season,episode,version,client)
|
||||
url,quality = await get_episode_link(episode_id,tid,version,client,MFP)
|
||||
return url,quality,slug
|
||||
|
||||
async def vixsrc(imdb,client,SC_FAST_SEARCH,MFP):
|
||||
general = await is_movie(imdb)
|
||||
ismovie = general[0]
|
||||
id = general[1]
|
||||
if "tt" in imdb:
|
||||
tmdb = await get_TMDb_id_from_IMDb_id(id,client)
|
||||
else:
|
||||
tmdb = id
|
||||
if ismovie == 0 :
|
||||
season = int(general[2])
|
||||
episode = int(general[3])
|
||||
site_url = f'{SC_DOMAIN}/tv/{tmdb}/{general[2]}/{general[3]}/'
|
||||
else:
|
||||
site_url = f'{SC_DOMAIN}/movie/{tmdb}/'
|
||||
if MFP == "1":
|
||||
quality = "Unknown"
|
||||
return site_url,quality,""
|
||||
else:
|
||||
full_url,quality = await extractor(site_url,client)
|
||||
return full_url,quality,""
|
||||
site_url = f'{SC_DOMAIN}/movie/{tmdb_id}/'
|
||||
streams = await vixcloud(site_url,client,MFP,MFP_CREDENTIALS,streams,"Vixcloud",proxies,ForwardProxy)
|
||||
return streams
|
||||
|
||||
|
||||
async def streaming_community(imdb,client,SC_FAST_SEARCH,MFP):
|
||||
async def streaming_community(streams,id,client,MFP,MFP_CREDENTIALS):
|
||||
try:
|
||||
if "vixsrc" in SC_DOMAIN:
|
||||
url,quality,slug = await vixsrc(imdb,client,SC_FAST_SEARCH,MFP)
|
||||
elif "streaming" in SC_DOMAIN:
|
||||
url,quality,slug = await streamingcommunity_site(imdb,client,SC_FAST_SEARCH,MFP)
|
||||
return url,quality,slug
|
||||
streams = await vixsrc(streams,id,client,MFP,MFP_CREDENTIALS)
|
||||
return streams
|
||||
except Exception as e:
|
||||
print("StreamingCommunity failed",e)
|
||||
return None,None,None
|
||||
logger.warning(f"StreamingCommunity failed {e}")
|
||||
return streams
|
||||
|
||||
'''
|
||||
|
||||
'''
|
||||
async def test_animeworld():
|
||||
|
||||
|
||||
async def test_vixsrc():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
# Replace with actual id, for example 'anime_id:episode' format
|
||||
@@ -408,7 +92,7 @@ async def test_animeworld():
|
||||
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
asyncio.run(test_animeworld())
|
||||
asyncio.run(test_vixsrc())
|
||||
|
||||
|
||||
|
||||
@@ -418,14 +102,3 @@ if __name__ == "__main__":
|
||||
|
||||
|
||||
|
||||
'''
|
||||
if Public_Instance == "1":
|
||||
Weird_Link = json.loads(Alternative_Link)
|
||||
link_post = random.choice(Weird_Link)
|
||||
response = await client.get(f"{link_post}fetch-data/{SC_FAST_SEARCH}/{SC_DOMAIN}/{imdb}")
|
||||
url_streaming_community = response.headers.get('x-url-streaming-community')
|
||||
url_720_streaming_community = response.headers.get('x-url-720-streaming-community')
|
||||
quality_sc = response.headers.get('x-quality-sc')
|
||||
print(quality_sc,url_streaming_community)
|
||||
return url_streaming_community,url_720_streaming_community,quality_sc
|
||||
'''
|
||||
+42
-21
@@ -4,9 +4,37 @@ from Src.Utilities.info import get_info_tmdb, is_movie, get_info_imdb
|
||||
import Src.Utilities.config as config
|
||||
import re
|
||||
import json
|
||||
from Src.API.extractors.hdplayer import hdplayer
|
||||
from Src.Utilities.loadenv import load_env
|
||||
import logging
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
|
||||
SW_DOMAIN = config.SW_DOMAIN
|
||||
env_vars = load_env()
|
||||
SW_PROXY = config.SW_PROXY
|
||||
proxies = {}
|
||||
if SW_PROXY == "1":
|
||||
PROXY_CREDENTIALS = env_vars.get('PROXY_CREDENTIALS')
|
||||
proxy_list = json.loads(PROXY_CREDENTIALS)
|
||||
proxy = random.choice(proxy_list)
|
||||
if proxy == "":
|
||||
proxies = {}
|
||||
else:
|
||||
proxies = {
|
||||
"http": proxy,
|
||||
"https": proxy
|
||||
}
|
||||
SW_ForwardProxy = config.SW_ForwardProxy
|
||||
if SW_ForwardProxy == "1":
|
||||
ForwardProxy = env_vars.get('ForwardProxy')
|
||||
else:
|
||||
ForwardProxy = ""
|
||||
|
||||
|
||||
async def wponce_get(client):
|
||||
response = await client.get(f"{SW_DOMAIN}/contatto/")
|
||||
response = await client.get(ForwardProxy + f"{SW_DOMAIN}/contatto/", proxies = proxies)
|
||||
pattern = r'"admin_ajax_nonce":"(\w+)"'
|
||||
matches = re.findall(pattern, response.text)
|
||||
wponce = matches[1]
|
||||
@@ -41,7 +69,7 @@ async def search(showname,season,episode,date,ismovie,client):
|
||||
cookies = {
|
||||
'wordpress_test_cookie': 'WP%20Cookie%20check',
|
||||
}
|
||||
response = await client.post(query,cookies=cookies, headers=headers, data=data)
|
||||
response = await client.post(ForwardProxy + query,cookies=cookies, headers=headers, data=data, proxies = proxies)
|
||||
soup = BeautifulSoup(response.content,'lxml')
|
||||
all_page_dates = soup.find_all(id = 'search-cat-year')
|
||||
all_hrefs = soup.find_all('a')
|
||||
@@ -50,7 +78,7 @@ async def search(showname,season,episode,date,ismovie,client):
|
||||
if date == page_date:
|
||||
href = temp_href['href']
|
||||
href = soup.find('a')['href']
|
||||
response = await client.get(href, allow_redirects=True, impersonate = "chrome124")
|
||||
response = await client.get(ForwardProxy + href, allow_redirects=True, proxies = proxies)
|
||||
soup = BeautifulSoup(response.text,'lxml',parse_only=SoupStrainer('iframe'))
|
||||
iframe = soup.find('iframe')
|
||||
hdplayer = iframe.get('data-lazy-src')
|
||||
@@ -58,11 +86,11 @@ async def search(showname,season,episode,date,ismovie,client):
|
||||
return hdplayer
|
||||
elif ismovie == 0:
|
||||
#Some series have the name in english so we first search with the categories option and then we use the obtained ID to get all the episodes
|
||||
id_response = await client.get(f'{SW_DOMAIN}/wp-json/wp/v2/categories?search={showname}&_fields=id', allow_redirects=True, impersonate = "chrome120")
|
||||
id_response = await client.get(ForwardProxy + f'{SW_DOMAIN}/wp-json/wp/v2/categories?search={showname}&_fields=id', allow_redirects=True, proxies = proxies)
|
||||
data = json.loads(id_response.text)
|
||||
category_id = data[0]['id']
|
||||
query = f'{SW_DOMAIN}/wp-json/wp/v2/posts?categories={category_id}&per_page=100'
|
||||
response = await client.get(query, allow_redirects=True, impersonate = "chrome120")
|
||||
response = await client.get(ForwardProxy + query, allow_redirects=True, impersonate = "chrome120", proxies = proxies)
|
||||
data_json = response.text
|
||||
data = json.loads(data_json)
|
||||
for entry in data:
|
||||
@@ -75,13 +103,8 @@ async def search(showname,season,episode,date,ismovie,client):
|
||||
end = content.find('"', start) #end of url
|
||||
hdplayer = content[start:end]
|
||||
return hdplayer
|
||||
async def hls_url(hdplayer,client):
|
||||
response = await client.get(hdplayer, allow_redirects=True, impersonate = "chrome120")
|
||||
match = re.search(r'sources:\s*\[\s*\{\s*file\s*:\s*"([^"]*)"', response.text)
|
||||
url = match.group(1)
|
||||
|
||||
return url
|
||||
async def streamingwatch(imdb,client):
|
||||
async def streamingwatch(streams,imdb,client):
|
||||
try:
|
||||
general = await is_movie(imdb)
|
||||
ismovie = general[0]
|
||||
@@ -103,23 +126,21 @@ async def streamingwatch(imdb,client):
|
||||
tmdba = imdb_id
|
||||
showname,date = get_info_tmdb(tmdba,ismovie,type)
|
||||
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+").replace("&","")
|
||||
hdplayer = await search(showname,season,episode,date,ismovie,client)
|
||||
url = await hls_url(hdplayer,client)
|
||||
if url:
|
||||
#Fix for Exoplayer which needs .m3u8 in the url to play the file
|
||||
url = url + ".m3u8"
|
||||
return url,hdplayer
|
||||
url_hdplayer = await search(showname,season,episode,date,ismovie,client)
|
||||
streams = await hdplayer(url_hdplayer,client,streams,url_hdplayer,"Streamingwatch",proxies,ForwardProxy)
|
||||
return streams
|
||||
except Exception as e:
|
||||
print("MammaMia: StreamingWatch Failed",e)
|
||||
return None,None
|
||||
logger.warning(f"MammaMia: StreamingWatch Failed {e}")
|
||||
return streams
|
||||
|
||||
|
||||
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 = "tt1190634:4:8" # This is an example ID format
|
||||
results = await streamingwatch(test_id, client)
|
||||
test_id = "tt16426418" # This is an example ID format
|
||||
results = await streamingwatch({'streams': []},test_id, client)
|
||||
print(results)
|
||||
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
|
||||
+19
-26
@@ -1,6 +1,6 @@
|
||||
#LOAD THE CONFIG
|
||||
import json
|
||||
|
||||
import logging
|
||||
# Open the configuration file
|
||||
with open('config.json') as f:
|
||||
# Load JSON data from file
|
||||
@@ -8,36 +8,24 @@ with open('config.json') as f:
|
||||
|
||||
# Accessing SC_DOMAIN
|
||||
SITE = config["Siti"]
|
||||
FT_DOMAIN = SITE["Filmpertutti"]['url']
|
||||
SC_DOMAIN = SITE["StreamingCommunity"]['url']
|
||||
TF_DOMAIN = SITE["Tantifilm"]['url']
|
||||
LC_DOMAIN = SITE["LordChannel"]['url']
|
||||
SW_DOMAIN = SITE["StreamingWatch"]['url']
|
||||
AW_DOMAIN = SITE['AnimeWorld']['url']
|
||||
SKY_DOMAIN = SITE['SkyStreaming']['url']
|
||||
CB_DOMAIN = SITE['CB01']['url']
|
||||
DDL_DOMAIN = SITE['DDLStream']['url']
|
||||
DLHD_DOMAIN = SITE['DaddyLiveHD']['url']
|
||||
GS_DOMAIN = SITE['Guardaserie']['url']
|
||||
GHD_DOMAIN = SITE['GuardaHD']['url']
|
||||
OST_DOMAIN = SITE['Onlineserietv']['domain']
|
||||
ES_DOMAIN = SITE['Eurostreaming']['url']
|
||||
GF_DOMAIN = SITE['Guardaflix']['url']
|
||||
GO_DOMAIN = SITE['Guardoserie']['url']
|
||||
SC = SITE['StreamingCommunity']['enabled']
|
||||
FT = SITE['Filmpertutti']['enabled']
|
||||
TF = SITE['Tantifilm']['enabled']
|
||||
LC = SITE['LordChannel']['enabled']
|
||||
SW = SITE['StreamingWatch']['enabled']
|
||||
AW = SITE['AnimeWorld']['enabled']
|
||||
SKY = SITE['SkyStreaming']['enabled']
|
||||
CB = SITE['CB01']['enabled']
|
||||
DDL = SITE['DDLStream']['enabled']
|
||||
MYSTERIUS = SITE['Mysterius']['enabled']
|
||||
GS = SITE['Guardaserie']['enabled']
|
||||
GHD = SITE['GuardaHD']['enabled']
|
||||
OST = SITE['Onlineserietv']['enabled']
|
||||
ES= SITE['Eurostreaming']['enabled']
|
||||
DLHD = SITE['DaddyLiveHD']['enabled']
|
||||
TF_ForwardProxy = SITE['Tantifilm']["TF_ForwardProxy"]
|
||||
GF = SITE['Guardaflix']['enabled']
|
||||
GO = SITE['Guardoserie']['enabled']
|
||||
SC_ForwardProxy = SITE['StreamingCommunity']["SC_ForwardProxy"]
|
||||
GS_ForwardProxy = SITE['Guardaserie']["GS_ForwardProxy"]
|
||||
GH_ForwardProxy = SITE['GuardaHD']["GH_ForwardProxy"]
|
||||
@@ -45,22 +33,21 @@ VX_ForwardProxy = SITE['StreamingCommunity']["VX_ForwardProxy"]
|
||||
AW_ForwardProxy = SITE['AnimeWorld']["AW_ForwardProxy"]
|
||||
MX_ForwardProxy = SITE['CB01']["MX_ForwardProxy"]
|
||||
CB_ForwardProxy = SITE['CB01']["CB_ForwardProxy"]
|
||||
OST_ForwardProxy = SITE['Onlineserietv']["OST_ForwardProxy"]
|
||||
ES_ForwardProxy = SITE['Eurostreaming']['ES_ForwardProxy']
|
||||
GF_ForwardProxy = SITE['Guardaflix']['GF_ForwardProxy']
|
||||
GO_ForwardProxy = SITE['Guardoserie']['GO_ForwardProxy']
|
||||
SW_ForwardProxy = SITE['StreamingWatch']['SW_ForwardProxy']
|
||||
GS_PROXY = SITE['Guardaserie']["GS_PROXY"]
|
||||
GH_PROXY = SITE['GuardaHD']["GH_PROXY"]
|
||||
TF_PROXY = SITE['Tantifilm']["TF_PROXY"]
|
||||
CB_PROXY = SITE['CB01']["CB_PROXY"]
|
||||
SC_PROXY = SITE['StreamingCommunity']["SC_PROXY"]
|
||||
VX_PROXY = SITE['StreamingCommunity']["VX_PROXY"]
|
||||
AW_PROXY = SITE['AnimeWorld']["AW_PROXY"]
|
||||
MX_PROXY = SITE['CB01']["MX_PROXY"]
|
||||
OST_PROXY = SITE['Onlineserietv']["OST_PROXY"]
|
||||
ES_PROXY = SITE['Eurostreaming']['ES_PROXY']
|
||||
ips4_device_key = SITE['DDLStream']['cookies']["ips4_device_key"]
|
||||
ips4_IPSSessionFront = SITE['DDLStream']['cookies']["ips4_IPSSessionFront"]
|
||||
ips4_member_id = SITE['DDLStream']['cookies']["ips4_member_id"]
|
||||
ips4_login_key = SITE['DDLStream']['cookies']["ips4_login_key"]
|
||||
GF_PROXY = SITE['Guardaflix']['GF_PROXY']
|
||||
GO_PROXY = SITE['Guardoserie']['GO_PROXY']
|
||||
SW_PROXY = SITE['StreamingWatch']['SW_PROXY']
|
||||
#General
|
||||
GENERAL = config['General']
|
||||
dotenv = GENERAL["load_env"]
|
||||
@@ -68,6 +55,12 @@ HOST = GENERAL["HOST"]
|
||||
PORT = GENERAL["PORT"]
|
||||
Icon = GENERAL["Icon"]
|
||||
Name = GENERAL["Name"]
|
||||
Public_Instance = GENERAL["Public_Instance"]
|
||||
Remote_Instance = GENERAL["Remote_Instance"]
|
||||
LEVEL = GENERAL["level"]
|
||||
Global_Proxy = GENERAL["Global_Proxy"]
|
||||
|
||||
def setup_logging(LEVEL):
|
||||
LEVEL = LEVEL.upper()
|
||||
level = getattr(logging, LEVEL, logging.DEBUG)
|
||||
logging.basicConfig(level=level,format='%(message)s')
|
||||
logger = logging.getLogger(__name__)
|
||||
return logger
|
||||
@@ -13,10 +13,8 @@ async def get_TMDb_id_from_IMDb_id(imdb_id,client):
|
||||
else:
|
||||
return None
|
||||
async def get_IMDB_id_from_TMDb_id(tmdb_id,client):
|
||||
print(tmdb_id)
|
||||
url = f"https://api.themoviedb.org/3/movie/{tmdb_id}?api_key={TMDB_KEY}"
|
||||
response = await client.get(url)
|
||||
print(response.text)
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
imdb_id = data.get('imdb_id')
|
||||
|
||||
@@ -1,17 +1,4 @@
|
||||
import Src.Utilities.config as config
|
||||
SKY_DOMAIN = config.SKY_DOMAIN
|
||||
okru = {
|
||||
"rai-1": "https://ok.ru/videoembed/9340203179632?nochat=1",
|
||||
"rai-2": "https://ok.ru/videoembed/9267281010288?nochat=1",
|
||||
"canale-5": "https://ok.ru/videoembed/7871149252208?nochat=1",
|
||||
"italia-1": "https://ok.ru/videoembed/7393558339184?nochat=1",
|
||||
"rai-premium": "https://ok.ru/videoembed/7363152715376?nochat=1",
|
||||
"rai-movie": "https://ok.ru/videoembed/7384012693104?nochat=1",
|
||||
"tv8": "https://ok.ru/videoembed/8077072998000?nochat=1",
|
||||
"rsi-la-2": "https://ok.ru/videoembed/7681648107120?nochat=1",
|
||||
"mediaset-extra": "https://ok.ru/videoembed/7363151601264?nochat=1",
|
||||
"mediaset-infinity": "https://ok.ru/videoembed/6323249159792%3Fnochat=1"
|
||||
}
|
||||
|
||||
STREAM = {
|
||||
"channels": [
|
||||
@@ -29,7 +16,7 @@ STREAM = {
|
||||
"name": "Full HD Http",
|
||||
"genres": ["Rai"],
|
||||
"poster": "https://i.imgur.com/bb72vqh.jpeg",
|
||||
"url": "http://173.208.52.200/rai1/index.m3u8"
|
||||
"url": "https://viamotionhsi.netplus.ch/live/eds/rai1/browser-HLS8/rai1.m3u8"
|
||||
},
|
||||
{
|
||||
"id": "rai-2",
|
||||
@@ -37,7 +24,7 @@ STREAM = {
|
||||
"name": "Full HD Http",
|
||||
"genres": ["Rai"],
|
||||
"poster": "https://i.imgur.com/jX95Qod.jpeg",
|
||||
"url": "http://173.208.52.200/rai2/index.m3u8"
|
||||
"url": "https://viamotionhsi.netplus.ch/live/eds/rai2/browser-HLS8/rai2.m3u8"
|
||||
},
|
||||
{
|
||||
"id": "rai-3",
|
||||
@@ -45,7 +32,7 @@ STREAM = {
|
||||
"name": "Full HD Http",
|
||||
"genres": ["Rai"],
|
||||
"poster": "https://i.imgur.com/fgAh9if.jpeg",
|
||||
"url": "http://173.208.52.200/rai3/index.m3u8"
|
||||
"url": "https://viamotionhsi.netplus.ch/live/eds/rai3/browser-HLS8/rai3.m3u8"
|
||||
},
|
||||
{
|
||||
"id": "rai-4",
|
||||
@@ -53,7 +40,7 @@ STREAM = {
|
||||
"name": "Full HD Http",
|
||||
"genres": ["Rai"],
|
||||
"poster": "https://i.imgur.com/NryLzhA.jpeg",
|
||||
"url": "http://173.208.52.200/rai4/index.m3u8"
|
||||
"url": "https://raiquattro1-dash-live.akamaized.net/dash/live/663977/raiquattro1/manifest.mpd"
|
||||
},
|
||||
{
|
||||
"id": "rai-premium",
|
||||
@@ -61,7 +48,7 @@ STREAM = {
|
||||
"name": "Full HD",
|
||||
"genres": ["Rai"],
|
||||
"poster": "https://www.sorrisi.com/guidatv/bundles/tvscnewsite/css/images/loghi/rai-premium_c.png",
|
||||
"url": "https://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=746992"
|
||||
"url": "https://raipremium1-dash-live.akamaized.net/dash/live/663979/raipremium1/manifest.mpd"
|
||||
},
|
||||
{
|
||||
"id": "rai-4k",
|
||||
@@ -78,7 +65,7 @@ STREAM = {
|
||||
"name": "",
|
||||
"genres": ["Rai"],
|
||||
"poster": "https://is1-ssl.mzstatic.com/image/thumb/Purple221/v4/31/05/eb/3105eb24-a953-7bb9-876d-0fcfb0a19055/AppIcon-0-0-1x_U007epad-0-10-0-0-85-220.png/1200x630wa.png",
|
||||
"url": "https://streamcdnb4-8e7439fdb1694c8da3a0fd63e4dda518.msvdn.net/rainews1/hls/playlist_mo.m3u8"
|
||||
"url": "https://streamcdnb2-8e7439fdb1694c8da3a0fd63e4dda518.msvdn.net/rainews1/hls/playlist_mo.m3u8"
|
||||
},
|
||||
{
|
||||
"id": "rai-movie",
|
||||
@@ -86,7 +73,7 @@ STREAM = {
|
||||
"name": "",
|
||||
"genres": ["Rai"],
|
||||
"poster": "https://www.sorrisi.com/guidatv/bundles/tvscnewsite/css/images/loghi/rai-movie_c.png",
|
||||
"url": "https://m3u.iranvids.com/rai-movie/output.m3u8"
|
||||
"url": "https://raimovie1-dash-live.akamaized.net/dash/live/663983/raimovie1/manifest.mpd"
|
||||
},
|
||||
{
|
||||
"id": "rai-sport",
|
||||
@@ -94,7 +81,7 @@ STREAM = {
|
||||
"name": "",
|
||||
"genres": ["Rai"],
|
||||
"poster": "https://www.sorrisi.com/guidatv/bundles/tvscnewsite/css/images/loghi/rai-sport_c.png",
|
||||
"url": "https://m3u.iranvids.com/rai-sport01/output.m3u8"
|
||||
"url": "https://viamotionhsi.netplus.ch/live/eds/raisport1/browser-HLS8/raisport1.m3u8"
|
||||
},
|
||||
{
|
||||
"id": "rete-4",
|
||||
@@ -102,7 +89,7 @@ STREAM = {
|
||||
"name": "Full HD Http",
|
||||
"genres": ["Mediaset"],
|
||||
"poster": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Rete_4_2018.svg/1024px-Rete_4_2018.svg.png",
|
||||
"url": "http://173.208.52.200/rete4/index.m3u8"
|
||||
"url": "https://live02-seg.msf.cdn.mediaset.net/live/ch-r4/r4-clr.isml/index.m3u8"
|
||||
},
|
||||
{
|
||||
"id": "euronews",
|
||||
@@ -118,7 +105,7 @@ STREAM = {
|
||||
"name": "Full HD Http",
|
||||
"genres": ["Mediaset"],
|
||||
"poster": "https://www.sorrisi.com/guidatv/bundles/tvscnewsite/css/images/loghi/canale-5_c.png",
|
||||
"url": "http://173.208.52.200/canale5/index.m3u8"
|
||||
"url": "https://viamotionhsi.netplus.ch/live/eds/canale5/browser-HLS8/canale5.m3u8"
|
||||
},
|
||||
{
|
||||
"id": "italia-1",
|
||||
@@ -126,7 +113,7 @@ STREAM = {
|
||||
"name": "Full HD Http",
|
||||
"genres": ["Mediaset"],
|
||||
"poster": "https://upload.wikimedia.org/wikipedia/en/thumb/e/e2/Italia_1.svg/1024px-Italia_1.svg.png",
|
||||
"url": "http://173.208.52.200/italia1/index.m3u8"
|
||||
"url": "https://viamotionhsi.netplus.ch/live/eds/italia1/browser-HLS8/italia1.m3u8"
|
||||
},
|
||||
{
|
||||
"id": "topcrime",
|
||||
@@ -543,12 +530,12 @@ webru_dlhd = {
|
||||
|
||||
}
|
||||
extra_sources = {
|
||||
"rai-1": ["https://m3u.iranvids.com/rai01/output.m3u8"],
|
||||
"rai-2": ["https://m3u.iranvids.com/rai02/output.m3u8"],
|
||||
"rai-3": ["https://dash2.antik.sk/live/test_rai_tre_tizen/playlist.m3u8","https://wzstreaming.rai.it/TVlive/liveStream/playlist.m3u8","https://list.iptvcat.com/my_list/s/1f22856f68f2fba4a993c47f47c78a64.m3u8","https://list.iptvcat.com/my_list/s/a372048a4fb440e752aec141aa02885f.m3u8","https://list.iptvcat.com/my_list/s/c7efe17aa0dc8096561967bfb828d4f3.m3u8","https://list.iptvcat.com/my_list/s/2d1f14bbb3370d263d8d3f0d9f5128e0.m3u8"],
|
||||
"rete-4":["https://tvit.leicaflorianrobert.dev/mediaset/rete-4/stream.m3u8","https://live02-seg.msf.cdn.mediaset.net/live/ch-r4/r4-clr.isml/index.m3u8"],
|
||||
"canale-5":["https://live02-seg.msf.cdn.mediaset.net/live/ch-c5/c5-clr.isml/index.m3u8","https://tvit.leicaflorianrobert.dev/mediaset/canale-5/stream.m3u8"],
|
||||
"italia-1":["https://tvit.leicaflorianrobert.dev/mediaset/italia-1/stream.m3u8","https://live02-seg.msf.cdn.mediaset.net/live/ch-i1/i1-clr.isml/index.m3u8"],
|
||||
"rai-1": ["https://ilglobotv-live.akamaized.net/channels/RAI1/Live.m3u8"],
|
||||
"rai-2": ["https://ilglobotv-live.akamaized.net/channels/RAI2/Live.m3u8"],
|
||||
"rai-3": ["https://ilglobotv-live.akamaized.net/channels/RAI2/Live.m3u8","https://dash2.antik.sk/live/test_rai_tre_tizen/playlist.m3u8","https://wzstreaming.rai.it/TVlive/liveStream/playlist.m3u8","https://list.iptvcat.com/my_list/s/1f22856f68f2fba4a993c47f47c78a64.m3u8","https://list.iptvcat.com/my_list/s/a372048a4fb440e752aec141aa02885f.m3u8","https://list.iptvcat.com/my_list/s/c7efe17aa0dc8096561967bfb828d4f3.m3u8","https://list.iptvcat.com/my_list/s/2d1f14bbb3370d263d8d3f0d9f5128e0.m3u8"],
|
||||
"rete-4":["https://tvit.leicaflorianrobert.dev/mediaset/rete-4/stream.m3u8","https://timlivetu0.cb.ticdn.it/Content/DASH/Live/channel(rete4)/manifest.mpd"],
|
||||
"canale-5":["https://timlivetu0.cb.ticdn.it/Content/DASH/Live/channel(canale5)/manifest.mpd","https://tvit.leicaflorianrobert.dev/mediaset/canale-5/stream.m3u8",'https://timlivetu0.cb.ticdn.it/Content/DASH/Live/channel(canale5)/manifest.mpd','https://live02-seg.msf.cdn.mediaset.net/live/ch-c5/c5-clr.isml/index.m3u8'],
|
||||
"italia-1":["https://tvit.leicaflorianrobert.dev/mediaset/italia-1/stream.m3u8","https://live02-seg.msf.cdn.mediaset.net/live/ch-i1/i1-clr.isml/index.m3u8",'https://timlivetu0.cb.ticdn.it/Content/DASH/Live/channel(italia1)/manifest.mpd'],
|
||||
"rai-4k": ["https://list.iptvcat.com/my_list/s/fbf04fbd9694eee71b5af9f12e49538d.m3u8"],
|
||||
"rai-news":["https://8e7439fdb1694c8da3a0fd63e4dda518.msvdn.net/rainews1/hls/playlist_mo.m3u8"],
|
||||
"topcrime": ["https://tvit.leicaflorianrobert.dev/mediaset/top-crime/stream.m3u8"],
|
||||
@@ -564,33 +551,7 @@ extra_sources = {
|
||||
"doctor-who": ["https://amg00793-amg00793c17-samsung-it-4577.playouts.now.amagi.tv/playlist/amg00793-bbcstudios-drwhoitaly-samsungit/playlist.m3u8"],
|
||||
"supertennis": ["https://live-embed.supertennix.hiway.media/restreamer/supertennix_client/gpu-a-c0-16/restreamer/outgest/h24_supertennix/manifest.m3u8"]
|
||||
}
|
||||
skystreaming ={
|
||||
"sky-sport-tennis": f"{SKY_DOMAIN}/embed/MKCKP",
|
||||
"sky-sport-24": f"{SKY_DOMAIN}/embed/GB7zq",
|
||||
"sky-sport-251": f"{SKY_DOMAIN}/embed/drHbM",
|
||||
"sky-sport-252": f"{SKY_DOMAIN}/embed/m5kfg",
|
||||
"sky-sport-253": f"{SKY_DOMAIN}/embed/YprHf",
|
||||
"sky-sport-254": f"{SKY_DOMAIN}/embed/wroRV",
|
||||
"sky-sport-255": f"{SKY_DOMAIN}/embed/0TixN",
|
||||
"sky-sport-256": f"{SKY_DOMAIN}/embed/8g8bh",
|
||||
"sky-sport-257": f"{SKY_DOMAIN}/embed/ri859",
|
||||
"sky-sport-258": f"{SKY_DOMAIN}/embed/UoJuW",
|
||||
"sky-sport-259": f"{SKY_DOMAIN}/embed/squCy",
|
||||
"sky-sport-260": f"{SKY_DOMAIN}/embed/Z5h2e",
|
||||
"sky-sport-261": f"{SKY_DOMAIN}/embed/Hz9FW",
|
||||
"sky-sport-uno": f"{SKY_DOMAIN}/embed/tb1np",
|
||||
"sky-sport-f1": f"{SKY_DOMAIN}/embed/MLkym",
|
||||
"sky-sport-motogp": f"{SKY_DOMAIN}/embed/ARFFv",
|
||||
"sky-sport-calcio": f"{SKY_DOMAIN}/embed/STOZT",
|
||||
"sky-sport-arena": f"{SKY_DOMAIN}/embed/NkEda",
|
||||
"sky-sport-max": f"{SKY_DOMAIN}/embed/4QzWz",
|
||||
"sky-sport-nba": f"{SKY_DOMAIN}/embed/saR8j",
|
||||
"sky-sport-golf": f"{SKY_DOMAIN}/embed/s9L5f",
|
||||
"eurosport-1": f"{SKY_DOMAIN}/embed/Vyv99",
|
||||
"eurosport-2": f"{SKY_DOMAIN}/embed/um8E5",
|
||||
"dazn-zona-a": ["https://hls.kangal.sbs/hls/serie/index.m3u8","https://hls.kangal.sbs/hls/serie/index.m3u8"],
|
||||
"sportitalia": "https://hls.kangal.sbs/hls/sportitalia/index.m3u8",
|
||||
}
|
||||
|
||||
huhu = {
|
||||
"canale-5": "1101559666",
|
||||
"sky-sport-motogp": "2090703806",
|
||||
@@ -619,5 +580,7 @@ provider_map = {
|
||||
"GS": "GUARDASERIE",
|
||||
"GHD": "GUARDAHD",
|
||||
"OST": "ONLINESERIETV",
|
||||
"ES": "EUROSTREAMING"
|
||||
"ES": "EUROSTREAMING",
|
||||
"GO": "GUARDOSERIE",
|
||||
"GF": "GUARDAFLIX"
|
||||
}
|
||||
@@ -14,6 +14,11 @@ from fake_headers import Headers
|
||||
"""Unpacker for Dean Edward's p.a.c.k.e.r"""
|
||||
import re
|
||||
from bs4 import BeautifulSoup, SoupStrainer
|
||||
import logging
|
||||
import Src.Utilities.config as config
|
||||
from Src.Utilities.config import setup_logging
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
|
||||
def detect(source):
|
||||
if "eval(function(p,a,c,k,e,d)" in source:
|
||||
@@ -142,7 +147,7 @@ async def eval_solver(stream_link,proxies, ForwardProxy, client):
|
||||
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'
|
||||
response = await client.get( ForwardProxy + stream_link, allow_redirects=True, timeout=30, headers = headers, proxies = proxies, impersonate = "chrome124")
|
||||
print("Eval:",response.status_code)
|
||||
logger.debug("Eval:",response.status_code)
|
||||
soup = BeautifulSoup(response.text, "lxml",parse_only=SoupStrainer("script"))
|
||||
script_all = soup.find_all("script")
|
||||
for i in script_all:
|
||||
@@ -158,7 +163,7 @@ async def eval_solver(stream_link,proxies, ForwardProxy, client):
|
||||
m3u8_url = match.group(1)
|
||||
return m3u8_url
|
||||
except Exception as e:
|
||||
print("Eval solver error\n",e)
|
||||
logger.debug("Eval solver error\n",e)
|
||||
raise Exception("Error in eval_solver")
|
||||
|
||||
|
||||
@@ -167,7 +172,6 @@ async def test_animeworld():
|
||||
from curl_cffi.requests import AsyncSession
|
||||
async with AsyncSession() as client:
|
||||
results = await eval_solver("https://mixdrop.cv/e/l6kqxrm4t4l4or",{},"",client)
|
||||
print("https:"+results)
|
||||
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
|
||||
+24
-1
@@ -57,6 +57,10 @@ def get_info_tmdb(tmbda,ismovie,type):
|
||||
date = show.first_air_date
|
||||
date = date.split("-")[0]
|
||||
return showname,date
|
||||
elif type == "Guardoserie":
|
||||
date = show.first_air_date
|
||||
date = date.split("-")[0]
|
||||
return showname,date
|
||||
|
||||
elif ismovie == 1:
|
||||
movie = Movie()
|
||||
@@ -97,6 +101,14 @@ def get_info_tmdb(tmbda,ismovie,type):
|
||||
date = show.release_date
|
||||
date = date.split("-")[0]
|
||||
return showname,date
|
||||
elif type == "Guardoserie":
|
||||
date = show.release_date
|
||||
date = date.split("-")[0]
|
||||
return showname,date
|
||||
elif type == 'Guardaflix':
|
||||
date = show.release_date
|
||||
date = date.split("-")[0]
|
||||
return showname,date
|
||||
|
||||
async def get_info_imdb(imdb_id, ismovie, type,client):
|
||||
resp = await client.get(f'https://api.themoviedb.org/3/find/{imdb_id}?api_key={TMDB_KEY}&language=it&external_source=imdb_id')
|
||||
@@ -141,7 +153,10 @@ async def get_info_imdb(imdb_id, ismovie, type,client):
|
||||
date = data['tv_results'][0]['first_air_date']
|
||||
date = date.split("-")[0]
|
||||
return showname,date
|
||||
|
||||
elif type == "Guardoserie":
|
||||
date = data['tv_results'][0]['first_air_date']
|
||||
date = date.split("-")[0]
|
||||
return showname,date
|
||||
elif ismovie == 1:
|
||||
showname= data['movie_results'][0]['title']
|
||||
if type == "Filmpertutti":
|
||||
@@ -172,6 +187,14 @@ async def get_info_imdb(imdb_id, ismovie, type,client):
|
||||
date = data['movie_results'][0]['release_date']
|
||||
date = date.split("-")[0]
|
||||
return showname,date
|
||||
elif type == "Guardoserie":
|
||||
date = data['movie_results'][0]['release_date']
|
||||
date = date.split("-")[0]
|
||||
return showname,date
|
||||
elif type == 'Guardaflix':
|
||||
date = data['movie_results'][0]['release_date']
|
||||
date = date.split("-")[0]
|
||||
return showname,date
|
||||
|
||||
|
||||
async def get_info_kitsu(kitsu_id,client):
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import os
|
||||
import Src.Utilities.config as config
|
||||
MYSTERIUS = config.MYSTERIUS
|
||||
dotenv = config.dotenv
|
||||
Public_Instance = config.Public_Instance
|
||||
#You need to keep dotenv disabled on remote servers
|
||||
if dotenv == "1":
|
||||
from dotenv import load_dotenv
|
||||
@@ -12,10 +10,7 @@ if dotenv == "1":
|
||||
def load_env():
|
||||
env_vars = {}
|
||||
env_vars['TMDB_KEY'] = os.getenv('TMDB_KEY')
|
||||
if MYSTERIUS == "1":
|
||||
env_vars['MYSTERIUS_KEY'] = os.getenv('MYSTERIUS_KEY')
|
||||
env_vars['PROXY_CREDENTIALS'] = os.getenv('PROXY')
|
||||
if Public_Instance == "1":
|
||||
env_vars['ALTERNATIVE_LINK'] = os.getenv('ALTERNATIVE_LINK')
|
||||
env_vars['ForwardProxy'] = os.getenv('FORWARDPROXY')
|
||||
env_vars['PORT_ENV'] = os.getenv('PORT')
|
||||
return env_vars
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import logging
|
||||
import Src.Utilities.config as config
|
||||
from Src.Utilities.config import setup_logging
|
||||
import urllib.parse
|
||||
|
||||
level = config.LEVEL
|
||||
logger = setup_logging(level)
|
||||
|
||||
async def transform_mfp(mfp_stream_url,client):
|
||||
try:
|
||||
response = await client.get(mfp_stream_url)
|
||||
data = response.json()
|
||||
url = data['mediaflow_proxy_url'] + "?api_password=" + data['query_params']['api_password'] + "&d=" + urllib.parse.quote(data['destination_url'])
|
||||
for i in data['request_headers']:
|
||||
url += f"&h_{i}={urllib.parse.quote(data['request_headers'][i])}"
|
||||
return url
|
||||
except Exception as e:
|
||||
logger.warning(f"Converting MFP failed {e}")
|
||||
return None
|
||||
|
||||
async def build_mfp(MFP_CREDENTIALS,url,host,client):
|
||||
MFP_url = MFP_CREDENTIALS[0]
|
||||
MFP_password = MFP_CREDENTIALS[1]
|
||||
url_mfp = f'{MFP_url}/extractor/video?api_password={MFP_password}&d={url}&host={host}&redirect_stream=false'
|
||||
#To build pieces together
|
||||
url_mfp = await transform_mfp(url_mfp,client)
|
||||
return url_mfp
|
||||
Reference in New Issue
Block a user