Spaces:
Paused
Paused
Delete run.py
Browse files
run.py
DELETED
|
@@ -1,63 +0,0 @@
|
|
| 1 |
-
from flask import Flask, jsonify, abort
|
| 2 |
-
from filmpertutti import filmpertutti
|
| 3 |
-
from streamingcommunity import streaming_community
|
| 4 |
-
from loadenv import load_env
|
| 5 |
-
TMDB_KEY, FT_DOMAIN, SC_DOMAIN, FILMPERTUTTI, STREAMINGCOMMUNITY = load_env()
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
app = Flask(__name__)
|
| 9 |
-
|
| 10 |
-
MANIFEST = {
|
| 11 |
-
"id": "org.stremio.mammamia",
|
| 12 |
-
"version": "1.0.0",
|
| 13 |
-
"catalogs": [],
|
| 14 |
-
"resources": ["stream"],
|
| 15 |
-
"types": ["movie", "series"],
|
| 16 |
-
"name": "Mamma Mia",
|
| 17 |
-
"description": "Addon providing HTTPS Stream for Italian Movies/Series",
|
| 18 |
-
"logo":"https://creazilla-store.fra1.digitaloceanspaces.com/emojis/49647/pizza-emoji-clipart-md.png"
|
| 19 |
-
}
|
| 20 |
-
|
| 21 |
-
def respond_with(data):
|
| 22 |
-
resp = jsonify(data)
|
| 23 |
-
resp.headers['Access-Control-Allow-Origin'] = '*'
|
| 24 |
-
resp.headers['Access-Control-Allow-Headers'] = '*'
|
| 25 |
-
return resp
|
| 26 |
-
|
| 27 |
-
@app.route('/manifest.json')
|
| 28 |
-
def addon_manifest():
|
| 29 |
-
return respond_with(MANIFEST)
|
| 30 |
-
|
| 31 |
-
@app.route('/')
|
| 32 |
-
def root():
|
| 33 |
-
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. Since this is a remote server Filmpertutti is disabled (The stream coming from there is IP-LOCKED) therefore, if you can, I suggest you to host this locally or else just stick with the other providers"
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
@app.route('/stream/<type>/<id>.json')
|
| 38 |
-
def addon_stream(type, id):
|
| 39 |
-
if type not in MANIFEST['types']:
|
| 40 |
-
abort(404)
|
| 41 |
-
streams = {'streams': []}
|
| 42 |
-
if STREAMINGCOMMUNITY == "1":
|
| 43 |
-
url_streaming_community = streaming_community(id)
|
| 44 |
-
print(url_streaming_community)
|
| 45 |
-
if url_streaming_community is not None:
|
| 46 |
-
streams['streams'].append({'title': 'StreamingCommunity 1080p', 'url': f'{url_streaming_community}?rendition=1080p'})
|
| 47 |
-
streams['streams'].append({'title': 'StreamingCommunity 720p', 'url': f'{url_streaming_community}?rendition=720p'})
|
| 48 |
-
|
| 49 |
-
# If FILMPERTUTTI == 1, scrape that site
|
| 50 |
-
if FILMPERTUTTI == "1":
|
| 51 |
-
url_filmpertutti = filmpertutti(id)
|
| 52 |
-
if url_filmpertutti is not None:
|
| 53 |
-
streams['streams'].append({'title': 'Filmpertutti', 'url': url_filmpertutti})
|
| 54 |
-
|
| 55 |
-
# If no streams were added, abort with a 404 error
|
| 56 |
-
if not streams['streams']:
|
| 57 |
-
abort(404)
|
| 58 |
-
|
| 59 |
-
return respond_with(streams)
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
if __name__ == '__main__':
|
| 63 |
-
app.run(host='0.0.0.0', port=8080)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|