added tuttifilm

This commit is contained in:
UrloMythus
2024-07-14 12:01:31 +02:00 Unverified
parent d316d6c38e
commit 79442b658b
10 changed files with 267 additions and 108 deletions
+1 -1
View File
@@ -243,7 +243,7 @@ In the repo there is a config.json that you can modify to change some aspects of
|HOST| The host for the Flask APP| |HOST| The host for the Flask APP|
|PORT| The port for the Flask APP. Default: 8080 | |PORT| The port for the Flask APP. Default: 8080 |
For now Mysterius must be kept disabled if you do not know what you are doing.
Check those links to get the new Domain for the providers. Check those links to get the new Domain for the providers.
+4 -1
View File
@@ -1,7 +1,7 @@
{ {
"Siti": { "Siti": {
"StreamingCommunity": { "StreamingCommunity": {
"enabled": "0", "enabled": "1",
"domain": "boston", "domain": "boston",
"fast_search": "1" "fast_search": "1"
}, },
@@ -13,6 +13,9 @@
"enabled": "1", "enabled": "1",
"domain": "bond", "domain": "bond",
"fast_search": "0" "fast_search": "0"
},
"Mysterius":{
"enabled": "0"
} }
}, },
"General":{ "General":{
+2
View File
@@ -13,6 +13,8 @@ SC_DOMAIN = SITE["StreamingCommunity"]['domain']
TF_DOMAIN = SITE["Tuttifilm"]['enabled'] TF_DOMAIN = SITE["Tuttifilm"]['enabled']
FILMPERTUTTI = SITE["Filmpertutti"]['enabled'] FILMPERTUTTI = SITE["Filmpertutti"]['enabled']
STREAMINGCOMMUNITY = SITE["StreamingCommunity"]['enabled'] STREAMINGCOMMUNITY = SITE["StreamingCommunity"]['enabled']
MYSTERIUS = SITE["Mysterius"]['enabled']
TUTTIFILM = SITE["Tuttifilm"]['enabled']
SC_FAST_SEARCH = SITE["StreamingCommunity"]['fast_search'] SC_FAST_SEARCH = SITE["StreamingCommunity"]['fast_search']
TF_FAST_SEARCH = SITE["Tuttifilm"]['fast_search'] TF_FAST_SEARCH = SITE["Tuttifilm"]['fast_search']
#General #General
+1 -1
View File
@@ -1,7 +1,7 @@
import requests import requests
from tmdbv3api import TMDb, Movie, TV from tmdbv3api import TMDb, Movie, TV
from loadenv import load_env from loadenv import load_env
TMDB_KEY= load_env() TMDB_KEY,_= load_env()
def get_TMDb_id_from_IMDb_id(imdb_id): def get_TMDb_id_from_IMDb_id(imdb_id):
response = requests.get(f'https://api.themoviedb.org/3/find/{imdb_id}', response = requests.get(f'https://api.themoviedb.org/3/find/{imdb_id}',
params={'external_source': 'imdb_id', 'api_key': f'{TMDB_KEY}'}) params={'external_source': 'imdb_id', 'api_key': f'{TMDB_KEY}'})
+136 -8
View File
@@ -1,11 +1,139 @@
from tmdbv3api import TMDb, Movie, TV
import requests import requests
import logging
from bs4 import BeautifulSoup,SoupStrainer
from datetime import datetime
import dateparser
from convert import get_TMDb_id_from_IMDb_id
from info import get_info_tmdb, is_movie, get_info_imdb
import config
import json import json
from info import get_info_tmdb,is_movie
from convert import get_TMDb_id_from_IMDb_id
from loadenv import load_env
_,MYSTERIUS_KEY = load_env()
def get_links(slug,season,episode,ismovie):
try:
headers = {
"x-api-key": MYSTERIUS_KEY
}
response = requests.get("https://mythus-ulala1243.hf.space/api/cookie", headers=headers)
print(response.text)
Auths = response.json()
Bearer = Auths.get('cookie')
ap_session = Auths.get('auth')
cookies = {'ap_session': ap_session}
headers = {
'accept': 'application/json, text/plain, */*',
'accept-language': 'it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7',
'authorization': f'Bearer {Bearer}',
'referer': f'https://altadefinizione-originale.com/play/{slug}',
'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',
'x-requested-with': 'XMLHttpRequest',
}
if ismovie == 1:
response = requests.get(f'https://altadefinizione-originale.com/api/post/urls/stream/{slug}',cookies=cookies,headers=headers)
elif ismovie == 0:
response = requests.get(f'https://altadefinizione-originale.com/api/post/urls/stream/{slug}/{{season}}/{{episode}}',cookies=cookies,headers=headers)
try:
video_data = response.json() # Assuming this is the JSON response containing video streams
if 'streams' not in video_data:
print("Invalid JSON format: 'streams' key not found or incorrect structure")
return None
streams = video_data['streams']
resolutions = {}
for stream in streams:
resolution_name = stream['resolution']['name'].lower() # Convert resolution name to lowercase
url = stream['url']
# Remove everything after '.mp4' in the URL
mp4_index = url.find('.mp4')
if mp4_index != -1:
url = url[:mp4_index + 4] # +4 to include '.mp4' in the substring
resolutions[resolution_name] = url
return resolutions
except KeyError as e:
print(f"KeyError: {e}")
return None
except json.JSONDecodeError as e:
print(f"JSONDecodeError: {e}")
return None
except requests.RequestException as e:
print(f"Request error: {e}")
return None
# Example usage: Fetch video links
# Print the dictionary
def search_imdb(showname,tmdba):
tmdba = str(tmdba)
query = f'https://altadefinizione-originale.com/api/search?search={showname}&page=1'
response = requests.get(query)
if response.status_code == 200:
data = response.json()
if 'data' in data:
for item in data['data']:
if item.get('tmdb_id') == tmdba:
slug = item.get('slug')
print(slug)
return slug
def parse_links(resolution_links):
results = {}
if resolution_links:
print("Video links:")
for resolution, link in resolution_links.items():
print(f"{resolution}: {link}")
results[resolution] = link
return results
else:
print("Failed to fetch video links")
def cool(imdb):
try:
type = "Cool"
general = is_movie(imdb)
ismovie = general[0]
imdb_id = general[1]
if ismovie == 0 :
season = int(general[2])
episode = int(general[3])
if "tt" in imdb:
#Get showname
tmdba = get_TMDb_id_from_IMDb_id(imdb_id)
else:
tmdba = imdb_id.replace("tmdb:","")
showname = get_info_tmdb(tmdba,ismovie,type)
slug = search_imdb(showname,tmdba)
if ismovie == 1:
season = None
episode = None
resolution_links = get_links(slug,episode,season,ismovie)
results = parse_links(resolution_links)
return results
elif ismovie == 0:
season = season -1
episode = episode - 1
resolution_links = get_links(slug,episode,season,ismovie)
results = parse_links(resolution_links)
return results
except Exception as e:
print("Cool Error")
return None
+9 -2
View File
@@ -5,7 +5,7 @@ import requests
import config import config
SC_FAST_SEARCH = config.SC_FAST_SEARCH SC_FAST_SEARCH = config.SC_FAST_SEARCH
TF_FAST_SEARCH = config.TF_FAST_SEARCH TF_FAST_SEARCH = config.TF_FAST_SEARCH
TMDB_KEY= load_env() TMDB_KEY,_= load_env()
def get_info_tmdb(tmbda,ismovie,type): def get_info_tmdb(tmbda,ismovie,type):
tmdb = TMDb() tmdb = TMDb()
@@ -33,6 +33,8 @@ def get_info_tmdb(tmbda,ismovie,type):
return showname,date return showname,date
else: else:
return showname return showname
elif type == "Cool":
return showname
elif ismovie == 1: elif ismovie == 1:
movie = Movie() movie = Movie()
@@ -54,7 +56,8 @@ def get_info_tmdb(tmbda,ismovie,type):
return showname,date return showname,date
else: else:
return showname return showname
elif type == "Cool":
return showname
def get_info_imdb(imdb_id, ismovie, type): def get_info_imdb(imdb_id, ismovie, type):
@@ -73,6 +76,8 @@ def get_info_imdb(imdb_id, ismovie, type):
date = data['tv_results'][0]['first_air_date'] date = data['tv_results'][0]['first_air_date']
date = date.split("-")[0] date = date.split("-")[0]
return showname,date return showname,date
elif type == "Cool":
return showname
elif ismovie == 1: elif ismovie == 1:
showname= data['movie_results'][0]['title'] showname= data['movie_results'][0]['title']
@@ -85,6 +90,8 @@ def get_info_imdb(imdb_id, ismovie, type):
date = date.split("-")[0] date = date.split("-")[0]
print("Real date",date) print("Real date",date)
return showname,date return showname,date
elif type == "Cool":
return showname
+5 -1
View File
@@ -1,6 +1,7 @@
import os import os
import config import config
import config
MYSTERIUS = config.MYSTERIUS
dotenv = config.dotenv dotenv = config.dotenv
#You need to keep dotenv disabled on remote servers #You need to keep dotenv disabled on remote servers
if dotenv == "1": if dotenv == "1":
@@ -10,4 +11,7 @@ if dotenv == "1":
def load_env(): def load_env():
TMDB_KEY = os.getenv('TMDB_KEY') TMDB_KEY = os.getenv('TMDB_KEY')
if MYSTERIUS == "1":
MYSTERIUS_KEY = os.getenv('MYSTERIUS_KEY')
return TMDB_KEY, MYSTERIUS_KEY
return TMDB_KEY return TMDB_KEY
+13 -3
View File
@@ -1,14 +1,17 @@
from flask import Flask, jsonify, abort from flask import Flask, jsonify, abort
from filmpertutti import filmpertutti from filmpertutti import filmpertutti
from streamingcommunity import streaming_community from streamingcommunity import streaming_community
from tantifilm import tantifilm
import json import json
import config import config
FILMPERTUTTI = config.FILMPERTUTTI FILMPERTUTTI = config.FILMPERTUTTI
STREAMINGCOMMUNITY = config.STREAMINGCOMMUNITY STREAMINGCOMMUNITY = config.STREAMINGCOMMUNITY
MYSTERIUS = config.MYSTERIUS
TUTTIFILM = config.TUTTIFILM
HOST = config.HOST HOST = config.HOST
PORT = int(config.PORT) PORT = int(config.PORT)
if MYSTERIUS == "1":
from cool import cool
app = Flask(__name__) app = Flask(__name__)
@@ -45,6 +48,11 @@ def addon_stream(type, id):
if type not in MANIFEST['types']: if type not in MANIFEST['types']:
abort(404) abort(404)
streams = {'streams': []} streams = {'streams': []}
if MYSTERIUS == "1":
results = cool(id)
if results:
for resolution, link in results.items():
streams['streams'].append({'title': f'Mysterious {resolution}', 'url': link})
if STREAMINGCOMMUNITY == "1": if STREAMINGCOMMUNITY == "1":
url_streaming_community = streaming_community(id) url_streaming_community = streaming_community(id)
print(url_streaming_community) print(url_streaming_community)
@@ -57,7 +65,9 @@ def addon_stream(type, id):
url_filmpertutti = filmpertutti(id) url_filmpertutti = filmpertutti(id)
if url_filmpertutti is not None: if url_filmpertutti is not None:
streams['streams'].append({'title': 'Filmpertutti', 'url': url_filmpertutti}) streams['streams'].append({'title': 'Filmpertutti', 'url': url_filmpertutti})
if TUTTIFILM == "1":
url_tuttifilm = tantifilm(id)
streams['streams'].append({'title': 'Tantifilm', 'url': url_tuttifilm,'behaviorHints': {'proxyHeaders': {"request": {"Referer": "https://d000d.com/"}},'notWebReady': True}})
# If no streams were added, abort with a 404 error # If no streams were added, abort with a 404 error
if not streams['streams']: if not streams['streams']:
abort(404) abort(404)
+50 -47
View File
@@ -102,53 +102,56 @@ def get_episode_link(episode_id,tid):
def streaming_community(imdb): def streaming_community(imdb):
general = is_movie(imdb) try:
ismovie = general[0] general = is_movie(imdb)
imdb_id = general[1] ismovie = general[0]
type = "StreamingCommunity" imdb_id = general[1]
if ismovie == 0 : type = "StreamingCommunity"
season = int(general[2]) if ismovie == 0 :
episode = int(general[3]) season = int(general[2])
#Check if fast search is enabled or disabled episode = int(general[3])
if SC_FAST_SEARCH == "1": #Check if fast search is enabled or disabled
if "tt" in imdb: if SC_FAST_SEARCH == "1":
#Get showname if "tt" in imdb:
showname = get_info_imdb(imdb_id,ismovie,type) #Get showname
n_season = None showname = get_info_imdb(imdb_id,ismovie,type)
else: n_season = None
#I just set n season to None to avoid bugs, but it is not needed if Fast search is enabled else:
n_season = None #I just set n season to None to avoid bugs, but it is not needed if Fast search is enabled
#else just equals them n_season = None
tmdba = imdb_id.replace("tmdb:","") #else just equals them
showname = get_info_tmdb(tmdba,ismovie,type) tmdba = imdb_id.replace("tmdb:","")
elif SC_FAST_SEARCH == "0": showname = get_info_tmdb(tmdba,ismovie,type)
tmdba = get_TMDb_id_from_IMDb_id(imdb_id) elif SC_FAST_SEARCH == "0":
showname,n_season = get_info_tmdb(tmdba,ismovie,type) tmdba = get_TMDb_id_from_IMDb_id(imdb_id)
#HERE THE CASE IF IT IS A MOVIE showname,n_season = get_info_tmdb(tmdba,ismovie,type)
else: #HERE THE CASE IF IT IS A MOVIE
if "tt" in imdb:
#Get showname
n_season = None
showname = get_info_imdb(imdb_id,ismovie,type)
else: else:
#I just set n season to None to avoid bugs, but it is not needed if Fast search is enabled if "tt" in imdb:
#else just equals them #Get showname
n_season = None n_season = None
tmdba = imdb_id.replace("tmdb:","") showname = get_info_imdb(imdb_id,ismovie,type)
showname = get_info_tmdb(tmdba,ismovie,type) else:
#I just set n season to None to avoid bugs, but it is not needed if Fast search is enabled
#else just equals them
n_season = None
tmdba = imdb_id.replace("tmdb:","")
showname = get_info_tmdb(tmdba,ismovie,type)
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+") showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
query = f'https://streamingcommunity.{SC_DOMAIN}/api/search?q={showname}' query = f'https://streamingcommunity.{SC_DOMAIN}/api/search?q={showname}'
tid,slug = search(query,n_season,ismovie) tid,slug = search(query,n_season,ismovie)
if ismovie == 1: if ismovie == 1:
#TID means temporaly ID #TID means temporaly ID
url = get_film(tid) url = get_film(tid)
print(url) print(url)
return url return url
if ismovie == 0: if ismovie == 0:
#Uid = URL ID #Uid = URL ID
version = get_version() version = get_version()
episode_id = get_season_episode_id(tid,slug,season,episode,version) episode_id = get_season_episode_id(tid,slug,season,episode,version)
url = get_episode_link(episode_id,tid) url = get_episode_link(episode_id,tid)
print(url) print(url)
return url return url
except Exception as e:
print("Nope It failed")
+43 -41
View File
@@ -87,7 +87,7 @@ def true_url(protect_link):
rebobo = requests.get(url, headers=headers) rebobo = requests.get(url, headers=headers)
real_url = f'{rebobo.text}123456789{match[2]}{real_time}' real_url = f'{rebobo.text}123456789{match[2]}{real_time}'
print(real_url) print(real_url)
return return real_url
else: else:
print("No match found in the text.") print("No match found in the text.")
return None return None
@@ -99,56 +99,58 @@ def true_url(protect_link):
#Get temporaly ID #Get temporaly ID
def tuttifilm(imdb): def tantifilm(imdb):
general = is_movie(imdb) try:
ismovie = general[0] general = is_movie(imdb)
imdb_id = general[1] ismovie = general[0]
type = "Tuttifilm" imdb_id = general[1]
if ismovie == 0 : type = "Tuttifilm"
season = int(general[2]) if ismovie == 0 :
episode = int(general[3]) print("Series not supported yet")
if "tt" in imdb: return
if TF_FAST_SEARCH == "0": season = int(general[2])
showname,date = get_info_imdb(imdb_id,ismovie,type) episode = int(general[3])
elif TF_FAST_SEARCH == "1": if "tt" in imdb:
showname = get_info_imdb(imdb_id,ismovie,type)
date = None
else:
#else just equals them
tmdba = imdb_id.replace("tmdb:","")
if TF_FAST_SEARCH == "0":
showname = get_info_tmdb(tmdba,ismovie,type)
date = None
elif ismovie == 1:
season = None
episode = None
if "tt" in imdb:
#Get showname
if TF_FAST_SEARCH == "0": if TF_FAST_SEARCH == "0":
showname,date = get_info_imdb(imdb_id,ismovie,type) showname,date = get_info_imdb(imdb_id,ismovie,type)
elif TF_FAST_SEARCH == "1": elif TF_FAST_SEARCH == "1":
showname = get_info_imdb(imdb_id,ismovie,type) showname = get_info_imdb(imdb_id,ismovie,type)
date = None date = None
else: else:
#else just equals them
#else just equals them tmdba = imdb_id.replace("tmdb:","")
tmdba = imdb_id.replace("tmdb:","") if TF_FAST_SEARCH == "0":
showname = get_info_tmdb(tmdba,ismovie,type)
date = None
elif ismovie == 1:
season = None season = None
episode = None episode = None
if TF_FAST_SEARCH == "0": if "tt" in imdb:
showname,date = get_info_tmdb(tmdba,ismovie,type) #Get showname
date = None if TF_FAST_SEARCH == "0":
elif TF_FAST_SEARCH == "1": showname,date = get_info_imdb(imdb_id,ismovie,type)
showname = get_info_tmdb(tmdba,ismovie,type)
date = None
tid = search(showname,ismovie,season,episode,date) elif TF_FAST_SEARCH == "1":
protect_link = get_protect_link(tid) showname = get_info_imdb(imdb_id,ismovie,type)
url = true_url(protect_link) date = None
else:
tuttifilm("tt16426418") #else just equals themtantifilm("tt2096673")
if TF_FAST_SEARCH == "0":
showname,date = get_info_tmdb(imdb,ismovie,type)
date = None
elif TF_FAST_SEARCH == "1":
showname = get_info_tmdb(imdb,ismovie,type)
date = None
tid = search(showname,ismovie,season,episode,date)
protect_link = get_protect_link(tid)
url = true_url(protect_link)
return url
except Exception as e:
print("Tantifilm Error")