Added StreamingCommunity and rewrote Readme.md
This commit is contained in:
+2
-1
@@ -1 +1,2 @@
|
|||||||
.env
|
.env
|
||||||
|
streamingcommunity.py
|
||||||
@@ -1,19 +1,35 @@
|
|||||||
# MammaMia
|
# MammaMia
|
||||||
A Stremio Addon for HTTPS Stream in Italian
|
|
||||||
Note that for now only filmpertutti is avaiable which uses Mixdrop. Mixdrop allows to see the videos only from the same IP they were generated so, if you want to scrape filmpertutti, you have to host this project locally.
|
A Stremio Addon for high quality HTTPS Stream in Italian
|
||||||
|
|
||||||
|
While hosting, this project, remember that Filmpertutti uses Mixdrop. Mixdrop only allows seeing the videos only from the same IP where they were generated so, if you want to scrape filmpertutti, you have to host this project locally. Else, you can only scrape streamingcommunity.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
Install required packages
|
Install required packages
|
||||||
``
|
|
||||||
|
``
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
``
|
``
|
||||||
|
|
||||||
|
Then to start the Flask server just execute:
|
||||||
Just execute:
|
|
||||||
``
|
``
|
||||||
python3 run.py
|
python3 run.py
|
||||||
``
|
``
|
||||||
|
# How to add to Stremio
|
||||||
|
Just paste the URL/manifest.json in your search bar.
|
||||||
# Enviroment Variables
|
# Enviroment Variables
|
||||||
TMDB_KEY = "Your key here"
|
|
||||||
|
|
||||||
DOMAIN = "domain here"
|
| Enviroment Variable | Value |
|
||||||
|
|-------------------------|---|
|
||||||
|
|TMDB_KEY|INSERT YOUR API KEY HERE|
|
||||||
|
| FT_DOMAIN | INSERT FILMPERTUTTI DOMAIN |
|
||||||
|
|SC_DOMAIN | INSERT STREAMINGCOMMUNITY DOMAIN|
|
||||||
|
|FILMPERTUTTI|Put "1" if you want Filmpertutti to be enabled, "0" if disabled Altought keep in mind that you will only be able to use it if you get the link from the same IP of your streaming server.|
|
||||||
|
|STREAMINGCOMMUNITY|Put "1" if enabled, "0" if disabled|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Here is [linked](https://developer.themoviedb.org/docs/getting-started) a tutorial about how to get a TMDB KEY
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+4
-13
@@ -1,24 +1,15 @@
|
|||||||
import requests
|
import requests
|
||||||
from tmdbv3api import TMDb, Movie, TV
|
from tmdbv3api import TMDb, Movie, TV
|
||||||
from loadenv import load_env
|
from loadenv import load_env
|
||||||
TMDB_KEY, DOMAIN = load_env()
|
TMDB_KEY, _, _, _,_ = load_env()
|
||||||
|
def get_TMDb_id_from_IMDb_id(imdb_id):
|
||||||
def get_TMDb_id_from_IMDb_id(imdb_id):
|
|
||||||
if ":" in imdb_id:
|
|
||||||
season = imdb_id.split(":")[1]
|
|
||||||
episode = imdb_id[-1]
|
|
||||||
ismovie = 0
|
|
||||||
imdb_id = imdb_id.split(":")[0]
|
|
||||||
else:
|
|
||||||
ismovie = 1
|
|
||||||
response = requests.get(f'https://api.themoviedb.org/3/find/{imdb_id}',
|
response = requests.get(f'https://api.themoviedb.org/3/find/{imdb_id}',
|
||||||
params={'external_source': 'imdb_id', 'api_key': f'{TMDB_KEY}'})
|
params={'external_source': 'imdb_id', 'api_key': f'{TMDB_KEY}'})
|
||||||
tmbda = response.json()
|
tmbda = response.json()
|
||||||
if tmbda['movie_results']:
|
if tmbda['movie_results']:
|
||||||
print(tmbda)
|
return tmbda['movie_results'][0]['id']
|
||||||
return tmbda['movie_results'][0]['id'], ismovie
|
|
||||||
elif tmbda['tv_results']:
|
elif tmbda['tv_results']:
|
||||||
print(tmbda['tv_results'][0]['id'])
|
print(tmbda['tv_results'][0]['id'])
|
||||||
return tmbda['tv_results'][0]['id'], season, episode , ismovie
|
return tmbda['tv_results'][0]['id']
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
+6
-1
@@ -1,2 +1,7 @@
|
|||||||
TMDB_KEY= "INSERT YOUR API KEY HERE"
|
TMDB_KEY= "INSERT YOUR API KEY HERE"
|
||||||
DOMAIN = "INSERT DOMAIN"
|
FT_DOMAIN = "INSERT FILMPERTUTTI DOMAIN"
|
||||||
|
SC_DOMAIN = "INSERT STREAMINGCOMMUNITY DOMAIN"
|
||||||
|
FILMPERTUTTI= "Put 1 if enabled, 0 if disabled"
|
||||||
|
STREAMINGCOMMUNITY = "Put 1 if enabled, 0 if disabled"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+24
-22
@@ -1,21 +1,24 @@
|
|||||||
|
|
||||||
from tmdbv3api import TMDb, Movie, TV
|
from tmdbv3api import TMDb, Movie, TV
|
||||||
import requests
|
import requests
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup,SoupStrainer
|
||||||
import string
|
import string
|
||||||
import re
|
import re
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import dateparser
|
import dateparser
|
||||||
from convert import get_TMDb_id_from_IMDb_id
|
from convert import get_TMDb_id_from_IMDb_id
|
||||||
from loadenv import load_env
|
from loadenv import load_env
|
||||||
from info import get_info
|
from info import get_info, is_movie
|
||||||
from convert_date import convert_US_date
|
from convert_date import convert_US_date
|
||||||
|
import logging
|
||||||
|
|
||||||
TMDB_KEY, DOMAIN = load_env()
|
_, FT_DOMAIN,_,_ ,_= load_env()
|
||||||
|
#Some basic headers
|
||||||
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',
|
'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'
|
'Accept-Language': 'en-US,en;q=0.5'
|
||||||
}
|
}
|
||||||
|
#Map months to check if date = date
|
||||||
month_mapping = {
|
month_mapping = {
|
||||||
'Jan': 'Gennaio', 'Feb': 'Febbraio', 'Mar': 'Marzo', 'Apr': 'Aprile',
|
'Jan': 'Gennaio', 'Feb': 'Febbraio', 'Mar': 'Marzo', 'Apr': 'Aprile',
|
||||||
'May': 'Maggio', 'Jun': 'Giugno', 'Jul': 'Luglio', 'Aug': 'Agosto',
|
'May': 'Maggio', 'Jun': 'Giugno', 'Jul': 'Luglio', 'Aug': 'Agosto',
|
||||||
@@ -24,6 +27,7 @@ month_mapping = {
|
|||||||
|
|
||||||
def search(query,date):
|
def search(query,date):
|
||||||
response = requests.get(query).json()
|
response = requests.get(query).json()
|
||||||
|
#Get link tid of every item and then open the link to see if the date = date
|
||||||
for json in response:
|
for json in response:
|
||||||
link = json['link']
|
link = json['link']
|
||||||
tid = json['id']
|
tid = json['id']
|
||||||
@@ -38,7 +42,6 @@ def search(query,date):
|
|||||||
|
|
||||||
# Swap to YY-MM-DD formatting using dateparser
|
# 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")
|
||||||
print(release_date)
|
|
||||||
if release_date == date:
|
if release_date == date:
|
||||||
url = link
|
url = link
|
||||||
tid = tid
|
tid = tid
|
||||||
@@ -46,19 +49,20 @@ def search(query,date):
|
|||||||
return url, tid
|
return url, tid
|
||||||
|
|
||||||
def get_episode_link(season,episode,tid,url):
|
def get_episode_link(season,episode,tid,url):
|
||||||
episode = int(episode)
|
#Get the link from where we have to obtain mixdrop link
|
||||||
season = int(season)
|
|
||||||
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={season-1}&episode_id={episode-1}'
|
||||||
return tlink
|
return tlink
|
||||||
|
|
||||||
|
|
||||||
def get_film(url):
|
def get_film(url):
|
||||||
|
#Get the link from where we have to obtain mixdrop link
|
||||||
tlink = url + "?show_video=true"
|
tlink = url + "?show_video=true"
|
||||||
return tlink
|
return tlink
|
||||||
|
|
||||||
def get_real_link(tlink):
|
def get_real_link(tlink):
|
||||||
|
#Some basic code to get the mixdrop link
|
||||||
page = requests.get(tlink, headers=headers)
|
page = requests.get(tlink, headers=headers)
|
||||||
soup = BeautifulSoup(page.content, features="lxml")
|
soup = BeautifulSoup(page.content, features="lxml",parse_only=SoupStrainer('iframe'))
|
||||||
iframe_src = soup.find('iframe')['src']
|
iframe_src = soup.find('iframe')['src']
|
||||||
|
|
||||||
iframe_page = requests.get(iframe_src, headers=headers)
|
iframe_page = requests.get(iframe_src, headers=headers)
|
||||||
@@ -67,7 +71,6 @@ def get_real_link(tlink):
|
|||||||
mega_button = iframe_soup.find('div', attrs={'class': 'megaButton', 'rel': 'nofollow'}, string='MIXDROP')
|
mega_button = iframe_soup.find('div', attrs={'class': 'megaButton', 'rel': 'nofollow'}, string='MIXDROP')
|
||||||
if mega_button:
|
if mega_button:
|
||||||
real_link = mega_button.get('meta-link')
|
real_link = mega_button.get('meta-link')
|
||||||
print(f'Real link: {real_link}')
|
|
||||||
return real_link
|
return real_link
|
||||||
|
|
||||||
def get_true_link(real_link):
|
def get_true_link(real_link):
|
||||||
@@ -82,36 +85,35 @@ def get_true_link(real_link):
|
|||||||
s = 'https:'
|
s = 'https:'
|
||||||
for c in schema:
|
for c in schema:
|
||||||
s += d[c] if c in d else c
|
s += d[c] if c in d else c
|
||||||
print(s)
|
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def get_stream_link(imbd):
|
def filmpertutti(imdb):
|
||||||
general = get_TMDb_id_from_IMDb_id(imbd)
|
general = is_movie(imdb)
|
||||||
if len(general)==4 :
|
ismovie = general[0]
|
||||||
tmdba,season,episode,ismovie = general
|
imdb_id = general[1]
|
||||||
else:
|
if ismovie == 0 :
|
||||||
tmdba,ismovie = general
|
season = int(general[2])
|
||||||
|
episode = int(general[3])
|
||||||
|
tmdba = get_TMDb_id_from_IMDb_id(imdb_id)
|
||||||
type = "Filmpertutti"
|
type = "Filmpertutti"
|
||||||
showname,date = get_info(tmdba,ismovie,type)
|
showname,date = get_info(tmdba,ismovie,type)
|
||||||
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
|
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
|
||||||
query = f'https://filmpertutti.{DOMAIN}/wp-json/wp/v2/posts?search={showname}&page=1&_fields=link,id'
|
#Build the query
|
||||||
print(query)
|
query = f'https://filmpertutti.{FT_DOMAIN}/wp-json/wp/v2/posts?search={showname}&page=1&_fields=link,id'
|
||||||
url,tid = search(query,date)
|
url,tid = search(query,date)
|
||||||
print(ismovie)
|
|
||||||
print(url)
|
|
||||||
if ismovie == 0:
|
if ismovie == 0:
|
||||||
episode_link = get_episode_link(season,episode,tid,url)
|
episode_link = get_episode_link(season,episode,tid,url)
|
||||||
print(episode_link)
|
|
||||||
#Let's get mixdrop link
|
#Let's get mixdrop link
|
||||||
real_link = get_real_link(episode_link)
|
real_link = get_real_link(episode_link)
|
||||||
#let's get delivery link, streaming link
|
#let's get delivery link, streaming link
|
||||||
streaming_link = get_true_link(real_link)
|
streaming_link = get_true_link(real_link)
|
||||||
|
print(streaming_link)
|
||||||
return streaming_link
|
return streaming_link
|
||||||
elif ismovie == 1:
|
elif ismovie == 1:
|
||||||
film_link = get_film(url)
|
film_link = get_film(url)
|
||||||
print(film_link)
|
|
||||||
#Let's get mixdrop link
|
#Let's get mixdrop link
|
||||||
real_link = get_real_link(film_link)
|
real_link = get_real_link(film_link)
|
||||||
#let's get delivery link, streaming link
|
#let's get delivery link, streaming link
|
||||||
streaming_link = get_true_link(real_link)
|
streaming_link = get_true_link(real_link)
|
||||||
return streaming_link
|
print(streaming_link)
|
||||||
|
return streaming_link
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
from loadenv import load_env
|
from loadenv import load_env
|
||||||
from tmdbv3api import TMDb, Movie, TV
|
from tmdbv3api import TMDb, Movie, TV
|
||||||
from convert_date import convert_US_date, convert_IT_date
|
from convert_date import convert_US_date, convert_IT_date
|
||||||
TMDB_KEY, DOMAIN, FILMPERTUTTI,STREAMINGCOMMUNITY = load_env()
|
TMDB_KEY,_,_,FILMPERTUTTI,STREAMINGCOMMUNITY = load_env()
|
||||||
|
|
||||||
def get_info(tmbda,ismovie,type):
|
def get_info(tmbda,ismovie,type):
|
||||||
tmdb = TMDb()
|
tmdb = TMDb()
|
||||||
@@ -25,10 +25,18 @@ def get_info(tmbda,ismovie,type):
|
|||||||
if type == "Filmpertutti":
|
if type == "Filmpertutti":
|
||||||
#GET US RELEASE DATE because filmpertutti somewhy uses US release date
|
#GET US RELEASE DATE because filmpertutti somewhy uses US release date
|
||||||
date = convert_US_date(date)
|
date = convert_US_date(date)
|
||||||
elif type == "StreamingCommunity":
|
return showname,date
|
||||||
date = convert_IT_date(date)
|
|
||||||
print (date)
|
|
||||||
if ismovie==0:
|
def is_movie(imdb_id):
|
||||||
return showname,date
|
if "tmdb:" in imdb_id:
|
||||||
|
imdb_id = imdb_id.replace("tmdb:","")
|
||||||
|
if ":" in imdb_id:
|
||||||
|
season = imdb_id.split(":")[1]
|
||||||
|
episode = imdb_id[-1]
|
||||||
|
ismovie = 0
|
||||||
|
imdb_id = imdb_id.split(":")[0]
|
||||||
|
return ismovie,imdb_id,season,episode
|
||||||
else:
|
else:
|
||||||
return showname,date
|
ismovie = 1
|
||||||
|
return ismovie,imdb_id
|
||||||
+3
-2
@@ -3,7 +3,8 @@ from dotenv import load_dotenv
|
|||||||
load_dotenv(".env")
|
load_dotenv(".env")
|
||||||
def load_env():
|
def load_env():
|
||||||
TMDB_KEY = os.getenv('TMDB_KEY')
|
TMDB_KEY = os.getenv('TMDB_KEY')
|
||||||
DOMAIN = os.getenv('DOMAIN')
|
FT_DOMAIN = os.getenv('FT_DOMAIN')
|
||||||
|
SC_DOMAIN= os.getenv('SC_DOMAIN')
|
||||||
FILMPERTUTTI = os.getenv('FILMPERTUTTI')
|
FILMPERTUTTI = os.getenv('FILMPERTUTTI')
|
||||||
STREAMINGCOMMUNITY = os.getenv('STREAMINGCOMMUNITY')
|
STREAMINGCOMMUNITY = os.getenv('STREAMINGCOMMUNITY')
|
||||||
return TMDB_KEY, DOMAIN, FILMPERTUTTI, STREAMINGCOMMUNITY
|
return TMDB_KEY, FT_DOMAIN, SC_DOMAIN, FILMPERTUTTI, STREAMINGCOMMUNITY
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
from flask import Flask, jsonify, abort
|
from flask import Flask, jsonify, abort
|
||||||
from filmpertutti import get_stream_link
|
from filmpertutti import filmpertutti
|
||||||
|
from streamingcommunity import streaming_community
|
||||||
from loadenv import load_env
|
from loadenv import load_env
|
||||||
TMDB_KEY, DOMAIN, FILMPERTUTTI, STREAMINGCOMMUNITY = load_env()
|
TMDB_KEY, FT_DOMAIN, SC_DOMAIN, FILMPERTUTTI, STREAMINGCOMMUNITY = load_env()
|
||||||
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
@@ -35,16 +37,27 @@ def root():
|
|||||||
@app.route('/stream/<type>/<id>.json')
|
@app.route('/stream/<type>/<id>.json')
|
||||||
def addon_stream(type, id):
|
def addon_stream(type, id):
|
||||||
if type not in MANIFEST['types']:
|
if type not in MANIFEST['types']:
|
||||||
abort(404)
|
abort(404)
|
||||||
if FILMPERTUTTI == 1:
|
streams = {'streams': []}
|
||||||
url = get_stream_link(id) # call the function to dynamically get stream links
|
if STREAMINGCOMMUNITY == "1":
|
||||||
elif STREAMINGCOMMUNITY == 1:
|
url_streaming_community = streaming_community(id)
|
||||||
return "Not implemented yet"
|
print(url_streaming_community)
|
||||||
|
if url_streaming_community is not None:
|
||||||
|
streams['streams'].append({'title': 'StreamingCommunity 1080p', 'url': f'{url_streaming_community}?rendition=1080p'})
|
||||||
|
streams['streams'].append({'title': 'StreamingCommunity 720p', 'url': f'{url_streaming_community}?rendition=720p'})
|
||||||
|
|
||||||
|
# If FILMPERTUTTI == 1, scrape that site
|
||||||
|
if FILMPERTUTTI == "1":
|
||||||
|
url_filmpertutti = filmpertutti(id)
|
||||||
|
if url_filmpertutti is not None:
|
||||||
|
streams['streams'].append({'title': 'Filmpertutti', 'url': url_filmpertutti})
|
||||||
|
|
||||||
|
# If no streams were added, abort with a 404 error
|
||||||
streams = {'streams': [{'title': 'Stream URL', 'url': url}]}
|
if not streams['streams']:
|
||||||
|
abort(404)
|
||||||
|
|
||||||
return respond_with(streams)
|
return respond_with(streams)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(host='0.0.0.0', port=8080)
|
app.run(host='0.0.0.0', port=8080)
|
||||||
|
|||||||
+87
-33
@@ -1,48 +1,102 @@
|
|||||||
from tmdbv3api import TMDb, Movie, TV
|
from tmdbv3api import TMDb, Movie, TV
|
||||||
import requests
|
import requests
|
||||||
|
import logging
|
||||||
from bs4 import BeautifulSoup,SoupStrainer
|
from bs4 import BeautifulSoup,SoupStrainer
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import dateparser
|
import dateparser
|
||||||
from convert import get_TMDb_id_from_IMDb_id
|
from convert import get_TMDb_id_from_IMDb_id
|
||||||
from loadenv import load_env
|
from loadenv import load_env
|
||||||
from info import get_info
|
from info import get_info, is_movie
|
||||||
TMDB_KEY= load_env()
|
#Get domain
|
||||||
|
_, _,SC_DOMAIN,_ ,_= load_env()
|
||||||
|
|
||||||
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',
|
'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'
|
'Accept-Language': 'en-US,en;q=0.5'
|
||||||
}
|
}
|
||||||
def streaming_community(imbd):
|
|
||||||
print(load_env)
|
def search(query,date,ismovie):
|
||||||
general = get_TMDb_id_from_IMDb_id(imbd)
|
#Do a request to get the ID of serie/move and it's slug in the URL
|
||||||
if len(general)==4 :
|
response = requests.get(query).json()
|
||||||
tmdba,season,episode,ismovie = general
|
for item in response['data']:
|
||||||
|
tid = item['id']
|
||||||
|
slug = item['slug']
|
||||||
|
return tid,slug
|
||||||
|
|
||||||
|
|
||||||
|
def get_film(tid):
|
||||||
|
#Access the iframe
|
||||||
|
url = f'https://streamingcommunity.{SC_DOMAIN}/iframe/{tid}'
|
||||||
|
response = requests.get(url, headers=headers)
|
||||||
|
iframe = BeautifulSoup(response.text, 'lxml')
|
||||||
|
#Get the link of iframe
|
||||||
|
iframe = iframe.find('iframe').get("src")
|
||||||
|
#Get the ID containted in the src of iframe
|
||||||
|
vixid = iframe.split("/embed/")[1].split("?")[0]
|
||||||
|
#Build the url with 1080p, to get the highest resolution
|
||||||
|
url = f'https://vixcloud.co/playlist/{vixid}'
|
||||||
|
return url
|
||||||
|
|
||||||
|
def get_season_episode_id(tid,slug,season,episode):
|
||||||
|
#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': 'c1bdf1189cb68fca28151c8e909bd053'
|
||||||
|
}
|
||||||
|
#Get episode ID
|
||||||
|
response = requests.get(f'https://streamingcommunity.{SC_DOMAIN}/titles/{tid}-{slug}/stagione-{season}', headers=headers)
|
||||||
|
# Print the json got
|
||||||
|
json_response = response.json().get('props', {}).get('loadedSeason', {}).get('episodes', [])
|
||||||
|
for dict_episode in json_response:
|
||||||
|
if dict_episode['number'] == episode:
|
||||||
|
return dict_episode['id']
|
||||||
|
|
||||||
|
def get_episode_link(episode_id,tid):
|
||||||
|
#The parameters for the request
|
||||||
|
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 = requests.get(f"https://streamingcommunity.{SC_DOMAIN}/iframe/{tid}", params=params)
|
||||||
|
|
||||||
|
# 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]
|
||||||
|
url = f"https://vixcloud.co/playlist/{vixid}"
|
||||||
|
return url
|
||||||
|
|
||||||
|
|
||||||
|
def streaming_community(imdb):
|
||||||
|
general = is_movie(imdb)
|
||||||
|
ismovie = general[0]
|
||||||
|
imdb_id = general[1]
|
||||||
|
if ismovie == 0 :
|
||||||
|
season = int(general[2])
|
||||||
|
episode = int(general[3])
|
||||||
|
if "tt" in imdb:
|
||||||
|
#If it is a imbd then conver it to tmbd
|
||||||
|
tmdba = get_TMDb_id_from_IMDb_id(imdb_id)
|
||||||
else:
|
else:
|
||||||
tmdba,ismovie = general
|
#else just equals them
|
||||||
|
tmdba = imdb_id.replace("tmdb:","")
|
||||||
type = "StreamingCommunity"
|
type = "StreamingCommunity"
|
||||||
showname,date = get_info(tmdba,ismovie,type)
|
showname,date = get_info(tmdba,ismovie,type)
|
||||||
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
|
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
|
||||||
query = f'https://streamingcommunity.boston/api/search?q={showname}'
|
query = f'https://streamingcommunity.{SC_DOMAIN}/api/search?q={showname}'
|
||||||
date,tid,slug = search(query,date)
|
tid,slug = search(query,date,ismovie)
|
||||||
if ismovie == 0:
|
if ismovie == 1:
|
||||||
|
#TID means temporaly ID
|
||||||
url = get_film(tid)
|
url = get_film(tid)
|
||||||
return "NOT IMPLEMENTED YET"
|
print(url)
|
||||||
|
return url
|
||||||
|
if ismovie == 0:
|
||||||
|
#Uid = URL ID
|
||||||
def search(query,date):
|
episode_id = get_season_episode_id(tid,slug,season,episode)
|
||||||
response = requests.get(query).json()
|
url = get_episode_link(episode_id,tid)
|
||||||
for json in response:
|
print(url)
|
||||||
release_date = json['last_air_date']
|
return url
|
||||||
tid = json['id']
|
|
||||||
slug = json['slug']
|
|
||||||
if date == release_date:
|
|
||||||
return date,tid,slug
|
|
||||||
def get_film(tid):
|
|
||||||
url = f'https://streamingcommunity.boston/watch/{tid}'
|
|
||||||
response = requests.get(url, headers=headers)
|
|
||||||
soup = BeautifulSoup(response.text, 'lxml', parse_only=SoupStrainer('iframe'))
|
|
||||||
vixid = soup['src']
|
|
||||||
vixid = vixid.split("/embed/")[1].split("?")[0]
|
|
||||||
print (vixid)
|
|
||||||
|
|
||||||
streaming_community("tt16426418")
|
|
||||||
Reference in New Issue
Block a user