diff --git a/.gitignore b/.gitignore
index 8d8c6ff..a1b9cbb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,2 @@
.env
-__pycache__/
-cool.py
\ No newline at end of file
+__pycache__/
\ No newline at end of file
diff --git a/README.md b/README.md
index e3e811d..b62483d 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,4 @@
+
@@ -10,7 +11,10 @@
+
+
A Stremio Addon for high quality HTTPS Streams in Italian
+
Movies, Series, Anime and Live TV are supported.
@@ -19,7 +23,11 @@ Movies, Series, Anime and Live TV are supported.
-While hosting, this project, remember that Filmpertutti uses Mixdrop. Mixdrop only allows seeing the videos from the same IP where they were generated so, if you want to scrape filmpertutti, you will have to host this project locally. Else, you can only scrape other providers.
+
+
+While hosting, this project, remember that Filmpertutti uses Mixdrop. Mixdrop only allows seeing the videos from the same IP where they were generated so, if you want to scrape filmpertutti, you will have to host this project locally. Else, you can only scrape other providers.
+
+
@@ -33,19 +41,27 @@ Hosting your own instance is suggested, but you can use the public instance [lin
+
+
# Installation
+
+
## Local
-Install required packages
+
+
+1. Install required packages
+
+
@@ -53,18 +69,24 @@ Install required packages
``pip install -r requirements.txt ``
-
-
+ 2. Create a .env file and fill it (look at example.env)
-Then to start the Flask server just execute:
+
+
+3. Then to start the Fast API app server just execute:
+
+
+
``python3 run.py``
-Remember to create a .env file with your TMDB Key.
+
+
+
## Hugging Face
@@ -73,7 +95,9 @@ Remember to create a .env file with your TMDB Key.
-To host this project with Hugging Face, go to the [linked](https://huggingface.co/spaces/MammaMia-Urlo/MammaMia/) page and follow these steps
+
+
+To host this project with Hugging Face, go to the [linked](https://huggingface.co/spaces/MammaMia-Urlo/CloneThisSpace/) page and follow these steps:
@@ -81,13 +105,19 @@ To host this project with Hugging Face, go to the [linked](https://huggingface.c
-1. Create an Hugging Face Account
+
+
+1. Create an Hugging Face Account [here](https://huggingface.co/join)
-2. Click on three dots on the top (right) part of the screen
+
+
+2. Go to [linked](https://huggingface.co/spaces/MammaMia-Urlo/CloneThisSpace) page and click on three dots on the top (right) part of the screen
+
+
@@ -99,7 +129,11 @@ To host this project with Hugging Face, go to the [linked](https://huggingface.c
-4. Insert TMDB Key
+
+
+4. Insert TMDB Key and set visibility to Public
+
+
@@ -111,26 +145,38 @@ To host this project with Hugging Face, go to the [linked](https://huggingface.c
+
+
6. You are done!
-7. To install it on Stremio altought, you will need the Direct URL. It can be found on three dots --> Embed This Space --> Direct URL
+
+
+7. To install it on Stremio altought, you will need the Direct URL. It can be found on three dots --> Embed This Space --> Direct URL
+ If you do not find it it means your space is Private. To fix so go to Settings and click Set Visibility to Public.
-8. Do not forget to add /manifest.json
+
+
+8. How do I handle updates? To update the addon you will have to Factory Rebuild your space (in Settings) and, if there are any changes to config.json, copy them from [here](https://github.com/UrloMythus/MammaMia/blob/main/config.json) to the config.json in your Space, under Files.
+
+
+9. How can I use Live TV? For now you can't except on public Instance. Wait until next update.
- 9. The Addon will update everytime you restart the service but you will need to change the config.json manually each time if there are any changes.
-If you just want to syncronize with the public instance then there is a button in the settings to do so.
-On Hugging Face you are forced to use the 8080 port because it is the only one allowed to send/get network requests. Moreover, remember that load_env needs to be disabled (it should be by default if you clone the project from HF)
+
+Technical Details:
+On Hugging Face you are forced to use the 8080 port because it is the only one allowed to send/get network requests. Moreover, remember that load_env and Public Instance need to be disabled in the config.json (it should be by default if you clone the project from HF)
+
+
@@ -142,31 +188,43 @@ On Hugging Face you are forced to use the 8080 port because it is the only one a
+
+
To install this project on [Render](https://render.com/) follow these steps:
+
+
1. Create an Account
+
+
2. Create a Web Service
+
+
3. Fork the repo and then connect it to Render
-4. Among the other environment variables, put PORT = 8080. This is needed because render needs the Port given as an environment variable.
+
+
+4. Among the other environment variables, put PORT = 8080. This is needed because Render needs the Port given as an environment variable. Remember to put TMDB_KEY as an enviroment variable.
+
+
@@ -178,11 +236,17 @@ To install this project on [Render](https://render.com/) follow these steps:
+
+
6. Then just finish Render Setup and you are done :)
-Remember, load_env needs to be disabled in the config.json
+
+
+Remember, load_env and Public Instance needs to be disabled in the config.json
+
+
@@ -198,7 +262,11 @@ Remember, load_env needs to be disabled in the config.json
-Just paste the URL/manifest.json in your search bar.
+
+
+Open your instance URL and configure MammaMia. Once you are done you can click on INSTALL Button. If it doesn't work click on Generate Manifest and copy it. Then paste it in Stremio Search Bar. If you are on Mac or on Web go to addons, click Add an Addon, and paste it there.
+
+
@@ -212,50 +280,98 @@ Just paste the URL/manifest.json in your search bar.
+
+
| Enviroment Variable | Value |
+
|-------------------------|---|
+
|TMDB_KEY|INSERT YOUR API KEY HERE|
+
+
Here is [linked](https://developer.themoviedb.org/docs/getting-started) a tutorial about how to get a TMDB KEY
+
+
# Config
+
+
In the repo there is a config.json that you can modify to change some aspects of the addon like the domains of the sites. Down here all explained:
-| Config | Value |
-|-------------------------|---|
-| Domain | The domain of the site, must be a string |
-|enabled | If the site is enabled or not. "1" means true. "0" means false. Remember, there is no point in enabling filmpertutti on a remote server since it's IP-LOCKED|
-|fast_search|"1" for enabled, "0" for disabled. It enables a faster search for supported Providers but in case there are two movies/series with the exactly same name then they might take the wrong one|
-|load_env|Put "1" if enabled, "0" if disabled. It needs to be enabled if you need to load a .env file. On remote hosting services, like Hugging Face or Render, it needs to be disabled. |
-|HOST| The host for the Flask APP|
-|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.
- For now Tantifilm, even if it's player is not IP-Locked, does not work on Hugging Face.
+| Config | Value |
+
+|-------------------------|---|
+
+| Domain | The domain of the site, must be a string |
+
+|enabled | If the site is enabled or not. "1" means true. "0" means false. Remember, there is no point in enabling filmpertutti on a remote server since it's IP-LOCKED|
+
+|fast_search|"1" for enabled, "0" for disabled. It enables a faster search for supported providers but it is less accurate|
+
+|load_env|Put "1" if enabled, "0" if disabled. It needs to be enabled if you need to load a .env file. On remote hosting services, like Hugging Face or Render, it needs to be disabled. |
+
+|HOST| The host for the Fast API APP|
+
+|PORT| The port for the Fast API APP. Default: 8080 |
+
+
+
+For now Mysterius must be kept disabled if you do not know what you are doing.
+
+For now Tantifilm, even if its player is not IP-Locked, does not work on Hugging Face.
+
+
Check those links to get the new Domain for the providers.
+
+
[FILMPERTUTTI](https://filmpertuttiiii.nuovo.live/)
+
+
[STREAMINGCOMMUNITY](https://t.me/+jlXmmprhtakxYWJh)
+
+
[TANTIFILM](https://tantinuovo.com/tantifilm-nuovo-indirizzo/)
+
+
[STREAMINGWATCH](https://t.me/streamingwatch)
+
+
[LORDCHANNEL](https://t.me/+5MQwrb3eqb81NGI0)
+
+
[ANIMEWORLD](https://t.me/AnimeWorldITA2)
+
+
+## Credits
+
+ - Big thanks to [Lovi0](https://github.com/Lovi-0), the creator of StreamingCommunity downloader, for helping me with some aspects of this project.
+ - This project uses [MediaFlowProxy](https://github.com/mhdzumair/mediaflow-proxy/) in order to be able to play some Live TV channels. Big thanks to his creator, [mhdzumair](https://github.com/mhdzumair)
+
+## Disclaimer
+This project does not host any illegal content on his servers, if you want any content to be taken down, please contact the actual owners of those sites.
+
+
+
diff --git a/animeworld.py b/Src/API/animeworld.py
similarity index 86%
rename from animeworld.py
rename to Src/API/animeworld.py
index c3ecf49..6b294c4 100644
--- a/animeworld.py
+++ b/Src/API/animeworld.py
@@ -1,12 +1,11 @@
-import httpx
-import asyncio
from bs4 import BeautifulSoup
import datetime
import json
-from info import get_info_kitsu
-import config
+from Src.Utilities.info import get_info_kitsu
+import Src.Utilities.config as config
import re
+AW_DOMAIN = config.AW_DOMAIN
months = {
"Gennaio": "January", "Febbraio": "February", "Marzo": "March",
"Aprile": "April", "Maggio": "May", "Giugno": "June",
@@ -21,15 +20,14 @@ showname_replace = {
" ": "+",
}
-AW_DOMAIN = config.AW_DOMAIN
async def get_mp4(anime_url,ismovie,episode,client):
- response = await client.get(anime_url,follow_redirects=True)
+ response = await client.get(anime_url,allow_redirects=True, impersonate = "chrome120")
soup = BeautifulSoup(response.text,'lxml')
episode_page = soup.find('a', {'data-episode-num':episode })
if episode_page is None:
return None
episode_page = f'https://animeworld.{AW_DOMAIN}{episode_page["href"]}'
- response = await client.get(episode_page,follow_redirects=True)
+ response = await client.get(episode_page,allow_redirects=True, impersonate = "chrome120")
soup = BeautifulSoup(response.text,'lxml')
a_tag = soup.find('a', {'id': 'alternativeDownloadLink', 'class': 'm-1 btn btn-sm btn-primary'})
url = a_tag['href']
@@ -72,7 +70,7 @@ async def old_search(showname,date,ismovie,episode,client):
'keyword': showname,
}
- response = await client.post(f'https://www.animeworld.{AW_DOMAIN}/api/search/v2', params=params, cookies=cookies, headers=headers,follow_redirects=True)
+ response = await client.post(f'https://www.animeworld.{AW_DOMAIN}/api/search/v2', params=params, cookies=cookies, headers=headers,allow_redirects=True, impersonate = "chrome120")
data = json.loads(response.text)
final_urls = []
@@ -93,7 +91,7 @@ async def old_search(showname,date,ismovie,episode,client):
params = {
'keyword': showname,
}
- response = await client.post(f'https://www.animeworld.{AW_DOMAIN}/api/search/v2', params=params, cookies=cookies, headers=headers, follow_redirects=True)
+ response = await client.post(f'https://www.animeworld.{AW_DOMAIN}/api/search/v2', params=params, cookies=cookies, headers=headers, allow_redirects=True, impersonate = "chrome120")
data = json.loads(response.text)
for anime in data["animes"]:
release_date = anime["release"]
@@ -112,13 +110,13 @@ async def old_search(showname,date,ismovie,episode,client):
async def search(showname,date,ismovie,episode,client):
search_year = date[:4]
- response = await client.get(f'https://www.animeworld.so/filter?year={search_year}&sort=2&keyword={showname}',follow_redirects=True)
+ response = await client.get(f'https://www.animeworld.so/filter?year={search_year}&sort=2&keyword={showname}',allow_redirects=True, impersonate = "chrome120")
soup = BeautifulSoup(response.text,'lxml')
anime_list = soup.find_all('a', class_=['poster', 'tooltipstered'])
final_urls = []
for anime in anime_list:
anime_info_url = f'https://www.animeworld.{AW_DOMAIN}/{anime["data-tip"]}'
- response = await client.get(anime_info_url,follow_redirects=True)
+ response = await client.get(anime_info_url,allow_redirects=True, impersonate = "chrome120")
pattern = r'\s*\s*(.*?)\s*'
match = re.search(pattern, response.text, re.S)
release_date = match.group(1).strip()
@@ -126,7 +124,6 @@ async def search(showname,date,ismovie,episode,client):
release_date = release_date.replace(ita, eng)
release_date = datetime.datetime.strptime(release_date, "%d %B %Y")
release_date = release_date.strftime("%Y-%m-%d")
- print(release_date)
if release_date == date:
anime_url = f'https://www.animeworld.{AW_DOMAIN}{anime["href"]}'
final_url = await get_mp4(anime_url,ismovie,episode,client)
@@ -153,14 +150,14 @@ async def animeworld(id,client):
print("Animeworld failed")
return None
-# async def test_animeworld():
- # async with httpx.AsyncClient() as client:
- # # Replace with actual id, for example 'anime_id:episode' format
- # test_id = "kitsu:1555:1" # This is an example ID format
- # results = await animeworld(test_id, client)
- # print(results)
+#async def test_animeworld():
+ async with httpx.AsyncClient() as client:
+ # Replace with actual id, for example 'anime_id:episode' format
+ test_id = "kitsu:1555:1" # This is an example ID format
+ results = await animeworld(test_id, client)
+ print(results)
#if __name__ == "__main__":
- # import httpx
- # import asyncio
- # asyncio.run(test_animeworld())
\ No newline at end of file
+ import httpx
+ import asyncio
+ asyncio.run(test_animeworld())
\ No newline at end of file
diff --git a/cool.py b/Src/API/cool.py
similarity index 94%
rename from cool.py
rename to Src/API/cool.py
index c760370..82d62e4 100644
--- a/cool.py
+++ b/Src/API/cool.py
@@ -1,8 +1,7 @@
-import requests
import json
-from info import get_info_tmdb,is_movie
-from convert import get_TMDb_id_from_IMDb_id
-from loadenv import load_env
+from Src.Utilities.info import get_info_tmdb,is_movie
+from Src.Utilities.convert import get_TMDb_id_from_IMDb_id
+from Src.Utilities.loadenv import load_env
env_vars = load_env()
MYSTERIUS_KEY = env_vars.get('MYSTERIUS_KEY')
async def get_links(slug,season,episode,ismovie,client):
@@ -64,7 +63,7 @@ async def get_links(slug,season,episode,ismovie,client):
print(f"JSONDecodeError: {e}")
return None
- except requests.RequestException as e:
+ except client.RequestException as e:
print(f"Request error: {e}")
return None
@@ -81,7 +80,7 @@ async def get_links(slug,season,episode,ismovie,client):
async def search_imdb(showname,tmdba,client):
tmdba = str(tmdba)
query = f'https://altadefinizione-originale.com/api/search?search={showname}&page=1'
- response = await client.get(query,follow_redirects=True)
+ response = await client.get(query,allow_redirects=True, impersonate = "chrome120")
if response.status_code == 200:
data = response.json()
if 'data' in data:
diff --git a/Src/API/epg.py b/Src/API/epg.py
new file mode 100644
index 0000000..c17fb20
--- /dev/null
+++ b/Src/API/epg.py
@@ -0,0 +1,227 @@
+from bs4 import BeautifulSoup
+import httpx
+
+tivu = {
+ "dazn-zona-a": "801",
+}
+"""
+ "rai-1": "3401",
+ "rai-2": "3402",
+ "rai-3": "3403",
+ "rete-4": "123",
+ "canale-5": "122",
+ "italia-1": "121",
+ "la7": "79",
+ "tv8": "7260",
+ "nove": "4323",
+ "rai-4": "3405",
+ "rai-movie": "3406",
+ "rai-premium": "8522",
+ "mediaset-extra": "129",
+ "cielo": "4120",
+ "rai-sport": "17714",
+ "rai-news": "17711",
+ "dmax": "15202",
+ "real-time": "15201",
+ "focus": "134",
+ "giallo": "4322",
+ "topcrime": "132",
+ "boing": "126",
+ "cartoonito": "133",
+ "k2": "15204",
+ "foodnetwork": "15203",
+ "hgtv": "4334",
+ "solocalcio": "4996" ,
+ "euronews": "2017",
+ "rai-4k": "3407",
+"""
+convert_bho_1 = {
+ "euronews": "PlutoEuronews.it",
+ "cartoonito": "cartoonito",
+ "sky-tg-24": "skytg24",
+ "frisbee": "frisbee",
+ "hgtv": "hgtv",
+ "k2": "k2",
+ "supertennis": "supertennis",
+ "solocalcio": "sportitaliasolocalcio",
+ "sportitalia": "sportitalia",
+ "sportitalia24": "RakutenSportItalia.it",
+ "rsi-la-2": "rsila2",
+ "baby-shark-tv": "RakutenBabySharkTv.it",
+ "adrenaline-movies": "RakutenFullMoon.it",
+ "adrenaline-movies": "RakutenBizzarroMovies.it",
+ "cinema-italiano": "RakutenCinemaItalianoRakutenTv.it",
+ "le-vite-degli-altri": "RakutenLeViteDegliAltri.it",
+ "dark-matter": "RakutenDarkMatterItNew.it",
+ "cine-western": "RakutenWesternEPeplum.it",
+ "serie-crime": "RakutenCrimeSeriesItRakutenTv.it",
+ "filmrise-sci-fi": "RakutenFuelTvNew.it",
+ "doctor-who": "RakutenBbcDoctorWho.it",
+ "bbc-drama": "RakutenBbcDrama.it",
+ "documentari": "RakutenDocumentaries.it",
+ "house-of-docs": "RakutenHouseOfDocs.it",
+ "the-asylum": "PlutoTheAsylum.it",
+ "western": "PlutoTvWestern.it",
+ "consulenze-illegali": "PlutoConsulenzeIllegaliItPlus.it"
+
+}
+
+
+convert_bho_2 = {
+ "rai-1": "Rai%201",
+ "rai-2": "Rai 2",
+ "rai-3": "Rai 3",
+ "rai-4": "Rai 4",
+ "rai-premium": "Rai Premium",
+ "rai-movie": "Rai Movie",
+ "rai-sport": "Rai Sport",
+ "rete-4": "Rete 4",
+ "canale-5": "Canale 5",
+ "italia-1": "Italia 1",
+ "topcrime": "Top Crime",
+ "mediaset-extra": "Mediaset Extra",
+ "focus": "Focus",
+ "boing": "Boing",
+ "history": "History",
+ "comedy-central": "Comedy Central",
+ "tv8": "TV 8",
+ "cielo": "Cielo",
+ "sky-cinema-action": "Sky Cinema Action",
+ "sky-arte": "Sky Arte FHD",
+ "sky-atlantic": "Sky Atlantic",
+ "sky-cinema-collection": "Sky Cinema Collection",
+ "sky-cinema-comedy": "Sky Cinema Comedy",
+ "sky-cinema-drama": "Sky Cinema Drama",
+ "sky-cinema-due": "Sky Cinema Due",
+ "sky-cinema-family": "Sky Cinema Family",
+ "sky-cinema-romance": "Sky Cinema Romance",
+ "sky-cinema-suspence": "Sky Cinema Suspence",
+ "sky-cinema-uno": "Sky Cinema Uno",
+ "sky-uno": "Sky Uno",
+ "sky-sport-24": "Sky Sport",
+ "sky-sport-uno": "Sky Sport Uno",
+ "sky-sport-f1": "Sky Sport F1",
+ "sky-sport-motogp": "Sky Sport MotoGP",
+ "sky-sport-arena": "Sky Sport Arena",
+ "sky-sport-nba": "Sky Sport NBA",
+ "eurosport-1": "Eurosport 1",
+ "eurosport-2": "Eurosport 2",
+ "dmax": "Dmax",
+ "foodnetwork": "Food Network",
+ "giallo": "Giallo",
+ "nove": "Nove",
+ "realtime": "Real Time",
+}
+convert_bho_3 = {
+ "la7": "La7",
+ "rai-news": "Rai News DTT",
+ "sky-crime": "Sky CrimeInvestigation",
+ "sky-documentaries": "Sky Documentaries HD",
+ "sky-investigation": "Sky Investigation HD",
+ "sky-nature": "Sky Nature HD",
+ "sky-serie": "Sky Serie HD",
+ "sky-sport-golf": "Sky Sport Golf",
+ "sky-sport-251": "Sky Sport 251 HD",
+ "sky-sport-252": "Sky Sport 252 HD",
+ "sky-sport-253": "Sky Sport 253 HD",
+ "sky-sport-254": "Sky Sport 254 HD",
+ "sky-sport-255": "Sky Sport 255 HD",
+ "sky-sport-256": "Sky Sport 256 HD",
+ "sky-sport-257": "Sky Sport 257 HD",
+ "sky-sport-258": "Sky Sport 258 HD",
+ "sky-sport-259": "Sky Sport 259 HD",
+ "sky-sport-260": "Sky Sport 260 HD",
+ "sky-sport-261": "Sky Sport 261 HD",
+ "sky-sport-max": "Sky Sport Max",
+ "sky-sport-calcio": "Sky Sport Calcio HD",
+ "sky-sport-tennis": "Sky Sport Tennis HD",
+}
+
+
+async def tivu_get(id,client):
+ try:
+ cookies = {
+ 'ASP.NET_SessionId': 'p2fk5silp5mjgtx0j5chjrh3',
+ }
+ ik = tivu[id]
+ headers = {
+ 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0',
+ 'Accept': '*/*',
+ 'Accept-Language': 'en-US,en;q=0.5',
+ # 'Accept-Encoding': 'gzip, deflate, br, zstd',
+ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
+ 'X-Requested-With': 'XMLHttpRequest',
+ 'Origin': 'https://www.tivu.tv',
+ 'DNT': '1',
+ 'Sec-GPC': '1',
+ 'Connection': 'keep-alive',
+ 'Referer': 'https://www.tivu.tv/schedasat-rai1.html',
+ # 'Cookie': 'ASP.NET_SessionId=p2fk5silp5mjgtx0j5chjrh3',
+ 'Sec-Fetch-Dest': 'empty',
+ 'Sec-Fetch-Mode': 'cors',
+ 'Sec-Fetch-Site': 'same-origin',
+ 'Pragma': 'no-cache',
+ 'Cache-Control': 'no-cache',
+ }
+
+ data = {
+ 'ik': ik
+ }
+ response = await client.post('https://www.tivu.tv/getPrograms.ashx', cookies=cookies, headers=headers, data=data)
+ soup = BeautifulSoup(response.text,'lxml')
+ tr_element = soup.find('tr', class_='in_onda')
+ hour_range = tr_element.find_all('td')[0].text.strip()
+ program_name = tr_element.find_all('td')[1].text.strip()
+ description = hour_range + " " + program_name
+ return description
+ except Exception as e:
+ print(e)
+ description = f'Watch {id}'
+ return description
+
+
+
+async def epg_guide(id,client):
+ import httpx
+ try:
+ if id in convert_bho_1:
+ new_id = convert_bho_1[id]
+ new_id = new_id.replace(" ","%20")
+ response = await client.get(f"https://lorempizza-boh.hf.space/{new_id}/now")
+ elif id in convert_bho_2:
+ new_id = convert_bho_2[id]
+ new_id = new_id.replace(" ","%20")
+ response = await client.get(f"https://mammamia-urlo-boh2.hf.space/{new_id}/now")
+ elif id in convert_bho_3:
+ new_id = convert_bho_3[id]
+ new_id = new_id.replace(" ","%20")
+ response = await client.get(f"https://mammamia-urlo-boh3.hf.space/{new_id}/now")
+ data = response.json()
+ description = data['description'].replace("- EPG by epg-guide.com","").replace("No description","")
+ title = data['title']
+ print("MammaMia: EPG FOUND")
+ return description,title
+ except Exception as e:
+ print(e)
+ description = f'Watch {id}'
+ title = ""
+ return description,title
+
+
+
+
+#async def test_animeworld():
+ async with httpx.AsyncClient() as client:
+ test_id = "rai-news" # Replace with actual ID
+ try:
+ results = await epg_guide(test_id, client)
+ print(results)
+ except httpx.HTTPStatusError as e:
+ print(f"HTTP error occurred: {e}")
+ except Exception as e:
+ print(f"An error occurred: {e}")
+
+#if __name__ == "__main__":
+ import httpx
+ import asyncio
+ asyncio.run(test_animeworld())
diff --git a/filmpertutti.py b/Src/API/filmpertutti.py
similarity index 56%
rename from filmpertutti.py
rename to Src/API/filmpertutti.py
index 65e0e44..f166c34 100644
--- a/filmpertutti.py
+++ b/Src/API/filmpertutti.py
@@ -1,19 +1,15 @@
from tmdbv3api import TMDb, Movie, TV
-import requests
from bs4 import BeautifulSoup,SoupStrainer
import string
import re
-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
-from convert_date import convert_US_date
-import logging
-import config
-
+from Src.Utilities.convert import get_TMDb_id_from_IMDb_id
+from Src.Utilities.info import get_info_tmdb, is_movie, get_info_imdb
+from Src.Utilities.convert_date import convert_US_date
+import Src.Utilities.config as config
FT_DOMAIN = config.FT_DOMAIN
-
+WOA = 0
#Some basic headers
headers = {
'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',
@@ -26,33 +22,49 @@ month_mapping = {
'Sep': 'Settembre', 'Oct': 'Ottobre', 'Nov': 'Novembre', 'Dec': 'Dicembre'
}
-async def search(query,date,client):
- response = await client.get(query).json()
+async def search(query,date,client,season,ismovie):
+ response = await client.get(query)
+ response = response.json()
#Get link tid of every item and then open the link to see if the date = date
for json in response:
link = json['link']
tid = json['id']
- series_response = await client.get(link, headers=headers, follow_redirects=True)
+ series_response = await client.get(link, headers=headers, allow_redirects=True, timeout = 30)
series_soup = BeautifulSoup(series_response.text, 'lxml')
release_span = series_soup.find('span', class_='released')
if release_span:
if release_span.text != "Data di uscita: N/A":
date_string = release_span.text.split(': ')[-1] # Get the date part
- for eng, ita in month_mapping.items():
- date_string = re.sub(rf'\b{eng}\b', ita, date_string)
+ release_date = date_string[-4:]
+ if WOA:
+ for eng, ita in month_mapping.items():
+ date_string = re.sub(rf'\b{eng}\b', ita, date_string)
# Swap to YY-MM-DD formatting using dateparser
- release_date = dateparser.parse(date_string, languages=['it']).strftime("%Y-%m-%d")
+ release_date = dateparser.parse(date_string, languages=['it']).strftime("%Y-%m-%d")
if release_date == date:
url = link
tid = tid
- return url, tid
+ if ismovie == 0:
+ Seasons = series_soup.find_all('span', class_="season-name")
+ i = 0
+ for item in Seasons:
+ season_text = item.text.strip()
+ if season in season_text and "SUB" not in season_text:
+ actual_season = i
+ return url, tid, actual_season
+ else:
+ i = i + 1
+ continue
+ else:
+ actual_season = None
+ return url, tid, actual_season
else:
- print("Date are not equals")
+ print("")
-def get_episode_link(season,episode,tid,url):
+def get_episode_link(actual_season,episode,tid,url):
#Get the link from where we have to obtain mixdrop link
- tlink = f'{url}?show_video=true&post_id={tid}&season_id={season-1}&episode_id={episode-1}'
+ tlink = f'{url}?show_video=true&post_id={tid}&season_id={actual_season}&episode_id={episode-1}'
return tlink
@@ -63,12 +75,11 @@ def get_film(url):
async def get_real_link(tlink,client):
#Some basic code to get the mixdrop link
- page = await client.get(tlink, headers=headers, follow_redirects=True)
- soup = BeautifulSoup(page.content(), features="lxml",parse_only=SoupStrainer('iframe'))
+ page = await client.get(tlink, headers=headers, allow_redirects=True)
+ soup = BeautifulSoup(page.content, features="lxml",parse_only=SoupStrainer('iframe'))
iframe_src = soup.find('iframe')['src']
-
- iframe_page = await client.get(iframe_src, headers=headers, follow_redirects=True)
- iframe_soup = BeautifulSoup(iframe_page.content(), features="lxml")
+ iframe_page = await client.get(iframe_src, headers=headers, allow_redirects=True, timeout = 30)
+ iframe_soup = BeautifulSoup(iframe_page.content, features="lxml")
mega_button = iframe_soup.find('div', attrs={'class': 'megaButton', 'rel': 'nofollow'}, string='MIXDROP')
if mega_button:
@@ -76,7 +87,7 @@ async def get_real_link(tlink,client):
return real_link
async def get_true_link(real_link,client):
- response = await client.get(real_link, headers=headers, follow_redirects=True)
+ response = await client.get(real_link, headers=headers, allow_redirects=True,timeout = 30)
[s1, s2] = re.search(r"\}\('(.+)',.+,'(.+)'\.split", response.text).group(1, 2)
schema = s1.split(";")[2][5:-1]
terms = s2.split("|")
@@ -95,7 +106,7 @@ async def filmpertutti(imdb,client):
imdb_id = general[1]
type = "Filmpertutti"
if ismovie == 0 :
- season = int(general[2])
+ season = general[2]
episode = int(general[3])
if "tt" in imdb:
if ismovie == 0:
@@ -103,8 +114,8 @@ async def filmpertutti(imdb,client):
showname,date = await get_info_imdb(imdb_id,ismovie,type,client)
else:
#THIS IS needed cause the only way to get all releases dates is by giving a tmdb ID not a IMDB
- tmdba = await get_TMDb_id_from_IMDb_id(imdb_id,client)
- showname,date = get_info_tmdb(tmdba,ismovie,type)
+ showname,date = await get_info_imdb(imdb_id,ismovie,type, client)
+ season = None
elif "tmdb" in imdb:
#Get showname and date
@@ -114,17 +125,16 @@ async def filmpertutti(imdb,client):
#Build the query
query = f'https://filmpertutti.{FT_DOMAIN}/wp-json/wp/v2/posts?search={showname}&page=1&_fields=link,id'
try:
- url,tid = await search(query,date,client)
+ url,tid,actual_season = await search(query,date,client,season,ismovie)
except:
- print("No results found")
+ print("MammaMia: No results found for Filmpertutti")
return None
if ismovie == 0:
- episode_link = get_episode_link(season,episode,tid,url)
+ episode_link = get_episode_link(actual_season,episode,tid,url)
#Let's get mixdrop link
real_link = await get_real_link(episode_link,client)
#let's get delivery link, streaming link
streaming_link = await get_true_link(real_link,client)
- print(streaming_link)
return streaming_link
elif ismovie == 1:
film_link = get_film(url)
@@ -132,5 +142,39 @@ async def filmpertutti(imdb,client):
real_link = await get_real_link(film_link,client)
#let's get delivery link, streaming link
streaming_link = await get_true_link(real_link,client)
- print(streaming_link)
- return streaming_link
\ No newline at end of file
+ return streaming_link
+
+
+'''
+async def test_animeworld():
+ from curl_cffi.requests import AsyncSession
+ async with AsyncSession() as client:
+ # Replace with actual id, for example 'anime_id:episode' format
+ test_id = "tt4655480:1:1" # This is an example ID format
+ results = await filmpertutti(test_id, client)
+
+if __name__ == "__main__":
+ import asyncio
+ asyncio.run(test_animeworld())
+'''
+
+
+
+
+
+
+
+
+'''
+ series_response = await client.get(link, headers=headers, follow_redirects=True)
+ series_soup = BeautifulSoup(series_response.text, 'lxml')
+ release_span = series_soup.find('span', class_='released')
+ if release_span:
+ if release_span.text != "Data di uscita: N/A":
+ date_string = release_span.text.split(': ')[-1] # Get the date part
+ for eng, ita in month_mapping.items():
+ date_string = re.sub(rf'\b{eng}\b', ita, date_string)
+
+ # Swap to YY-MM-DD formatting using dateparser
+ release_date = dateparser.parse(date_string, languages=['it']).strftime("%Y-%m-%d")
+'''
\ No newline at end of file
diff --git a/lordchannel.py b/Src/API/lordchannel.py
similarity index 84%
rename from lordchannel.py
rename to Src/API/lordchannel.py
index 5db3231..6421c9c 100644
--- a/lordchannel.py
+++ b/Src/API/lordchannel.py
@@ -1,12 +1,8 @@
from tmdbv3api import TMDb, Movie, TV
-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
+from Src.Utilities.convert import get_TMDb_id_from_IMDb_id
+from Src.Utilities.info import get_info_tmdb, is_movie, get_info_imdb
+import Src.Utilities.config as config
import re
import json
LC_DOMAIN = config.LC_DOMAIN
@@ -36,14 +32,14 @@ async def search(showname,date,season,episode,ismovie,client):
'_': '1724421723999',
}
- response = await client.get(f'https://lordchannel.{LC_DOMAIN}/live_search/', params=params, cookies=cookies, headers=headers, follow_redirects=True)
+ response = await client.get(f'https://lordchannel.{LC_DOMAIN}/live_search/', params=params, cookies=cookies, headers=headers, allow_redirects=True, impersonate = "chrome120")
data = json.loads(response.text)
for entry in data['data']:
if entry is not None: # check if the a_tag exists
href = entry['url']
quality = entry['qualit\u00e0_video']
link = f'https://lordchannel.{LC_DOMAIN}{href}'
- response = await client.get(link, follow_redirects=True)
+ response = await client.get(link, allow_redirects=True, impersonate = "chrome120")
soup2 = BeautifulSoup(response.text,'lxml')
li_tag = soup2.select_one("ul.card__meta li:nth-of-type(2)")
if li_tag is not None: # check if the li_tag exists
@@ -60,11 +56,11 @@ async def search(showname,date,season,episode,ismovie,client):
video_url = episode.find('a').get('href')
return video_url,quality
else:
- print("Sadly date are not equals")
+ print("")
continue
async def get_m3u8(video_url,client):
- response = await client.get(video_url, follow_redirects=True)
+ response = await client.get(video_url, allow_redirects=True, impersonate = "chrome120")
pattern = r'const\s+videoData\s*=\s*\[(.*?)\];'
match = re.search(pattern, response.text)
if match:
@@ -96,20 +92,20 @@ async def lordchannel(imdb,client):
video_url,quality = await search(showname,date,season,episode,ismovie,client)
url = await get_m3u8(video_url,client)
url = url.replace('"','')
- print(url)
+ print("MammaMia: Found results for LordChannel")
return url,quality
except:
- print("Lordchannel Failed")
+ print("MammaMia: Lordchannel Failed")
return None,None
-async def test_animeworld():
+#async def test_animeworld():
async with httpx.AsyncClient() as client:
- results = await lordchannel("tt16288804:1:1",client)
- # print(results)
+ results = await lordchannel("tt6468322:1:1",client)
+ print(results)
-if __name__ == "__main__":
+#if __name__ == "__main__":
import httpx
import asyncio
asyncio.run(test_animeworld())
\ No newline at end of file
diff --git a/okru.py b/Src/API/okru.py
similarity index 70%
rename from okru.py
rename to Src/API/okru.py
index 8969029..fb348b1 100644
--- a/okru.py
+++ b/Src/API/okru.py
@@ -1,19 +1,18 @@
-import requests
from bs4 import BeautifulSoup
import json
-from dictionaries import okru
+from Src.Utilities.dictionaries import okru
async def okru_get_url(id,client):
embed_link = okru[id]
print(embed_link)
- response = await client.get(embed_link, follow_redirects=True)
+ response = await client.get(embed_link, allow_redirects=True, impersonate = "chrome120")
soup = BeautifulSoup(response.text, 'lxml')
div = soup.find('div', {'data-module': 'OKVideo'})
data_options = div.get('data-options')
data = json.loads(data_options)
metadata = json.loads(data['flashvars']['metadata'])
m3u8_link = metadata['hlsMasterPlaylistUrl']
- print(m3u8_link)
+ print("MammaMia: Found results for Okru")
return m3u8_link
diff --git a/streamingcommunity.py b/Src/API/streamingcommunity.py
similarity index 50%
rename from streamingcommunity.py
rename to Src/API/streamingcommunity.py
index eb2b95a..0dd379f 100644
--- a/streamingcommunity.py
+++ b/Src/API/streamingcommunity.py
@@ -1,46 +1,49 @@
-from tmdbv3api import TMDb, Movie, TV
-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
+from bs4 import BeautifulSoup
+from Src.Utilities.convert import get_TMDb_id_from_IMDb_id
+from Src.Utilities.info import get_info_tmdb, is_movie, get_info_imdb
+import Src.Utilities.config as config
import json
+import random
import re
from urllib.parse import urlparse, parse_qs
-
+from fake_headers import Headers
+from Src.Utilities.loadenv import load_env
+env_vars = load_env()
#Get domain
-SC_DOMAIN= config.SC_DOMAIN
-SC_FAST_SEARCH = config.SC_FAST_SEARCH
-
-headers = {
- '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',
- 'Accept-Language': 'en-US,en;q=0.5'
-}
+SC_DOMAIN = config.SC_DOMAIN
+Public_Instance = config.Public_Instance
+Alternative_Link = env_vars.get('ALTERNATIVE_LINK')
+headers = Headers()
#GET VERSION OF STREAMING COMMUNITY:
async def get_version(client):
#Extract the version from the main page of the site
try:
- base_url = f'https://streamingcommunity.{SC_DOMAIN}/richiedi-un-titolo'
- response = await client.get(base_url, headers=headers, follow_redirects=True)
+ random_headers = headers.generate()
+ random_headers['Referer'] = "https://streamingcommunity.buzz/"
+ random_headers['Origin'] = "https://streamingcommunity.buzz"
+ base_url = f'https://streamingcommunity.{SC_DOMAIN}/richiedi-un-titolo'
+ response = await client.get(base_url, headers=random_headers, allow_redirects = True, impersonate="chrome120")
#Soup the response
soup = BeautifulSoup(response.text, "lxml")
# Extract version
version = json.loads(soup.find("div", {"id": "app"}).get("data-page"))['version']
return version
- except:
- print("Couldn't find the version")
+ except Exception as e:
+ print("Couldn't find the version",e)
version = "65e52dcf34d64173542cd2dc6b8bb75b"
return version
-async def search(query,date,ismovie, client):
+async def search(query,date,ismovie, client,SC_FAST_SEARCH):
+ random_headers = headers.generate()
+ random_headers['Referer'] = "https://streamingcommunity.buzz/"
+ random_headers['Origin'] = "https://streamingcommunity.buzz"
#Do a request to get the ID of serie/move and it's slug in the URL
- response = await client.get(query, follow_redirects=True)
+ response = await client.get(query, headers = random_headers, allow_redirects=True,impersonate = "chrome120")
+ print(response)
response = response.json()
for item in response['data']:
@@ -54,17 +57,17 @@ async def search(query,date,ismovie, client):
if type == ismovie:
#Added a Check to see if the result is what it is supposed to be
if SC_FAST_SEARCH == "0":
- if ismovie == 0:
- response = await client.get ( f'https://streamingcommunity.{SC_DOMAIN}/titles/{tid}-{slug}', follow_redirects=True)
- pattern = r'
]*class="features"[^>]*>.*?]*>(.*?)<\/span>'
+ match = re.search(pattern, response.text)
+ print(match.group(1).split("-")[0])
+ first_air_year = match.group(1).split("-")[0]
+ date = int(date)
+ first_air_year = int(first_air_year)
+ if first_air_year == date:
return tid,slug
elif SC_FAST_SEARCH == "1":
return tid,slug
@@ -73,15 +76,14 @@ async def search(query,date,ismovie, client):
async def get_film(tid,version,client):
- headers = {
- 'user-agent': "Mozilla/5.0 (Windows NT 10.10; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537",
- 'x-inertia': 'true',
- #Version of streaming community
- 'x-inertia-version': version
- }
+ random_headers = headers.generate()
+ random_headers['Referer'] = "https://streamingcommunity.buzz/"
+ random_headers['Origin'] = "https://streamingcommunity.buzz"
+ random_headers['x-inertia'] = "true"
+ random_headers['x-inertia-version'] = version
#Access the iframe
url = f'https://streamingcommunity.{SC_DOMAIN}/iframe/{tid}'
- response = await client.get(url, headers=headers, follow_redirects=True)
+ response = await client.get(url, headers=random_headers, allow_redirects=True,impersonate = "chrome120")
iframe = BeautifulSoup(response.text, 'lxml')
#Get the link of iframe
iframe = iframe.find('iframe').get("src")
@@ -89,8 +91,13 @@ async def get_film(tid,version,client):
vixid = iframe.split("/embed/")[1].split("?")[0]
parsed_url = urlparse(iframe)
query_params = parse_qs(parsed_url.query)
+ random_headers = headers.generate()
+ random_headers['Referer'] = "https://streamingcommunity.buzz/"
+ random_headers['Origin'] = "https://streamingcommunity.buzz"
+ random_headers['x-inertia'] = "true"
+ random_headers['x-inertia-version'] = version
#Get real token and expires by looking at the page in the iframe, vixcloud/embed
- resp = await client.get(iframe, headers = headers, follow_redirects=True)
+ resp = await client.get(iframe, headers = random_headers, allow_redirects=True,impersonate= "chrome120")
soup= BeautifulSoup(resp.text, "lxml")
script = soup.find("body").find("script").text
token = re.search(r"'token':\s*'(\w+)'", script).group(1)
@@ -108,15 +115,14 @@ async def get_film(tid,version,client):
return url,url720,quality,
async def get_season_episode_id(tid,slug,season,episode,version,client):
- #Set some basic headers for the request
- headers = {
- '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",
- 'x-inertia': 'true',
- #Version of streaming community
- 'x-inertia-version': version
- }
+ random_headers = headers.generate()
+ random_headers['Referer'] = "https://streamingcommunity.buzz/"
+ random_headers['Origin'] = "https://streamingcommunity.buzz"
+ random_headers['x-inertia'] = "true"
+ random_headers['x-inertia-version'] = version
+ #Set some basic headers for the request
#Get episode ID
- response = await client.get(f'https://streamingcommunity.{SC_DOMAIN}/titles/{tid}-{slug}/stagione-{season}', headers=headers, follow_redirects=True)
+ response = await client.get(f'https://streamingcommunity.{SC_DOMAIN}/titles/{tid}-{slug}/stagione-{season}', headers=random_headers, allow_redirects=True, impersonate = "chrome120")
# Print the json got
json_response = response.json().get('props', {}).get('loadedSeason', {}).get('episodes', [])
for dict_episode in json_response:
@@ -125,28 +131,30 @@ async def get_season_episode_id(tid,slug,season,episode,version,client):
async def get_episode_link(episode_id,tid,version,client):
#The parameters for the request
+ random_headers = headers.generate()
+ random_headers['Referer'] = "https://streamingcommunity.buzz/"
+ random_headers['Origin'] = "https://streamingcommunity.buzz"
params = {
'episode_id': episode_id,
'next_episode': '1'
}
#Let's try to get the link from iframe source
# Make a request to get iframe source
- response = await client.get(f"https://streamingcommunity.{SC_DOMAIN}/iframe/{tid}", params=params, follow_redirects=True)
+ response = await client.get(f"https://streamingcommunity.{SC_DOMAIN}/iframe/{tid}", params=params, headers = random_headers, allow_redirects=True, impersonate = "chrome120")
# Parse response with BeautifulSoup to get iframe source
soup = BeautifulSoup(response.text, "lxml")
iframe = soup.find("iframe").get("src")
vixid = iframe.split("/embed/")[1].split("?")[0]
- headers = {
- 'user-agent': "Mozilla/5.0 (Windows NT 10.10; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537",
- 'x-inertia': 'true',
- #Version of streaming community
- 'x-inertia-version': version
- }
+ random_headers = headers.generate()
+ random_headers['Referer'] = "https://streamingcommunity.buzz/"
+ random_headers['Origin'] = "https://streamingcommunity.buzz"
+ random_headers['x-inertia'] = "true"
+ random_headers['x-inertia-version'] = version
parsed_url = urlparse(iframe)
query_params = parse_qs(parsed_url.query)
#Get real token and expires by looking at the page in the iframe, vixcloud/embed
- resp = await client.get(iframe, headers = headers, follow_redirects=True)
+ resp = await client.get(iframe, headers = random_headers, allow_redirects=True, impersonate = "chrome120")
soup= BeautifulSoup(resp.text, "lxml")
script = soup.find("body").find("script").text
token = re.search(r"'token':\s*'(\w+)'", script).group(1)
@@ -164,17 +172,26 @@ async def get_episode_link(episode_id,tid,version,client):
return url,url720,quality
-async def streaming_community(imdb,client):
+async def streaming_community(imdb,client,SC_FAST_SEARCH):
try:
+ if Public_Instance == "1":
+ Weird_Link = json.loads(Alternative_Link)
+ link_post = random.choice(Weird_Link)
+ response = await client.get(f"{link_post}fetch-data/{imdb}")
+ url_streaming_community = response.headers.get('x-url-streaming-community')
+ url_720_streaming_community = response.headers.get('x-url-720-streaming-community')
+ quality_sc = response.headers.get('x-quality-sc')
+ print(quality_sc,url_streaming_community)
+ return url_streaming_community,url_720_streaming_community,quality_sc
general = is_movie(imdb)
ismovie = general[0]
imdb_id = general[1]
- type = "StreamingCommunity"
if ismovie == 0 :
season = int(general[2])
episode = int(general[3])
#Check if fast search is enabled or disabled
if SC_FAST_SEARCH == "1":
+ type = "StreamingCommunityFS"
if "tt" in imdb:
#Get showname
showname = await get_info_imdb(imdb_id,ismovie,type,client)
@@ -186,34 +203,55 @@ async def streaming_community(imdb,client):
tmdba = imdb_id.replace("tmdb:","")
showname = get_info_tmdb(tmdba,ismovie,type)
elif SC_FAST_SEARCH == "0":
+ type = "StreamingCommunity"
tmdba = await get_TMDb_id_from_IMDb_id(imdb_id,client)
showname,date = get_info_tmdb(tmdba,ismovie,type)
#HERE THE CASE IF IT IS A MOVIE
else:
- if "tt" in imdb:
- #Get showname
- date = None
- showname = await get_info_imdb(imdb_id,ismovie,type,client)
- else:
+ if SC_FAST_SEARCH == "1":
+ type = "StreamingCommunity"
+ if "tt" in imdb:
+ #Get showname
date = None
- tmdba = imdb_id.replace("tmdb:","")
- showname = get_info_tmdb(tmdba,ismovie,type)
+ showname = await get_info_imdb(imdb_id,ismovie,type,client)
+ else:
+ date = None
+ tmdba = imdb_id.replace("tmdb:","")
+ showname = get_info_tmdb(tmdba,ismovie,type)
+ elif SC_FAST_SEARCH == "0":
+ if "tt" in imdb:
+ #Get showname
+ showname,date = await get_info_imdb(imdb_id,ismovie,type,client)
+ else:
+ tmdba = imdb_id.replace("tmdb:","")
+ showname,date = get_info_tmdb(tmdba,ismovie,type)
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
query = f'https://streamingcommunity.{SC_DOMAIN}/api/search?q={showname}'
- tid,slug = await search(query,date,ismovie,client)
version = await get_version(client)
+ tid,slug = await search(query,date,ismovie,client,SC_FAST_SEARCH)
if ismovie == 1:
#TID means temporaly ID
url,url720,quality = await get_film(tid,version,client)
- print(url)
+ print("MammaMia found results for StreamingCommunity")
return url,url720,quality
if ismovie == 0:
#Uid = URL ID
episode_id = await get_season_episode_id(tid,slug,season,episode,version,client)
url,url720,quality = await get_episode_link(episode_id,tid,version,client)
- print(url)
+ print("MammaMia found results for StreamingCommunity")
return url,url720,quality
except Exception as e:
- print("StreamingCommunity failed")
+ print("MammaMia: StreamingCommunity failed",e)
return None,None,None
+
+async def test_animeworld():
+ from curl_cffi.requests import AsyncSession
+ async with AsyncSession() as client:
+ # Replace with actual id, for example 'anime_id:episode' format
+ test_id = "tt16288804:1:1" # This is an example ID format
+ results = await streaming_community(test_id, client,"0")
+
+if __name__ == "__main__":
+ import asyncio
+ asyncio.run(test_animeworld())
diff --git a/streamingwatch.py b/Src/API/streamingwatch.py
similarity index 86%
rename from streamingwatch.py
rename to Src/API/streamingwatch.py
index ad89f20..2329187 100644
--- a/streamingwatch.py
+++ b/Src/API/streamingwatch.py
@@ -1,12 +1,7 @@
-from tmdbv3api import TMDb, Movie, TV
-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
+from bs4 import BeautifulSoup,SoupStrainer
+from Src.Utilities.convert import get_TMDb_id_from_IMDb_id
+from Src.Utilities.info import get_info_tmdb, is_movie, get_info_imdb
+import Src.Utilities.config as config
import re
import json
SW_DOMAIN = config.SW_DOMAIN
@@ -43,7 +38,7 @@ async def search(showname,season,episode,date,ismovie,client):
page_date = soup.find(id = 'search-cat-year').text.strip()
if page_date == date:
href = soup.find('a')['href']
- response = await client.get(href, follow_redirects=True)
+ response = await client.get(href, allow_redirects=True, impersonate = "chrome120")
soup = BeautifulSoup(response.text,'lxml',parse_only=SoupStrainer('iframe'))
iframe = soup.find('iframe')
hdplayer = iframe.get('data-lazy-src')
@@ -51,11 +46,11 @@ async def search(showname,season,episode,date,ismovie,client):
return hdplayer
elif ismovie == 0:
#Some series have the name in english so we first search with the categories option and then we use the obtained ID to get all the episodes
- id_response = await client.get(f'https://streamingwatch.{SW_DOMAIN}/wp-json/wp/v2/categories?search={showname}&_fields=id', follow_redirects=True)
+ id_response = await client.get(f'https://streamingwatch.{SW_DOMAIN}/wp-json/wp/v2/categories?search={showname}&_fields=id', allow_redirects=True, impersonate = "chrome120")
data = json.loads(id_response.text)
category_id = data[0]['id']
query = f'https://streamingwatch.{SW_DOMAIN}/wp-json/wp/v2/posts?categories={category_id}&per_page=100'
- response = await client.get(query, follow_redirects=True)
+ response = await client.get(query, allow_redirects=True, impersonate = "chrome120")
data_json = response.text
data = json.loads(data_json)
for entry in data:
@@ -68,10 +63,9 @@ async def search(showname,season,episode,date,ismovie,client):
hdplayer = content[start:end]
return hdplayer
async def hls_url(hdplayer,client):
- response = await client.get(hdplayer, follow_redirects=True)
+ response = await client.get(hdplayer, allow_redirects=True, impersonate = "chrome120")
match = re.search(r'sources:\s*\[\s*\{\s*file\s*:\s*"([^"]*)"', response.text)
url = match.group(1)
- print(url)
return url
async def streamingwatch(imdb,client):
try:
@@ -97,7 +91,8 @@ async def streamingwatch(imdb,client):
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
hdplayer = await search(showname,season,episode,date,ismovie,client)
url = await hls_url(hdplayer,client)
+ print("MammaMia: StreamingWatch found results for StreamingCommunity")
return url
except:
- print("StreamingWatch Failed")
+ print("MammaMia: StreamingWatch Failed")
return None
diff --git a/tantifilm.py b/Src/API/tantifilm.py
similarity index 77%
rename from tantifilm.py
rename to Src/API/tantifilm.py
index d4a8051..f411276 100644
--- a/tantifilm.py
+++ b/Src/API/tantifilm.py
@@ -1,26 +1,23 @@
-import requests
from bs4 import BeautifulSoup,SoupStrainer
import re
import time
-from info import is_movie,get_info_imdb,get_info_tmdb
-import config
-from loadenv import load_env
-TF_FAST_SEARCH = config.TF_FAST_SEARCH
-TF_DOMAIN = config.TF_DOMAIN
+from Src.Utilities.info import is_movie,get_info_imdb,get_info_tmdb
+import Src.Utilities.config as config
+from Src.Utilities.loadenv import load_env
HF = config.HF
env_vars = load_env()
PROXY_CREDENTIALS = env_vars.get('PROXY_CREDENTIALS')
-
+TF_DOMAIN = config.TF_DOMAIN
async def search(showname,ismovie,date,client):
- url = f'https://www.tanti.{TF_DOMAIN}/search/{showname}'
- response = await client.get(url, follow_redirects=True)
- soup = BeautifulSoup(response.text, "lxml")
+ showname = showname.replace(" ","%20")
+ url = f'https://www.tanti.bond/ajax/posts?q={showname}'
+ response = await client.post(url, allow_redirects=True, impersonate = "chrome120")
+ response = response.json()['data']
if ismovie == 1:
- all_link = soup.select('#movies .col .list-media')
- for link in all_link:
- url = link['href']
- response = client.get(url, follow_redirects=True)
+ for link in response:
+ url = link['url']
+ response = client.get(url, allow_redirects=True, impersonate = "chrome120")
pattern = r'Data di rilascio\s*
\s*
\s*(\d{4})\s*
'
found_date = re.search(pattern, response.text)
release_date = str(found_date.group(1))
@@ -30,11 +27,10 @@ async def search(showname,ismovie,date,client):
#I try to get doodstream link inside this function so I do not have to get again the response
return tid,url
elif ismovie == 0:
- all_link = soup.select('#series .col .list-media')
- for link in all_link:
- base_url = link['href']
+ for link in response:
+ base_url = link['url']
url = f'{base_url}-1-season-1-episode'
- response = await client.get(url, follow_redirects=True)
+ response = await client.get(url, allow_redirects=True, impersonate = "chrome120")
pattern = r'Data di rilascio\s*