Spaces:
Paused
Paused
Delete run.py
Browse files
run.py
DELETED
|
@@ -1,196 +0,0 @@
|
|
| 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","meta"],
|
| 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 |
-
@app.route('/meta/<type>/<id>.json')
|
| 188 |
-
def meta(type, id):
|
| 189 |
-
return respond_with({"meta": {
|
| 190 |
-
"id": id,
|
| 191 |
-
"type": type,
|
| 192 |
-
"name": "Whatever Channel"
|
| 193 |
-
}})
|
| 194 |
-
|
| 195 |
-
if __name__ == '__main__':
|
| 196 |
-
app.run(host=HOST, port=PORT)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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