Added Tantifilm

This commit is contained in:
UrloMythus
2024-07-17 12:29:53 +02:00 Unverified
parent 6d97d11958
commit 0ca8f3bca6
5 changed files with 166 additions and 119 deletions
+2 -1
View File
@@ -21,7 +21,8 @@
"General":{ "General":{
"load_env": "1", "load_env": "1",
"HOST": "0.0.0.0", "HOST": "0.0.0.0",
"PORT": "8080" "PORT": "8080",
"HF": "1"
} }
} }
+1
View File
@@ -22,3 +22,4 @@ GENERAL = config['General']
dotenv = GENERAL["load_env"] dotenv = GENERAL["load_env"]
HOST = GENERAL["HOST"] HOST = GENERAL["HOST"]
PORT = GENERAL["PORT"] PORT = GENERAL["PORT"]
HF = GENERAL["HF"]
+6 -4
View File
@@ -80,9 +80,12 @@ def get_info_imdb(imdb_id, ismovie, type):
elif type == "StreamingCommunity": elif type == "StreamingCommunity":
return showname return showname
elif type == "Tuttifilm": elif type == "Tuttifilm":
date = data['tv_results'][0]['first_air_date'] if TF_FAST_SEARCH == "0":
date = date.split("-")[0] date = data['tv_results'][0]['first_air_date']
return showname,date date = date.split("-")[0]
return showname,date
elif TF_FAST_SEARCH == "1":
return showname
elif type == "Cool": elif type == "Cool":
return showname return showname
@@ -95,7 +98,6 @@ def get_info_imdb(imdb_id, ismovie, type):
elif type == "Tuttifilm": elif type == "Tuttifilm":
date = data['movie_results'][0]['release_date'] date = data['movie_results'][0]['release_date']
date = date.split("-")[0] date = date.split("-")[0]
print("Real date",date)
return showname,date return showname,date
elif type == "Cool": elif type == "Cool":
return showname return showname
+22 -8
View File
@@ -12,8 +12,15 @@ FILMPERTUTTI = config.FILMPERTUTTI
STREAMINGCOMMUNITY = config.STREAMINGCOMMUNITY STREAMINGCOMMUNITY = config.STREAMINGCOMMUNITY
MYSTERIUS = config.MYSTERIUS MYSTERIUS = config.MYSTERIUS
TUTTIFILM = config.TUTTIFILM TUTTIFILM = config.TUTTIFILM
TF_DOMAIN = config.TF_DOMAIN
HOST = config.HOST HOST = config.HOST
PORT = int(config.PORT) PORT = int(config.PORT)
HF = config.HF
if HF == "1":
HF = "🤗️"
#Cool code to set the hugging face if the service is hosted there.
else:
HF = ""
if MYSTERIUS == "1": if MYSTERIUS == "1":
from cool import cool from cool import cool
@@ -37,7 +44,7 @@ STREAMS = {
"skysport24": [ "skysport24": [
{ {
"title": "Sky Sport 24", "title": "Sky Sport 24",
"poster": "https://www.tanti.bond/public/upload/channel/sky-sport-24.webp", "poster": f"https://www.tanti.{TF_DOMAIN}/public/upload/channel/sky-sport-24.webp",
"url": "https://07-24.mizhls.ru/fls/cdn/calcioXskysport24/playlist.m3u8", "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskysport24/playlist.m3u8",
"behaviorHints": { "behaviorHints": {
"notWebReady": True, "notWebReady": True,
@@ -54,6 +61,7 @@ STREAMS = {
"Skyuno": [ "Skyuno": [
{ {
"title": "Sky Uno", "title": "Sky Uno",
"poster": f"https://www.tanti.{TF_DOMAIN}/public/upload/channel/sky-uno.webp",
"url": "https://07-24.mizhls.ru/fls/cdn/calcioXskyuno/playlist.m3u8", "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskyuno/playlist.m3u8",
"behaviorHints": { "behaviorHints": {
"notWebReady": True, "notWebReady": True,
@@ -70,6 +78,7 @@ STREAMS = {
"skyserie": [ "skyserie": [
{ {
"title": "Sky Serie", "title": "Sky Serie",
"poster": f"https://www.tanti.{TF_DOMAIN}/public/upload/channel/sky-serie.webp",
"url": "https://07-24.mizhls.ru/fls/cdn/calcioXskyserie/playlist.m3u8", "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskyserie/playlist.m3u8",
"behaviorHints": { "behaviorHints": {
"notWebReady": True, "notWebReady": True,
@@ -86,6 +95,7 @@ STREAMS = {
"Sky Nature": [ "Sky Nature": [
{ {
"title": "Sky Nature", "title": "Sky Nature",
"poster": f"https://www.tanti.{TF_DOMAIN}/public/upload/channel/sky-nature.webp",
"url": "https://07-24.mizhls.ru/fls/cdn/calcioXskynature/playlist.m3u8", "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskynature/playlist.m3u8",
"behaviorHints": { "behaviorHints": {
"notWebReady": True, "notWebReady": True,
@@ -102,6 +112,7 @@ STREAMS = {
"skyinvestigation": [ "skyinvestigation": [
{ {
"title": "skyinvestigation", "title": "skyinvestigation",
"poster": f"https://www.tanti.{TF_DOMAIN}/public/upload/channel/sky-nature.webp",
"url": "https://07-24.mizhls.ru/fls/cdn/calcioXskyinvestigation/playlist.m3u8", "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskyinvestigation/playlist.m3u8",
"behaviorHints": { "behaviorHints": {
"notWebReady": True, "notWebReady": True,
@@ -164,20 +175,23 @@ def addon_stream(type, id):
results = cool(id) results = cool(id)
if results: if results:
for resolution, link in results.items(): for resolution, link in results.items():
streams['streams'].append({'title': f'Mysterious {resolution}', 'url': link}) streams['streams'].append({'title': f'{HF}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)
if url_streaming_community is not None: if url_streaming_community is not None:
streams['streams'].append({'title': 'StreamingCommunity 1080p', 'url': f'{url_streaming_community}?rendition=1080p'}) streams['streams'].append({'title': f'{HF}StreamingCommunity 1080p', 'url': f'{url_streaming_community}?rendition=1080p'})
streams['streams'].append({'title': 'StreamingCommunity 720p', 'url': f'{url_streaming_community}?rendition=720p'}) streams['streams'].append({'title': f'{HF}StreamingCommunity 720p', 'url': f'{url_streaming_community}?rendition=720p'})
if FILMPERTUTTI == "1": if FILMPERTUTTI == "1":
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": if TUTTIFILM == "1":
url_tuttifilm = tantifilm(id) url_tuttifilm = tantifilm(id)
streams['streams'].append({'title': 'Tantifilm', 'url': url_tuttifilm, 'behaviorHints': {'proxyHeaders': {"request": {"Referer": "https://d000d.com/"}}, 'notWebReady': True}}) if not isinstance(url_tuttifilm, str):
for title, url in url_tuttifilm.items():
streams['streams'].append({'title': f'{HF}Tantifilm {title}', 'url': url, 'behaviorHints': {'proxyHeaders': {"request": {"Referer": "https://d000d.com/"}}, 'notWebReady': True}})
else:
streams['streams'].append({'title': f'{HF}Tantifilm', 'url': url_tuttifilm, 'behaviorHints': {'proxyHeaders': {"request": {"Referer": "https://d000d.com/"}}, 'notWebReady': True}})
if not streams['streams']: if not streams['streams']:
abort(404) abort(404)
@@ -197,8 +211,8 @@ def meta(type, id):
"id": stream_id, "id": stream_id,
"type": type, "type": type,
"name": item['title'], "name": item['title'],
"poster": item.get('poster', "https://via.placeholder.com/150"), "poster": item.get('poster', "https://icons.iconarchive.com/icons/designbolts/free-multimedia/256/TV-icon.png"),
"background": item.get('background', "https://via.placeholder.com/800x450") "background": item.get('background', "https://icons.iconarchive.com/icons/designbolts/free-multimedia/256/TV-icon.png")
} }
break break
+134 -105
View File
@@ -9,7 +9,7 @@ TF_DOMAIN = config.TF_DOMAIN
##FOR NOW ONLY MOVIES WORK, I HOPE I CAN FIX SERIES ##FOR NOW ONLY MOVIES WORK, I HOPE I CAN FIX SERIES
def search(showname,ismovie,season,episode,date): def search(showname,ismovie,date):
url = f'https://www.tanti.bond/search/{showname}' url = f'https://www.tanti.bond/search/{showname}'
response = requests.get(url) response = requests.get(url)
soup = BeautifulSoup(response.text, "lxml") soup = BeautifulSoup(response.text, "lxml")
@@ -21,44 +21,137 @@ def search(showname,ismovie,season,episode,date):
pattern = r'Data di rilascio\s*</div>\s*<div class="text">\s*(\d{4})\s*</div>' pattern = r'Data di rilascio\s*</div>\s*<div class="text">\s*(\d{4})\s*</div>'
found_date = re.search(pattern, response.text) found_date = re.search(pattern, response.text)
release_date = str(found_date.group(1)) release_date = str(found_date.group(1))
print(release_date)
if release_date == date: if release_date == date:
tid= url.split('-')[1] tid= url.split('-')[-1]
print(tid)
#Return URL and even the soup so I can use it later #Return URL and even the soup so I can use it later
#I try to get doodstream link inside this function so I do not have to get again the response #I try to get doodstream link inside this function so I do not have to get again the response
print(url) return tid,url
return tid
elif ismovie == 0: elif ismovie == 0:
all_link = soup.select('#series .col .list-media') all_link = soup.select('#series .col .list-media')
for link in all_link: for link in all_link:
base_url = link['href'] base_url = link['href']
url = f'{base_url}-{season}-season-{episode}-episode' url = f'{base_url}-1-season-1-episode'
response = requests.get(url) response = requests.get(url)
pattern = r'Data di rilascio\s*</div>\s*<div class="text">\s*(\d{4})\s*</div>' pattern = r'Data di rilascio\s*</div>\s*<div class="text">\s*(\d{4})\s*</div>'
found_date = re.search(pattern, response.text) found_date = re.search(pattern, response.text)
release_date = str(found_date.group(1)) release_date = str(found_date.group(1))
if release_date == date: if release_date == date:
print("RELEASE DATE IS EQUAL")
tid= url.split('-')[1] tid= url.split('-')[1]
print(tid) soup = BeautifulSoup(response.text, 'lxml')
a_tag = soup.find('a', class_='dropdown-toggle btn-service selected')
embed_id = a_tag['data-embed']
#I try to get doodstream link inside this function so I do not have to get again the response #I try to get doodstream link inside this function so I do not have to get again the response
return tid return url,embed_id
def fast_search(showname,ismovie):
url = f'https://www.tanti.bond/search/{showname}'
response = requests.get(url)
soup = BeautifulSoup(response.text, "lxml")
if ismovie == 1:
first_link = soup.select_one('#movies .col .list-media')
url = first_link['href']
tid= url.split('-')[1]
return tid,url
elif ismovie == 0:
first_link = soup.select_one('#series .col .list-media')
base_url = first_link['href']
url = f'{base_url}-1-season-1-episode'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
a_tag = soup.find('a', class_='dropdown-toggle btn-service selected')
embed_id = a_tag['data-embed']
return url,embed_id
def get_protect_link(id): def get_protect_link(id,url):
#Get the link where the Iframe is located, which contains the doodstream url kind of. #Get the link where the Iframe is located, which contains the doodstream url kind of.
response = requests.get(f"https://p.hdplayer.casa/myadmin/play.php?id={id}") response = requests.get(f"https://p.hdplayer.casa/myadmin/play.php?id={id}")
soup = BeautifulSoup(response.text, "lxml", parse_only=SoupStrainer('iframe')) soup = BeautifulSoup(response.text, "lxml", parse_only=SoupStrainer('iframe'))
print(soup) protect_link = soup.iframe['src']
protect_link = soup.iframe['src'] if "protect" in protect_link:
print("HERE PROTECT_LINK",protect_link) return protect_link
return protect_link else:
#DO this in case the movie has a 3D version etc
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
a_tag = soup.find('a', class_='dropdown-toggle btn-service selected')
embed_id = a_tag['data-embed']
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
'Referer': url
}
#Parameters needed is the embed ID
data = {
'id': embed_id
}
ajax_url = "https://www.tanti.bond/ajax/embed"
response = requests.post(ajax_url, headers=headers, data=data)
hdplayer = response.text[43:-27]
response = requests.get(hdplayer)
soup = BeautifulSoup(response.text, 'lxml')
links_dict = {}
li_tags = soup.select('ul.nav.navbar-nav li.dropdown')
for li_tag in li_tags:
a_tag = li_tag.find('a')
if a_tag:
title = a_tag.text.strip()
#Since tantifilm player is broken I just skip it
if title == "1" or "Tantifilm" in title:
continue # Get the text of the <a> tag
href = a_tag['href']
response = requests.get(href)
soup = BeautifulSoup(response.text, "lxml", parse_only=SoupStrainer('iframe'))
protect_link = soup.iframe['src']
if "protect" in protect_link:
url = true_url(protect_link)
links_dict[title] = url
return links_dict
# Get the value of the href attribute
def get_nuovo_indirizzo_and_protect_link(url,embed_id,season,episode):
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
'Referer': url
}
#Parameters needed is the embed ID
data = {
'id': embed_id
}
ajax_url = "https://www.tanti.bond/ajax/embed"
response = requests.post(ajax_url, headers=headers, data=data)
nuovo_indirizzo = response.text[43:-27]
response = requests.get(nuovo_indirizzo)
soup = BeautifulSoup(response.text, 'lxml')
#Get season
season = season - 1
li_tags = soup.select('ul.nav.navbar-nav > li.dropdown')
if len(li_tags) != 1:
link = li_tags[season].find('a')['href']
response = requests.get(link)
soup = BeautifulSoup(response.text, 'lxml')
option_tag = soup.select(f'select[name="ep_select"] > option:nth-of-type({episode})')[0]
link = option_tag['value']
#Let's find protect link now
response = requests.get(link)
soup = BeautifulSoup(response.text, "lxml", parse_only=SoupStrainer('iframe'))
protect_link = soup.iframe['src']
return protect_link
else:
#If there is only one season than
option_tag = soup.select('select.dynamic_select > option')[episode]
link = option_tag['value']
#Let's find protect link now
response = requests.get(link)
soup = BeautifulSoup(response.text, "lxml", parse_only=SoupStrainer('iframe'))
protect_link = soup.iframe['src']
return protect_link
def true_url(protect_link): def true_url(protect_link):
print(protect_link)
# Define headers # Define headers
headers = { headers = {
"Range": "bytes=0-", "Range": "bytes=0-",
@@ -100,125 +193,61 @@ def true_url(protect_link):
#Get temporaly ID #Get temporaly ID
def tantifilm(imdb): def tantifilm(imdb):
urls = None
try: 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:
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)
url,embed_id = search(showname,ismovie,date)
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 url,embed_id = fast_search(showname,ismovie)
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": if TF_FAST_SEARCH == "0":
showname = get_info_tmdb(tmdba,ismovie,type) showname,date = get_info_tmdb(tmdba,ismovie,type)
date = None url,embed_id = search(showname,ismovie,date)
elif TF_FAST_SEARCH == "1":
showname= get_info_tmdb(tmdba,ismovie,type)
url,embed_id = fast_search(showname,ismovie)
protect_link = get_nuovo_indirizzo_and_protect_link(url,embed_id,season,episode)
url = true_url(protect_link)
return url
elif ismovie == 1: elif ismovie == 1:
season = None
episode = None
if "tt" in imdb: if "tt" in imdb:
#Get showname #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)
tid,url = search(showname,ismovie,date)
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
tid,url = fast_search(showname,ismovie)
else: else:
#else just equals themtantifilm("tt2096673") #else just equals themtantifilm("tt2096673")
if TF_FAST_SEARCH == "0": if TF_FAST_SEARCH == "0":
showname,date = get_info_tmdb(imdb,ismovie,type) showname,date = get_info_tmdb(imdb,ismovie,type)
date = None tid,url = search(showname,ismovie,date)
elif TF_FAST_SEARCH == "1": elif TF_FAST_SEARCH == "1":
showname = get_info_tmdb(imdb,ismovie,type) showname = get_info_tmdb(imdb,ismovie,type)
date = None tid,url = fast_search(showname,ismovie)
protect_link = get_protect_link(tid,url)
tid = search(showname,ismovie,season,episode,date) if not isinstance(protect_link, str):
protect_link = get_protect_link(tid) urls = protect_link
url = true_url(protect_link) return urls
return url url = true_url(protect_link)
return url
except Exception as e: except Exception as e:
print("Tantifilm Error") if urls or url == None:
print("Tantifilm Error")
#OLD SEARC THAT DOESN't CHECK THE DATE
def mamma(showname,ismovie,season,episode):
url = f'https://www.tanti.bond/search/{showname}'
response = requests.get(url)
soup = BeautifulSoup(response.text, "lxml")
if ismovie == 1:
first_link = soup.select_one('#movies .col .list-media')
url = first_link['href']
return url
elif ismovie == 0:
first_link = soup.select_one('#series .col .list-media')
base_url = first_link['href']
url = f'{base_url}-{season}-{episode}'
print(url)
return url
def searcht(showname,ismovie,season,episode):
url = f'https://www.tanti.bond/search/{showname}'
response = requests.get(url)
soup = BeautifulSoup(response.text, "lxml")
date = "2020"
if ismovie == 1:
all_link = soup.select('#movies .col .list-media')
for link in all_link:
url = link['href']
response = requests.get(url)
info_soup = BeautifulSoup(response.text, "lxml")
release_date= info_soup.select('div.video-attr div.text')[4].text.strip()
if release_date == date:
print("WOW")
#Return URL and even the soup so I can use it later
return url,info_soup
elif ismovie == 0:
all_link = soup.select('#series .col .list-media')
for link in all_link:
base_url = link['href']
url = f'{base_url}-{season}-season-{episode}-episode'
response = requests.get(url)
info_soup = BeautifulSoup(response.text, "lxml")
release_date= info_soup.select('div.video-attr div.text')[4].text.strip()
if release_date == date:
print("RELEASE DATE IS EQUAL")
#Return URL and even the soup so I can use it later
return url,info_soup