MammaMia New Version 1.5, fixed sources and Live TV, added support for MFP, added support for quick deployment with vercel and render, added proxy support

This commit is contained in:
UrloMythus
2025-01-01 10:13:57 +01:00 Unverified
parent a3b49bd6f4
commit 0801b3ae93
29 changed files with 1135 additions and 540 deletions
+33 -3
View File
@@ -15,14 +15,44 @@ LC_DOMAIN = SITE["LordChannel"]['domain']
SW_DOMAIN = SITE["StreamingWatch"]['domain']
AW_DOMAIN = SITE['AnimeWorld']['domain']
SKY_DOMAIN = SITE['SkyStreaming']['domain']
CB_DOMAIN = SITE['CB01']['domain']
DDL_DOMAIN = SITE['DDLStream']['domain']
DLHD_DOMAIN = SITE['DaddyLiveHD']['domain']
GS_DOMAIN = SITE['Guardaserie']['domain']
GHD_DOMAIN = SITE['GuardaHD']['domain']
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']
DLHD = SITE['DaddyLiveHD']['enabled']
TF_ForwardProxy = SITE['Tantifilm']["TF_ForwardProxy"]
SC_ForwardProxy = SITE['StreamingCommunity']["SC_ForwardProxy"]
GS_ForwardProxy = SITE['Guardaserie']["GS_ForwardProxy"]
GH_ForwardProxy = SITE['GuardaHD']["GH_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"]
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"]
#General
GENERAL = config['General']
dotenv = GENERAL["load_env"]
HOST = GENERAL["HOST"]
PORT = GENERAL["PORT"]
HF = GENERAL["HF"]
Icon = GENERAL["Icon"]
Name = GENERAL["Name"]
Public_Instance = GENERAL["Public_Instance"]
MediaProxy = GENERAL["MediaProxy"]
ForwardProxy = GENERAL["ForwardProxy"]
Remote_Instance = GENERAL["Remote_Instance"]
Global_Proxy = GENERAL["Global_Proxy"]
+12 -1
View File
@@ -11,4 +11,15 @@ async def get_TMDb_id_from_IMDb_id(imdb_id,client):
elif tmbda['tv_results']:
return tmbda['tv_results'][0]['id']
else:
return None
return None
async def get_IMDB_id_from_TMDb_id(tmdb_id,client):
url = f"https://api.themoviedb.org/3/movie/{tmdb_id}?api_key={TMDB_KEY}"
response = await client.get(url)
if response.status_code == 200:
data = response.json()
imdb_id = data.get('imdb_id')
if imdb_id:
return imdb_id
+36 -30
View File
@@ -1,3 +1,5 @@
import Src.Utilities.config as config
SKY_DOMAIN = config.SKY_DOMAIN
okru = {
"rai-1": "https://ok.ru/videoembed/7868570672752?nochat=1",
"rai-2": "https://ok.ru/videoembed/7805618364016?nochat=1",
@@ -26,7 +28,7 @@ STREAM = {
"title": "Rai 1",
"name": "Full HD Http",
"genres": ["Rai"],
"poster": "https://i.imgur.com/OPV9jJD.png",
"poster": "https://i.imgur.com/bb72vqh.jpeg",
"url": "http://173.208.52.200/rai1/index.m3u8"
},
{
@@ -34,7 +36,7 @@ STREAM = {
"title": "Rai 2",
"name": "Full HD Http",
"genres": ["Rai"],
"poster": "https://i.imgur.com/uHtYy8w.png",
"poster": "https://i.imgur.com/jX95Qod.jpeg",
"url": "http://173.208.52.200/rai2/index.m3u8"
},
{
@@ -42,7 +44,7 @@ STREAM = {
"title": "Rai 3",
"name": "Full HD Http",
"genres": ["Rai"],
"poster": "https://i.imgur.com/iXst6me.png",
"poster": "https://i.imgur.com/fgAh9if.jpeg",
"url": "http://173.208.52.200/rai3/index.m3u8"
},
{
@@ -50,7 +52,7 @@ STREAM = {
"title": "Rai 4",
"name": "Full HD Http",
"genres": ["Rai"],
"poster": "https://i.imgur.com/KGg3hvr.png",
"poster": "https://i.imgur.com/NryLzhA.jpeg",
"url": "http://173.208.52.200/rai4/index.m3u8"
},
{
@@ -844,31 +846,31 @@ extra_sources = {
"doctor-who": ["https://amg00793-amg00793c17-samsung-it-4577.playouts.now.amagi.tv/playlist/amg00793-bbcstudios-drwhoitaly-samsungit/playlist.m3u8"]
}
skystreaming ={
"sky-sport-tennis": "https://skystreaming.guru/embed/MKCKP",
"sky-sport-24": "https://skystreaming.guru/embed/GB7zq",
"sky-sport-251": "https://skystreaming.guru/embed/drHbM",
"sky-sport-252": "https://skystreaming.guru/embed/m5kfg",
"sky-sport-253": "https://skystreaming.guru/embed/YprHf",
"sky-sport-254": "https://skystreaming.guru/embed/wroRV",
"sky-sport-255": "https://skystreaming.guru/embed/0TixN",
"sky-sport-256": "https://skystreaming.guru/embed/8g8bh",
"sky-sport-257": "https://skystreaming.guru/embed/ri859",
"sky-sport-258": "https://skystreaming.guru/embed/UoJuW",
"sky-sport-259": "https://skystreaming.guru/embed/squCy",
"sky-sport-260": "https://skystreaming.guru/embed/Z5h2e",
"sky-sport-261": "https://skystreaming.guru/embed/Hz9FW",
"sky-sport-uno": "https://skystreaming.guru/embed/tb1np",
"sky-sport-f1": "https://skystreaming.guru/embed/MLkym",
"sky-sport-motogp": "https://skystreaming.guru/embed/ARFFv",
"sky-sport-calcio": "https://skystreaming.guru/embed/STOZT",
"sky-sport-arena": "https://skystreaming.guru/embed/NkEda",
"sky-sport-max": "https://skystreaming.guru/embed/4QzWz",
"sky-sport-nba": "https://skystreaming.guru/embed/saR8j",
"sky-sport-golf": "https://skystreaming.guru/embed/s9L5f",
"eurosport-1": "https://skystreaming.guru/embed/Vyv99",
"eurosport-2": "https://skystreaming.guru/embed/um8E5",
"dazn-zona-a": ["https://hls.psz.pm/hls/serie/index.m3u8","https://hls.cls.autos/hls/serie/index.m3u8"],
"sportitalia": "https://hls.cls.autos/hls/sportitalia/index.m3u8",
"sky-sport-tennis": f"https://skystreaming.{SKY_DOMAIN}/embed/MKCKP",
"sky-sport-24": f"https://skystreaming.{SKY_DOMAIN}/embed/GB7zq",
"sky-sport-251": f"https://skystreaming.{SKY_DOMAIN}/embed/drHbM",
"sky-sport-252": f"https://skystreaming.{SKY_DOMAIN}/embed/m5kfg",
"sky-sport-253": f"https://skystreaming.{SKY_DOMAIN}/embed/YprHf",
"sky-sport-254": f"https://skystreaming.{SKY_DOMAIN}/embed/wroRV",
"sky-sport-255": f"https://skystreaming.{SKY_DOMAIN}/embed/0TixN",
"sky-sport-256": f"https://skystreaming.{SKY_DOMAIN}/embed/8g8bh",
"sky-sport-257": f"https://skystreaming.{SKY_DOMAIN}/embed/ri859",
"sky-sport-258": f"https://skystreaming.{SKY_DOMAIN}/embed/UoJuW",
"sky-sport-259": f"https://skystreaming.{SKY_DOMAIN}/embed/squCy",
"sky-sport-260": f"https://skystreaming.{SKY_DOMAIN}/embed/Z5h2e",
"sky-sport-261": f"https://skystreaming.{SKY_DOMAIN}/embed/Hz9FW",
"sky-sport-uno": f"https://skystreaming.{SKY_DOMAIN}/embed/tb1np",
"sky-sport-f1": f"https://skystreaming.{SKY_DOMAIN}/embed/MLkym",
"sky-sport-motogp": f"https://skystreaming.{SKY_DOMAIN}/embed/ARFFv",
"sky-sport-calcio": f"https://skystreaming.{SKY_DOMAIN}/embed/STOZT",
"sky-sport-arena": f"https://skystreaming.{SKY_DOMAIN}/embed/NkEda",
"sky-sport-max": f"https://skystreaming.{SKY_DOMAIN}/embed/4QzWz",
"sky-sport-nba": f"https://skystreaming.{SKY_DOMAIN}/embed/saR8j",
"sky-sport-golf": f"https://skystreaming.{SKY_DOMAIN}/embed/s9L5f",
"eurosport-1": f"https://skystreaming.{SKY_DOMAIN}/embed/Vyv99",
"eurosport-2": f"https://skystreaming.{SKY_DOMAIN}/embed/um8E5",
"dazn-zona-a": ["https://live.servis.hair/hls/serie/index.m3u8","https://live.servis.hair/hls/serie/index.m3u8"],
"sportitalia": "https://live.servis.hair/hls/sportitalia/index.m3u8",
}
huhu = {
"canale-5": "1101559666",
@@ -892,5 +894,9 @@ provider_map = {
'TF_FS': 'TF_FAST_SEARCH',
'TF': 'TANTIFILM', # Assuming 'TF' should also be handled
'FT': 'FILMPERTUTTI',
'AW': 'ANIMEWORLD'
'AW': 'ANIMEWORLD',
'DDL': 'DDLSTREAM',
'CB': 'CB01',
"GS": "GUARDASERIE",
"GHD": "GUARDAHD",
}
+5 -23
View File
@@ -16,21 +16,16 @@ def get_info_tmdb(tmbda,ismovie,type):
show= tv.details(tmbda)
showname = show.name
if type == "Filmpertutti":
date= show.first_air_date
date = date.split("-")[0]
print("Real date",date)
return showname,date
return showname
elif type == "StreamingCommunity":
full_date = show.first_air_date
date = full_date.split("-")[0]
print(date)
return showname,date
elif type == "StreamingCommunityFS":
return showname
elif type == "Tantifilm":
date = show.first_air_date
date = date.split("-")[0]
print("Real date",date)
return showname,date
elif type == "TantifilmFS":
return showname
@@ -39,12 +34,10 @@ def get_info_tmdb(tmbda,ismovie,type):
elif type == "LordChannel":
date = show.first_air_date
date = date.split("-")[0]
print("Real date",date)
return showname,date
elif type == "StreamingWatch":
date = show.first_air_date
date = date.split("-")[0]
print("Real date",date)
return showname,date
elif type == "DDLStream":
return showname
@@ -63,10 +56,7 @@ def get_info_tmdb(tmbda,ismovie,type):
showname= show.title
#Get all release dates
if type == "Filmpertutti":
date = show.release_dates
date = date.split("-")[0]
#GET US RELEASE DATE because filmpertutti somewhy uses US release date
return showname,date
return showname
elif type == "StreamingCommunity":
date = show.release_date
date = date.split("-")[0]
@@ -76,7 +66,6 @@ def get_info_tmdb(tmbda,ismovie,type):
elif type == "Tantifilm":
date = show.release_date
date = date.split("-")[0]
print("Real date",date)
return showname,date
elif type == "TantifilmFS":
return showname
@@ -85,12 +74,10 @@ def get_info_tmdb(tmbda,ismovie,type):
elif type == "LordChannel":
date = show.release_date
date = date.split("-")[0]
print("Real date",date)
return showname,date
elif type == "StreamingWatch":
date = show.release_date
date = date.split("-")[0]
print("Real date",date)
return showname,date
elif type == "DDLStream":
return showname
@@ -109,10 +96,7 @@ async def get_info_imdb(imdb_id, ismovie, type,client):
if ismovie == 0:
showname = data['tv_results'][0]['name']
if type == "Filmpertutti":
date= data['tv_results'][0]['first_air_date']
date = date.split("-")[0]
print("Real date",date)
return showname, date
return showname
elif type == "StreamingCommunity":
date = data['tv_results'][0]['first_air_date']
date = date.split("-")[0]
@@ -141,9 +125,7 @@ async def get_info_imdb(imdb_id, ismovie, type,client):
elif ismovie == 1:
showname= data['movie_results'][0]['title']
if type == "Filmpertutti":
date = data['movie_results'][0]['release_date']
date = date.split("-")[0]
return showname,date
return showname
elif type == "StreamingCommunity":
date = data['movie_results'][0]['release_date']
date = date.split("-")[0]
@@ -179,7 +161,7 @@ async def get_info_kitsu(kitsu_id,client):
def is_movie(imdb_id):
async def is_movie(imdb_id):
if "tmdb:" in imdb_id:
imdb_id = imdb_id.replace("tmdb:","")
if ":" in imdb_id:
+1 -2
View File
@@ -2,7 +2,6 @@ import os
import Src.Utilities.config as config
MYSTERIUS = config.MYSTERIUS
dotenv = config.dotenv
HF = config.HF
Public_Instance = config.Public_Instance
#You need to keep dotenv disabled on remote servers
if dotenv == "1":
@@ -16,7 +15,7 @@ def load_env():
if MYSTERIUS == "1":
env_vars['MYSTERIUS_KEY'] = os.getenv('MYSTERIUS_KEY')
env_vars['PROXY_CREDENTIALS'] = os.getenv('PROXY')
env_vars['MEDIAFLOW_PASS'] = os.getenv('MEDIAFLOW_PASS')
if Public_Instance == "1":
env_vars['ALTERNATIVE_LINK'] = os.getenv('ALTERNATIVE_LINK')
env_vars['ForwardProxy'] = os.getenv('FORWARDPROXY')
return env_vars
+40
View File
@@ -0,0 +1,40 @@
from urllib.parse import urlparse, parse_qs,unquote,quote
from fastapi import APIRouter, HTTPException, Response
from curl_cffi.requests import AsyncSession
router = APIRouter()
User_Agent= "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 OPR/111.0.0.0"
async def fetch_m3u8(url):
"""Fetch the M3U8 file from the URL and store it in memory."""
async with AsyncSession() as client:
response = await client.get(url,headers = {"User-Agent": User_Agent, "user-agent": User_Agent})
response.raise_for_status() # Raise an error for bad responses
return response.text
@router.get("/clone/manifest.m3u8")
async def clone_m3u8(d: str = None):
if d:
try:
d = unquote(d)
m3u8_content = await fetch_m3u8(d)
return Response(content=m3u8_content, media_type='application/vnd.apple.mpegurl')
except Exception as e:
print(f"Failed to fetch M3U8 file: {e}")
raise HTTPException(status_code=404, detail="M3U8 content not found")
#This is just for testing, ignore that endpoint and the func
@router.api_route("/vixcloud/manifest.m3u8", methods=["GET", "HEAD"])
async def clone2_m3u8(d:str,token:str,expires:str,h:str = None, b:str = None):
try:
m3u8 = f'{d}?token={token}&expires={expires}'
if h:
m3u8 = m3u8 + f'&h={h}'
if b:
m3u8 = m3u8 + f'&b={b}'
m3u8_content = await fetch_m3u8(m3u8)
return Response(content=m3u8_content, media_type='application/vnd.apple.mpegurl')
except Exception as e:
print(f"Failed to fetch M3U8 file: {e}")
raise HTTPException(status_code=404, detail="M3U8 content not found")