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)
+3
View File
@@ -102,6 +102,7 @@ def get_episode_link(episode_id,tid):
def streaming_community(imdb): def streaming_community(imdb):
try:
general = is_movie(imdb) general = is_movie(imdb)
ismovie = general[0] ismovie = general[0]
imdb_id = general[1] imdb_id = general[1]
@@ -152,3 +153,5 @@ def streaming_community(imdb):
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")
+12 -10
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,12 +99,15 @@ def true_url(protect_link):
#Get temporaly ID #Get temporaly ID
def tuttifilm(imdb): def tantifilm(imdb):
try:
general = is_movie(imdb) general = is_movie(imdb)
ismovie = general[0] ismovie = general[0]
imdb_id = general[1] imdb_id = general[1]
type = "Tuttifilm" type = "Tuttifilm"
if ismovie == 0 : if ismovie == 0 :
print("Series not supported yet")
return
season = int(general[2]) season = int(general[2])
episode = int(general[3]) episode = int(general[3])
if "tt" in imdb: if "tt" in imdb:
@@ -132,23 +135,22 @@ def tuttifilm(imdb):
date = None date = None
else: else:
#else just equals them #else just equals themtantifilm("tt2096673")
tmdba = imdb_id.replace("tmdb:","")
season = None
episode = None
if TF_FAST_SEARCH == "0": if TF_FAST_SEARCH == "0":
showname,date = get_info_tmdb(tmdba,ismovie,type) showname,date = get_info_tmdb(imdb,ismovie,type)
date = None date = None
elif TF_FAST_SEARCH == "1": elif TF_FAST_SEARCH == "1":
showname = get_info_tmdb(tmdba,ismovie,type) showname = get_info_tmdb(imdb,ismovie,type)
date = None date = None
tid = search(showname,ismovie,season,episode,date) tid = search(showname,ismovie,season,episode,date)
protect_link = get_protect_link(tid) protect_link = get_protect_link(tid)
url = true_url(protect_link) url = true_url(protect_link)
return url
tuttifilm("tt16426418") except Exception as e:
print("Tantifilm Error")