Mythus commited on
Commit
febdbd5
·
verified ·
1 Parent(s): ea17bc1

Upload 10 files

Browse files
Files changed (10) hide show
  1. config.py +24 -0
  2. convert.py +20 -0
  3. convert_date.py +39 -0
  4. cool.py +145 -0
  5. filmpertutti.py +136 -0
  6. info.py +116 -0
  7. loadenv.py +17 -0
  8. run.py +188 -0
  9. streamingcommunity.py +157 -0
  10. tantifilm.py +224 -0
config.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #LOAD THE CONFIG
2
+ import json
3
+
4
+ # Open the configuration file
5
+ with open('config.json') as f:
6
+ # Load JSON data from file
7
+ config = json.load(f)
8
+
9
+ # Accessing SC_DOMAIN
10
+ SITE = config["Siti"]
11
+ FT_DOMAIN = SITE["Filmpertutti"]['domain']
12
+ SC_DOMAIN = SITE["StreamingCommunity"]['domain']
13
+ TF_DOMAIN = SITE["Tuttifilm"]['enabled']
14
+ FILMPERTUTTI = SITE["Filmpertutti"]['enabled']
15
+ STREAMINGCOMMUNITY = SITE["StreamingCommunity"]['enabled']
16
+ MYSTERIUS = SITE["Mysterius"]['enabled']
17
+ TUTTIFILM = SITE["Tuttifilm"]['enabled']
18
+ SC_FAST_SEARCH = SITE["StreamingCommunity"]['fast_search']
19
+ TF_FAST_SEARCH = SITE["Tuttifilm"]['fast_search']
20
+ #General
21
+ GENERAL = config['General']
22
+ dotenv = GENERAL["load_env"]
23
+ HOST = GENERAL["HOST"]
24
+ PORT = GENERAL["PORT"]
convert.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ from tmdbv3api import TMDb, Movie, TV
3
+ from loadenv import load_env
4
+ import config
5
+ MYSTERIUS = config.MYSTERIUS
6
+ if MYSTERIUS == "1":
7
+ TMDB_KEY,_= load_env()
8
+ else:
9
+ TMDB_KEY= load_env()
10
+ def get_TMDb_id_from_IMDb_id(imdb_id):
11
+ response = requests.get(f'https://api.themoviedb.org/3/find/{imdb_id}',
12
+ params={'external_source': 'imdb_id', 'api_key': f'{TMDB_KEY}'})
13
+ tmbda = response.json()
14
+ if tmbda['movie_results']:
15
+ return tmbda['movie_results'][0]['id']
16
+ elif tmbda['tv_results']:
17
+ print(tmbda['tv_results'][0]['id'])
18
+ return tmbda['tv_results'][0]['id']
19
+ else:
20
+ return None
convert_date.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ def convert_US_date(date):
3
+ us_data = next((country_data for country_data in date['results'] if country_data["iso_3166_1"] == "US"), None)
4
+ if us_data:
5
+ us_release_dates_type_3 = [rd for rd in us_data['release_dates'] if rd['type'] == 3]
6
+ # Sort the list of release dates and get the latest
7
+ us_release_dates_type_3.sort(key = lambda x: x['release_date'], reverse=True)
8
+ if len(us_release_dates_type_3) > 0:
9
+ latest_release_date = us_release_dates_type_3[0]['release_date']
10
+ date = latest_release_date.split('T')[0]
11
+ print('Latest US theatrical release date:', date)
12
+ return date
13
+ else:
14
+ us_release_dates_type_4 = [rd for rd in us_data['release_dates'] if rd['type'] == 4]
15
+ us_release_dates_type_4.sort(key = lambda x: x['release_date'], reverse=True)
16
+ if len(us_release_dates_type_4) > 0:
17
+ latest_release_date = us_release_dates_type_4[0]['release_date']
18
+ date = latest_release_date.split('T')[0]
19
+ print('Latest US theatrical release date (type 4):', date)
20
+ return date
21
+ def convert_IT_date(date):
22
+ it_data = next((country_data for country_data in date['results'] if country_data["iso_3166_1"] == "IT"), None)
23
+ if it_data:
24
+ it_release_dates_type_3 = [rd for rd in it_data['release_dates'] if rd['type'] == 3]
25
+ # Sort the list of release dates and get the latest
26
+ it_release_dates_type_3.sort(key = lambda x: x['release_date'], reverse=True)
27
+ if len(it_release_dates_type_3) > 0:
28
+ latest_release_date = it_release_dates_type_3[0]['release_date']
29
+ date = latest_release_date.split('T')[0]
30
+ print('Latest IT theatrical release date:', date)
31
+ return date
32
+ else:
33
+ it_release_dates_type_4 = [rd for rd in it_data['release_dates'] if rd['type'] == 4]
34
+ it_release_dates_type_4.sort(key = lambda x: x['release_date'], reverse=True)
35
+ if len(it_release_dates_type_4) > 0:
36
+ latest_release_date = it_release_dates_type_4[0]['release_date']
37
+ date = latest_release_date.split('T')[0]
38
+ print('Latest IT theatrical release date (type 4):', date)
39
+ return date
cool.py ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import json
3
+ from info import get_info_tmdb,is_movie
4
+ from convert import get_TMDb_id_from_IMDb_id
5
+ from loadenv import load_env
6
+ _,MYSTERIUS_KEY = load_env()
7
+ def get_links(slug,season,episode,ismovie):
8
+ try:
9
+ headers = {
10
+ "x-api-key": MYSTERIUS_KEY
11
+ }
12
+ response = requests.get("https://mammamia-urlo-ulala12431.hf.space/api/cookie", headers=headers)
13
+ Auths = response.json()
14
+ Bearer = Auths.get('cookie')
15
+ ap_session = Auths.get('auth')
16
+
17
+ cookies = {'ap_session': ap_session}
18
+
19
+ headers = {
20
+ 'accept': 'application/json, text/plain, */*',
21
+ 'accept-language': 'it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7',
22
+ 'authorization': f'Bearer {Bearer}',
23
+ 'referer': f'https://altadefinizione-originale.com/play/{slug}',
24
+ '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',
25
+ 'x-requested-with': 'XMLHttpRequest',
26
+ }
27
+ if ismovie == 1:
28
+
29
+ response = requests.get(f'https://altadefinizione-originale.com/api/post/urls/stream/{slug}',cookies=cookies,headers=headers)
30
+ elif ismovie == 0:
31
+ print("HERE SEASON",season)
32
+ print("HERE EPISODE",episode)
33
+ request_url =f'https://altadefinizione-originale.com/api/post/urls/stream/{slug}/{season}/{episode}'
34
+ print(request_url)
35
+ response = requests.get(request_url,cookies=cookies,headers=headers)
36
+ try:
37
+ video_data = response.json() # Assuming this is the JSON response containing video streams
38
+
39
+ if 'streams' not in video_data:
40
+ print("Invalid JSON format: 'streams' key not found or incorrect structure")
41
+ return None
42
+
43
+ streams = video_data['streams']
44
+
45
+ resolutions = {}
46
+
47
+ for stream in streams:
48
+ resolution_name = stream['resolution']['name'].lower() # Convert resolution name to lowercase
49
+ url = stream['url']
50
+
51
+ # Remove everything after '.mp4' in the URL
52
+ mp4_index = url.find('.mp4')
53
+ if mp4_index != -1:
54
+ url = url[:mp4_index + 4] # +4 to include '.mp4' in the substring
55
+
56
+ resolutions[resolution_name] = url
57
+
58
+ return resolutions
59
+
60
+ except KeyError as e:
61
+ print(f"KeyError: {e}")
62
+ return None
63
+ except json.JSONDecodeError as e:
64
+ print(f"JSONDecodeError: {e}")
65
+ return None
66
+
67
+ except requests.RequestException as e:
68
+ print(f"Request error: {e}")
69
+ return None
70
+
71
+
72
+ # Example usage: Fetch video links
73
+
74
+
75
+ # Print the dictionary
76
+
77
+
78
+
79
+
80
+
81
+ def search_imdb(showname,tmdba):
82
+ tmdba = str(tmdba)
83
+ query = f'https://altadefinizione-originale.com/api/search?search={showname}&page=1'
84
+ response = requests.get(query)
85
+ if response.status_code == 200:
86
+ data = response.json()
87
+ if 'data' in data:
88
+ for item in data['data']:
89
+ if item.get('tmdb_id') == tmdba:
90
+ slug = item.get('slug')
91
+ print(slug)
92
+ return slug
93
+
94
+
95
+
96
+ def parse_links(resolution_links):
97
+ results = {}
98
+ if resolution_links:
99
+ print("Video links:")
100
+ for resolution, link in resolution_links.items():
101
+ if "cdn.altadefinizione-originale.com" in link:
102
+ link = link.replace("cdn.altadefinizione-originale.com","protectlinknt.b-cdn.net")
103
+ print(f"{resolution}: {link}")
104
+ results[resolution] = link
105
+ return results
106
+ else:
107
+ print("Failed to fetch video links")
108
+
109
+
110
+ def cool(imdb):
111
+ try:
112
+ type = "Cool"
113
+ general = is_movie(imdb)
114
+ ismovie = general[0]
115
+ imdb_id = general[1]
116
+ if ismovie == 0 :
117
+ season = int(general[2])
118
+ episode = int(general[3])
119
+
120
+ if "tt" in imdb:
121
+ #Get showname
122
+ tmdba = get_TMDb_id_from_IMDb_id(imdb_id)
123
+ else:
124
+ tmdba = imdb_id.replace("tmdb:","")
125
+
126
+ showname = get_info_tmdb(tmdba,ismovie,type)
127
+
128
+
129
+ slug = search_imdb(showname,tmdba)
130
+ print(ismovie)
131
+ if ismovie == 1:
132
+ season = None
133
+ episode = None
134
+ resolution_links = get_links(slug,episode,season,ismovie)
135
+ results = parse_links(resolution_links)
136
+ return results
137
+ elif ismovie == 0:
138
+ season = season -1
139
+ episode = episode - 1
140
+ resolution_links = get_links(slug,season,episode,ismovie)
141
+ results = parse_links(resolution_links)
142
+ return results
143
+ except Exception as e:
144
+ print("Cool Error")
145
+ return None
filmpertutti.py ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ from tmdbv3api import TMDb, Movie, TV
3
+ import requests
4
+ from bs4 import BeautifulSoup,SoupStrainer
5
+ import string
6
+ import re
7
+ from datetime import datetime
8
+ import dateparser
9
+ from convert import get_TMDb_id_from_IMDb_id
10
+ from info import get_info_tmdb, is_movie, get_info_imdb
11
+ from convert_date import convert_US_date
12
+ import logging
13
+ import config
14
+
15
+ FT_DOMAIN = config.FT_DOMAIN
16
+
17
+ #Some basic headers
18
+ headers = {
19
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.10; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
20
+ 'Accept-Language': 'en-US,en;q=0.5'
21
+ }
22
+ #Map months to check if date = date
23
+ month_mapping = {
24
+ 'Jan': 'Gennaio', 'Feb': 'Febbraio', 'Mar': 'Marzo', 'Apr': 'Aprile',
25
+ 'May': 'Maggio', 'Jun': 'Giugno', 'Jul': 'Luglio', 'Aug': 'Agosto',
26
+ 'Sep': 'Settembre', 'Oct': 'Ottobre', 'Nov': 'Novembre', 'Dec': 'Dicembre'
27
+ }
28
+
29
+ def search(query,date):
30
+ response = requests.get(query).json()
31
+ #Get link tid of every item and then open the link to see if the date = date
32
+ for json in response:
33
+ link = json['link']
34
+ tid = json['id']
35
+ series_response = requests.get(link, headers=headers)
36
+ series_soup = BeautifulSoup(series_response.text, 'lxml')
37
+ release_span = series_soup.find('span', class_='released')
38
+ if release_span:
39
+ if release_span.text != "Data di uscita: N/A":
40
+ date_string = release_span.text.split(': ')[-1] # Get the date part
41
+ for eng, ita in month_mapping.items():
42
+ date_string = re.sub(rf'\b{eng}\b', ita, date_string)
43
+
44
+ # Swap to YY-MM-DD formatting using dateparser
45
+ release_date = dateparser.parse(date_string, languages=['it']).strftime("%Y-%m-%d")
46
+ if release_date == date:
47
+ url = link
48
+ tid = tid
49
+ return url, tid
50
+ else:
51
+ print("Date are not equals")
52
+
53
+ def get_episode_link(season,episode,tid,url):
54
+ #Get the link from where we have to obtain mixdrop link
55
+ tlink = f'{url}?show_video=true&post_id={tid}&season_id={season-1}&episode_id={episode-1}'
56
+ return tlink
57
+
58
+
59
+ def get_film(url):
60
+ #Get the link from where we have to obtain mixdrop link
61
+ tlink = url + "?show_video=true"
62
+ return tlink
63
+
64
+ def get_real_link(tlink):
65
+ #Some basic code to get the mixdrop link
66
+ page = requests.get(tlink, headers=headers)
67
+ soup = BeautifulSoup(page.content, features="lxml",parse_only=SoupStrainer('iframe'))
68
+ iframe_src = soup.find('iframe')['src']
69
+
70
+ iframe_page = requests.get(iframe_src, headers=headers)
71
+ iframe_soup = BeautifulSoup(iframe_page.content, features="lxml")
72
+
73
+ mega_button = iframe_soup.find('div', attrs={'class': 'megaButton', 'rel': 'nofollow'}, string='MIXDROP')
74
+ if mega_button:
75
+ real_link = mega_button.get('meta-link')
76
+ return real_link
77
+
78
+ def get_true_link(real_link):
79
+ response = requests.get(real_link, headers=headers)
80
+ [s1, s2] = re.search(r"\}\('(.+)',.+,'(.+)'\.split", response.text).group(1, 2)
81
+ schema = s1.split(";")[2][5:-1]
82
+ terms = s2.split("|")
83
+ charset = string.digits + string.ascii_letters
84
+ d = dict()
85
+ for i in range(len(terms)):
86
+ d[charset[i]] = terms[i] or charset[i]
87
+ s = 'https:'
88
+ for c in schema:
89
+ s += d[c] if c in d else c
90
+ return s
91
+
92
+ def filmpertutti(imdb):
93
+ general = is_movie(imdb)
94
+ ismovie = general[0]
95
+ imdb_id = general[1]
96
+ type = "Filmpertutti"
97
+ if ismovie == 0 :
98
+ season = int(general[2])
99
+ episode = int(general[3])
100
+ if "tt" in imdb:
101
+ if ismovie == 0:
102
+ #Get showname and date
103
+ showname,date = get_info_imdb(imdb_id,ismovie,type)
104
+ else:
105
+ #THIS IS needed cause the only way to get all releases dates is by giving a tmdb ID not a IMDB
106
+ tmdba = get_TMDb_id_from_IMDb_id(imdb_id)
107
+ showname,date = get_info_tmdb(tmdba,ismovie,type)
108
+
109
+ elif "tmdb" in imdb:
110
+ #Get showname and date
111
+ tmdba = imdb_id.replace("tmdb:","")
112
+ showname,date = get_info_tmdb(tmdba,ismovie,type)
113
+ showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
114
+ #Build the query
115
+ query = f'https://filmpertutti.{FT_DOMAIN}/wp-json/wp/v2/posts?search={showname}&page=1&_fields=link,id'
116
+ try:
117
+ url,tid = search(query,date)
118
+ except:
119
+ print("No results found")
120
+ return None
121
+ if ismovie == 0:
122
+ episode_link = get_episode_link(season,episode,tid,url)
123
+ #Let's get mixdrop link
124
+ real_link = get_real_link(episode_link)
125
+ #let's get delivery link, streaming link
126
+ streaming_link = get_true_link(real_link)
127
+ print(streaming_link)
128
+ return streaming_link
129
+ elif ismovie == 1:
130
+ film_link = get_film(url)
131
+ #Let's get mixdrop link
132
+ real_link = get_real_link(film_link)
133
+ #let's get delivery link, streaming link
134
+ streaming_link = get_true_link(real_link)
135
+ print(streaming_link)
136
+ return streaming_link
info.py ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from loadenv import load_env
2
+ from tmdbv3api import TMDb, Movie, TV
3
+ from convert_date import convert_US_date, convert_IT_date
4
+ import requests
5
+ import config
6
+ SC_FAST_SEARCH = config.SC_FAST_SEARCH
7
+ TF_FAST_SEARCH = config.TF_FAST_SEARCH
8
+ MYSTERIUS = config.MYSTERIUS
9
+ if MYSTERIUS == "1":
10
+ TMDB_KEY,_= load_env()
11
+ else:
12
+ TMDB_KEY= load_env()
13
+
14
+ def get_info_tmdb(tmbda,ismovie,type):
15
+ tmdb = TMDb()
16
+ tmdb.api_key = f'{TMDB_KEY}'
17
+ tmdb.language = 'it'
18
+ if ismovie == 0:
19
+ tv = TV()
20
+ show= tv.details(tmbda)
21
+ showname = show.name
22
+ if type == "Filmpertutti":
23
+ date= show.first_air_date
24
+ print("Real date",date)
25
+ return showname,date
26
+ elif type == "StreamingCommunity":
27
+ if SC_FAST_SEARCH == "0":
28
+ n_season = show.number_of_seasons
29
+ return showname,n_season
30
+ else:
31
+ return showname
32
+ elif type == "Tuttifilm":
33
+ if TF_FAST_SEARCH == "0":
34
+ date = show.first_air_date
35
+ date = date.split("-")[0]
36
+ print("Real date",date)
37
+ return showname,date
38
+ else:
39
+ return showname
40
+ elif type == "Cool":
41
+ return showname
42
+
43
+ elif ismovie == 1:
44
+ movie = Movie()
45
+ show= movie.details(tmbda)
46
+ showname= show.title
47
+ #Get all release dates
48
+ if type == "Filmpertutti":
49
+ date = show.release_dates
50
+ #GET US RELEASE DATE because filmpertutti somewhy uses US release date
51
+ date = convert_US_date(date)
52
+ return showname,date
53
+ elif type == "StreamingCommunity":
54
+ return showname
55
+ elif type == "Tuttifilm":
56
+ if TF_FAST_SEARCH == "0":
57
+ date = show.release_date
58
+ date = date.split("-")[0]
59
+ print("Real date",date)
60
+ return showname,date
61
+ else:
62
+ return showname
63
+ elif type == "Cool":
64
+ return showname
65
+
66
+
67
+ def get_info_imdb(imdb_id, ismovie, type):
68
+
69
+ resp = requests.get(f'https://api.themoviedb.org/3/find/{imdb_id}?api_key={TMDB_KEY}&language=it&external_source=imdb_id')
70
+ data = resp.json()
71
+ if ismovie == 0:
72
+ showname = data['tv_results'][0]['name']
73
+ if type == "Filmpertutti":
74
+ date= data['tv_results'][0]['first_air_date']
75
+ print("Real date",date)
76
+ return showname, date
77
+ elif type == "StreamingCommunity":
78
+ return showname
79
+ elif type == "Tuttifilm":
80
+ date = data['tv_results'][0]['first_air_date']
81
+ date = date.split("-")[0]
82
+ return showname,date
83
+ elif type == "Cool":
84
+ return showname
85
+
86
+ elif ismovie == 1:
87
+ showname= data['movie_results'][0]['title']
88
+ if type == "Filmpertutti":
89
+ return
90
+ elif type == "StreamingCommunity":
91
+ return showname
92
+ elif type == "Tuttifilm":
93
+ date = data['movie_results'][0]['release_date']
94
+ date = date.split("-")[0]
95
+ print("Real date",date)
96
+ return showname,date
97
+ elif type == "Cool":
98
+ return showname
99
+
100
+
101
+
102
+
103
+
104
+
105
+ def is_movie(imdb_id):
106
+ if "tmdb:" in imdb_id:
107
+ imdb_id = imdb_id.replace("tmdb:","")
108
+ if ":" in imdb_id:
109
+ season = imdb_id.split(":")[1]
110
+ episode = imdb_id.split(":")[-1]
111
+ ismovie = 0
112
+ imdb_id = imdb_id.split(":")[0]
113
+ return ismovie,imdb_id,season,episode
114
+ else:
115
+ ismovie = 1
116
+ return ismovie,imdb_id
loadenv.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import config
3
+ import config
4
+ MYSTERIUS = config.MYSTERIUS
5
+ dotenv = config.dotenv
6
+ #You need to keep dotenv disabled on remote servers
7
+ if dotenv == "1":
8
+ from dotenv import load_dotenv
9
+ load_dotenv(".env")
10
+
11
+
12
+ def load_env():
13
+ TMDB_KEY = os.getenv('TMDB_KEY')
14
+ if MYSTERIUS == "1":
15
+ MYSTERIUS_KEY = os.getenv('MYSTERIUS_KEY')
16
+ return TMDB_KEY, MYSTERIUS_KEY
17
+ return TMDB_KEY
run.py ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from flask import Flask, jsonify, abort
2
+ from filmpertutti import filmpertutti
3
+ from streamingcommunity import streaming_community
4
+ from tantifilm import tantifilm
5
+ import json
6
+ import config
7
+ import logging
8
+
9
+ # Configure logging
10
+
11
+ FILMPERTUTTI = config.FILMPERTUTTI
12
+ STREAMINGCOMMUNITY = config.STREAMINGCOMMUNITY
13
+ MYSTERIUS = config.MYSTERIUS
14
+ TUTTIFILM = config.TUTTIFILM
15
+ HOST = config.HOST
16
+ PORT = int(config.PORT)
17
+ if MYSTERIUS == "1":
18
+ from cool import cool
19
+
20
+ app = Flask(__name__)
21
+
22
+ MANIFEST = {
23
+ "id": "org.stremio.mammamia",
24
+ "version": "1.0.0",
25
+ "catalogs": [
26
+ {"type": "tv", "id": "tv_channels", "name": "TV Channels"}
27
+ ],
28
+ "resources": ["stream", "catalog"],
29
+ "types": ["movie", "series", "tv"],
30
+ "name": "Mamma Mia",
31
+ "description": "Addon providing HTTPS Stream for Italian Movies/Series",
32
+ "logo": "https://creazilla-store.fra1.digitaloceanspaces.com/emojis/49647/pizza-emoji-clipart-md.png"
33
+ }
34
+
35
+ STREAMS = {
36
+ "tv": {
37
+ "skysport24": [
38
+ {
39
+ "title": "Sky Sport 24",
40
+ "poster": "https://www.tanti.bond/public/upload/channel/sky-sport-24.webp",
41
+ "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskysport24/playlist.m3u8",
42
+ "behaviorHints": {
43
+ "notWebReady": True,
44
+ "proxyHeaders": {
45
+ "request": {
46
+ "Referer": "https://claplivehdplay.ru/",
47
+ "Origin": "https://claplivehdplay.ru",
48
+ "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
49
+ }
50
+ }
51
+ }
52
+ }
53
+ ],
54
+ "Skyuno": [
55
+ {
56
+ "title": "Sky Uno",
57
+ "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskyuno/playlist.m3u8",
58
+ "behaviorHints": {
59
+ "notWebReady": True,
60
+ "proxyHeaders": {
61
+ "request": {
62
+ "Referer": "https://claplivehdplay.ru/",
63
+ "Origin": "https://claplivehdplay.ru",
64
+ "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
65
+ }
66
+ }
67
+ }
68
+ }
69
+ ],
70
+ "skyserie": [
71
+ {
72
+ "title": "Sky Serie",
73
+ "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskyserie/playlist.m3u8",
74
+ "behaviorHints": {
75
+ "notWebReady": True,
76
+ "proxyHeaders": {
77
+ "request": {
78
+ "Referer": "https://claplivehdplay.ru/",
79
+ "Origin": "https://claplivehdplay.ru",
80
+ "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
81
+ }
82
+ }
83
+ }
84
+ }
85
+ ],
86
+ "Sky Nature": [
87
+ {
88
+ "title": "Sky Nature",
89
+ "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskynature/playlist.m3u8",
90
+ "behaviorHints": {
91
+ "notWebReady": True,
92
+ "proxyHeaders": {
93
+ "request": {
94
+ "Referer": "https://claplivehdplay.ru/",
95
+ "Origin": "https://claplivehdplay.ru",
96
+ "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
97
+ }
98
+ }
99
+ }
100
+ }
101
+ ],
102
+ "skyinvestigation": [
103
+ {
104
+ "title": "skyinvestigation",
105
+ "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskyinvestigation/playlist.m3u8",
106
+ "behaviorHints": {
107
+ "notWebReady": True,
108
+ "proxyHeaders": {
109
+ "request": {
110
+ "Referer": "https://claplivehdplay.ru/",
111
+ "Origin": "https://claplivehdplay.ru",
112
+ "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
113
+ }
114
+ }
115
+ }
116
+ }
117
+ ]
118
+ }
119
+ }
120
+
121
+ def respond_with(data):
122
+ resp = jsonify(data)
123
+ resp.headers['Access-Control-Allow-Origin'] = '*'
124
+ resp.headers['Access-Control-Allow-Headers'] = '*'
125
+ return resp
126
+
127
+ @app.route('/manifest.json')
128
+ def addon_manifest():
129
+ return respond_with(MANIFEST)
130
+
131
+ @app.route('/')
132
+ def root():
133
+ return "Hello, this is a Stremio Addon providing HTTPS Stream for Italian Movies/Series, to install it add /manifest.json to the url and then add it into the Stremio search bar"
134
+
135
+ @app.route('/catalog/<type>/<id>.json')
136
+ def addon_catalog(type, id):
137
+ if type not in MANIFEST['types']:
138
+ abort(404)
139
+ catalog = {'metas': []}
140
+ if type in STREAMS:
141
+ for stream_id in STREAMS[type]:
142
+ for item in STREAMS[type][stream_id]:
143
+ meta_item = {
144
+ "id": stream_id,
145
+ "type": type,
146
+ "name": item['title'],
147
+ "poster": item.get('poster', "https://via.placeholder.com/150")
148
+ }
149
+ catalog['metas'].append(meta_item)
150
+ return respond_with(catalog)
151
+
152
+ @app.route('/stream/<type>/<id>.json')
153
+ def addon_stream(type, id):
154
+ if type not in MANIFEST['types']:
155
+ abort(404)
156
+ streams = {'streams': []}
157
+
158
+ if type in STREAMS and id in STREAMS[type]:
159
+ logging.debug(f"Found TV channel: {id}")
160
+ streams['streams'] = STREAMS[type][id]
161
+ else:
162
+ logging.debug(f"Handling movie or series: {id}")
163
+ if MYSTERIUS == "1":
164
+ results = cool(id)
165
+ if results:
166
+ for resolution, link in results.items():
167
+ streams['streams'].append({'title': f'Mysterious {resolution}', 'url': link})
168
+ if STREAMINGCOMMUNITY == "1":
169
+ url_streaming_community = streaming_community(id)
170
+ print(url_streaming_community)
171
+ if url_streaming_community is not None:
172
+ streams['streams'].append({'title': 'StreamingCommunity 1080p', 'url': f'{url_streaming_community}?rendition=1080p'})
173
+ streams['streams'].append({'title': 'StreamingCommunity 720p', 'url': f'{url_streaming_community}?rendition=720p'})
174
+ if FILMPERTUTTI == "1":
175
+ url_filmpertutti = filmpertutti(id)
176
+ if url_filmpertutti is not None:
177
+ streams['streams'].append({'title': 'Filmpertutti', 'url': url_filmpertutti})
178
+ if TUTTIFILM == "1":
179
+ url_tuttifilm = tantifilm(id)
180
+ streams['streams'].append({'title': 'Tantifilm', 'url': url_tuttifilm, 'behaviorHints': {'proxyHeaders': {"request": {"Referer": "https://d000d.com/"}}, 'notWebReady': True}})
181
+
182
+ if not streams['streams']:
183
+ abort(404)
184
+
185
+ return respond_with(streams)
186
+
187
+ if __name__ == '__main__':
188
+ app.run(host=HOST, port=PORT)
streamingcommunity.py ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from tmdbv3api import TMDb, Movie, TV
2
+ import requests
3
+ import logging
4
+ from bs4 import BeautifulSoup,SoupStrainer
5
+ from datetime import datetime
6
+ import dateparser
7
+ from convert import get_TMDb_id_from_IMDb_id
8
+ from info import get_info_tmdb, is_movie, get_info_imdb
9
+ import config
10
+ import json
11
+ #Get domain
12
+ SC_DOMAIN= config.SC_DOMAIN
13
+ SC_FAST_SEARCH = config.SC_FAST_SEARCH
14
+
15
+ headers = {
16
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.10; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
17
+ 'Accept-Language': 'en-US,en;q=0.5'
18
+ }
19
+
20
+ #GET VERSION OF STREAMING COMMUNITY:
21
+ def get_version():
22
+ #Extract the version from the main page of the site
23
+
24
+
25
+ try:
26
+ base_url = f'https://streamingcommunity.{SC_DOMAIN}/richiedi-un-titolo'
27
+ response = requests.get(base_url, headers=headers)
28
+ #Soup the response
29
+ soup = BeautifulSoup(response.text, "lxml")
30
+
31
+ # Extract version
32
+ version = json.loads(soup.find("div", {"id": "app"}).get("data-page"))['version']
33
+ return version
34
+ except:
35
+ print("Couldn't find the version")
36
+ version = "65e52dcf34d64173542cd2dc6b8bb75b"
37
+ return version
38
+
39
+ def search(query,n_season,ismovie):
40
+ #Do a request to get the ID of serie/move and it's slug in the URL
41
+ response = requests.get(query).json()
42
+ for item in response['data']:
43
+ tid = item['id']
44
+ slug = item['slug']
45
+ idk = item['seasons_count']
46
+ if SC_FAST_SEARCH == "0":
47
+ if ismovie == 0:
48
+ seasons_count = item['seasons_count']
49
+ if seasons_count == n_season:
50
+ return tid,slug
51
+ elif ismovie == 1:
52
+ return tid,slug
53
+ elif SC_FAST_SEARCH == "1":
54
+ return tid,slug
55
+
56
+
57
+ def get_film(tid):
58
+ #Access the iframe
59
+ url = f'https://streamingcommunity.{SC_DOMAIN}/iframe/{tid}'
60
+ response = requests.get(url, headers=headers)
61
+ iframe = BeautifulSoup(response.text, 'lxml')
62
+ #Get the link of iframe
63
+ iframe = iframe.find('iframe').get("src")
64
+ #Get the ID containted in the src of iframe
65
+ vixid = iframe.split("/embed/")[1].split("?")[0]
66
+ #Build the url with 1080p, to get the highest resolution
67
+ url = f'https://vixcloud.co/playlist/{vixid}'
68
+ return url
69
+
70
+ def get_season_episode_id(tid,slug,season,episode,version):
71
+ #Set some basic headers for the request
72
+ headers = {
73
+ 'user-agent': "Mozilla/5.0 (Windows NT 10.10; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3",
74
+ 'x-inertia': 'true',
75
+ #Version of streaming community
76
+ 'x-inertia-version': version
77
+ }
78
+ #Get episode ID
79
+ response = requests.get(f'https://streamingcommunity.{SC_DOMAIN}/titles/{tid}-{slug}/stagione-{season}', headers=headers)
80
+ # Print the json got
81
+ json_response = response.json().get('props', {}).get('loadedSeason', {}).get('episodes', [])
82
+ for dict_episode in json_response:
83
+ if dict_episode['number'] == episode:
84
+ return dict_episode['id']
85
+
86
+ def get_episode_link(episode_id,tid):
87
+ #The parameters for the request
88
+ params = {
89
+ 'episode_id': episode_id,
90
+ 'next_episode': '1'
91
+ }
92
+ #Let's try to get the link from iframe source
93
+ # Make a request to get iframe source
94
+ response = requests.get(f"https://streamingcommunity.{SC_DOMAIN}/iframe/{tid}", params=params)
95
+
96
+ # Parse response with BeautifulSoup to get iframe source
97
+ soup = BeautifulSoup(response.text, "lxml")
98
+ iframe = soup.find("iframe").get("src")
99
+ vixid = iframe.split("/embed/")[1].split("?")[0]
100
+ url = f"https://vixcloud.co/playlist/{vixid}"
101
+ return url
102
+
103
+
104
+ def streaming_community(imdb):
105
+ try:
106
+ general = is_movie(imdb)
107
+ ismovie = general[0]
108
+ imdb_id = general[1]
109
+ type = "StreamingCommunity"
110
+ if ismovie == 0 :
111
+ season = int(general[2])
112
+ episode = int(general[3])
113
+ #Check if fast search is enabled or disabled
114
+ if SC_FAST_SEARCH == "1":
115
+ if "tt" in imdb:
116
+ #Get showname
117
+ showname = get_info_imdb(imdb_id,ismovie,type)
118
+ n_season = None
119
+ else:
120
+ #I just set n season to None to avoid bugs, but it is not needed if Fast search is enabled
121
+ n_season = None
122
+ #else just equals them
123
+ tmdba = imdb_id.replace("tmdb:","")
124
+ showname = get_info_tmdb(tmdba,ismovie,type)
125
+ elif SC_FAST_SEARCH == "0":
126
+ tmdba = get_TMDb_id_from_IMDb_id(imdb_id)
127
+ showname,n_season = get_info_tmdb(tmdba,ismovie,type)
128
+ #HERE THE CASE IF IT IS A MOVIE
129
+ else:
130
+ if "tt" in imdb:
131
+ #Get showname
132
+ n_season = None
133
+ showname = get_info_imdb(imdb_id,ismovie,type)
134
+ else:
135
+ #I just set n season to None to avoid bugs, but it is not needed if Fast search is enabled
136
+ #else just equals them
137
+ n_season = None
138
+ tmdba = imdb_id.replace("tmdb:","")
139
+ showname = get_info_tmdb(tmdba,ismovie,type)
140
+
141
+ showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
142
+ query = f'https://streamingcommunity.{SC_DOMAIN}/api/search?q={showname}'
143
+ tid,slug = search(query,n_season,ismovie)
144
+ if ismovie == 1:
145
+ #TID means temporaly ID
146
+ url = get_film(tid)
147
+ print(url)
148
+ return url
149
+ if ismovie == 0:
150
+ #Uid = URL ID
151
+ version = get_version()
152
+ episode_id = get_season_episode_id(tid,slug,season,episode,version)
153
+ url = get_episode_link(episode_id,tid)
154
+ print(url)
155
+ return url
156
+ except Exception as e:
157
+ print("Nope It failed")
tantifilm.py ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ from bs4 import BeautifulSoup,SoupStrainer
3
+ import re
4
+ import time
5
+ from info import is_movie,get_info_imdb,get_info_tmdb
6
+ import config
7
+ TF_FAST_SEARCH = config.TF_FAST_SEARCH
8
+ TF_DOMAIN = config.TF_DOMAIN
9
+
10
+
11
+ ##FOR NOW ONLY MOVIES WORK, I HOPE I CAN FIX SERIES
12
+ def search(showname,ismovie,season,episode,date):
13
+ url = f'https://www.tanti.bond/search/{showname}'
14
+ response = requests.get(url)
15
+ soup = BeautifulSoup(response.text, "lxml")
16
+ if ismovie == 1:
17
+ all_link = soup.select('#movies .col .list-media')
18
+ for link in all_link:
19
+ url = link['href']
20
+ response = requests.get(url)
21
+ pattern = r'Data di rilascio\s*</div>\s*<div class="text">\s*(\d{4})\s*</div>'
22
+ found_date = re.search(pattern, response.text)
23
+ release_date = str(found_date.group(1))
24
+ print(release_date)
25
+ if release_date == date:
26
+ tid= url.split('-')[1]
27
+ print(tid)
28
+ #Return URL and even the soup so I can use it later
29
+ #I try to get doodstream link inside this function so I do not have to get again the response
30
+ print(url)
31
+ return tid
32
+ elif ismovie == 0:
33
+ all_link = soup.select('#series .col .list-media')
34
+ for link in all_link:
35
+ base_url = link['href']
36
+ url = f'{base_url}-{season}-season-{episode}-episode'
37
+ response = requests.get(url)
38
+ pattern = r'Data di rilascio\s*</div>\s*<div class="text">\s*(\d{4})\s*</div>'
39
+ found_date = re.search(pattern, response.text)
40
+ release_date = str(found_date.group(1))
41
+ if release_date == date:
42
+ print("RELEASE DATE IS EQUAL")
43
+ tid= url.split('-')[1]
44
+ print(tid)
45
+ #I try to get doodstream link inside this function so I do not have to get again the response
46
+ return tid
47
+
48
+
49
+
50
+ def get_protect_link(id):
51
+ #Get the link where the Iframe is located, which contains the doodstream url kind of.
52
+ response = requests.get(f"https://p.hdplayer.casa/myadmin/play.php?id={id}")
53
+ soup = BeautifulSoup(response.text, "lxml", parse_only=SoupStrainer('iframe'))
54
+ print(soup)
55
+ protect_link = soup.iframe['src']
56
+ print("HERE PROTECT_LINK",protect_link)
57
+ return protect_link
58
+
59
+
60
+
61
+ def true_url(protect_link):
62
+ # Define headers
63
+ headers = {
64
+ "Range": "bytes=0-",
65
+ "Referer": "https://d000d.com/",
66
+ }
67
+ response = requests.get(protect_link)
68
+ link = response.url
69
+ #Get the ID
70
+ doodstream_id = link.rsplit('/e/', 1)[-1]
71
+ # Make a GET request
72
+
73
+ if response.status_code == 200:
74
+ # Get unique timestamp for the request
75
+ real_time = str(int(time.time()))
76
+
77
+ # Regular Expression Pattern for the match
78
+ pattern = r"(\/pass_md5\/.*?)'.*(\?token=.*?expiry=)"
79
+
80
+ # Find the match
81
+ match = re.search(pattern, response.text, re.DOTALL)
82
+
83
+ # If a match was found
84
+ if match:
85
+ # Create real link (match[0] includes all matched elements)
86
+ url =f'https://d000d.com{match[1]}'
87
+ rebobo = requests.get(url, headers=headers)
88
+ real_url = f'{rebobo.text}123456789{match[2]}{real_time}'
89
+ print(real_url)
90
+ return real_url
91
+ else:
92
+ print("No match found in the text.")
93
+ return None
94
+
95
+ print("Error: Could not get the response.")
96
+ return None
97
+
98
+
99
+
100
+
101
+ #Get temporaly ID
102
+ def tantifilm(imdb):
103
+ try:
104
+ general = is_movie(imdb)
105
+ ismovie = general[0]
106
+ imdb_id = general[1]
107
+ type = "Tuttifilm"
108
+ if ismovie == 0 :
109
+ print("Series not supported yet")
110
+ return
111
+ season = int(general[2])
112
+ episode = int(general[3])
113
+ if "tt" in imdb:
114
+ if TF_FAST_SEARCH == "0":
115
+ showname,date = get_info_imdb(imdb_id,ismovie,type)
116
+ elif TF_FAST_SEARCH == "1":
117
+ showname = get_info_imdb(imdb_id,ismovie,type)
118
+ date = None
119
+ else:
120
+ #else just equals them
121
+ tmdba = imdb_id.replace("tmdb:","")
122
+ if TF_FAST_SEARCH == "0":
123
+ showname = get_info_tmdb(tmdba,ismovie,type)
124
+ date = None
125
+ elif ismovie == 1:
126
+ season = None
127
+ episode = None
128
+ if "tt" in imdb:
129
+ #Get showname
130
+ if TF_FAST_SEARCH == "0":
131
+ showname,date = get_info_imdb(imdb_id,ismovie,type)
132
+
133
+ elif TF_FAST_SEARCH == "1":
134
+ showname = get_info_imdb(imdb_id,ismovie,type)
135
+ date = None
136
+ else:
137
+
138
+ #else just equals themtantifilm("tt2096673")
139
+
140
+ if TF_FAST_SEARCH == "0":
141
+ showname,date = get_info_tmdb(imdb,ismovie,type)
142
+ date = None
143
+ elif TF_FAST_SEARCH == "1":
144
+ showname = get_info_tmdb(imdb,ismovie,type)
145
+ date = None
146
+
147
+ tid = search(showname,ismovie,season,episode,date)
148
+ protect_link = get_protect_link(tid)
149
+ url = true_url(protect_link)
150
+ return url
151
+
152
+ except Exception as e:
153
+ print("Tantifilm Error")
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+ #OLD SEARC THAT DOESN't CHECK THE DATE
167
+ def mamma(showname,ismovie,season,episode):
168
+ url = f'https://www.tanti.bond/search/{showname}'
169
+ response = requests.get(url)
170
+ soup = BeautifulSoup(response.text, "lxml")
171
+ if ismovie == 1:
172
+ first_link = soup.select_one('#movies .col .list-media')
173
+ url = first_link['href']
174
+ return url
175
+ elif ismovie == 0:
176
+ first_link = soup.select_one('#series .col .list-media')
177
+ base_url = first_link['href']
178
+ url = f'{base_url}-{season}-{episode}'
179
+ print(url)
180
+ return url
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+ def searcht(showname,ismovie,season,episode):
198
+ url = f'https://www.tanti.bond/search/{showname}'
199
+ response = requests.get(url)
200
+ soup = BeautifulSoup(response.text, "lxml")
201
+ date = "2020"
202
+ if ismovie == 1:
203
+ all_link = soup.select('#movies .col .list-media')
204
+ for link in all_link:
205
+ url = link['href']
206
+ response = requests.get(url)
207
+ info_soup = BeautifulSoup(response.text, "lxml")
208
+ release_date= info_soup.select('div.video-attr div.text')[4].text.strip()
209
+ if release_date == date:
210
+ print("WOW")
211
+ #Return URL and even the soup so I can use it later
212
+ return url,info_soup
213
+ elif ismovie == 0:
214
+ all_link = soup.select('#series .col .list-media')
215
+ for link in all_link:
216
+ base_url = link['href']
217
+ url = f'{base_url}-{season}-season-{episode}-episode'
218
+ response = requests.get(url)
219
+ info_soup = BeautifulSoup(response.text, "lxml")
220
+ release_date= info_soup.select('div.video-attr div.text')[4].text.strip()
221
+ if release_date == date:
222
+ print("RELEASE DATE IS EQUAL")
223
+ #Return URL and even the soup so I can use it later
224
+ return url,info_soup