File size: 11,217 Bytes
1f9aed5
 
 
 
4aa133b
 
1f9aed5
 
 
0d18203
1f9aed5
bbb2e8f
7474fc1
1f9aed5
 
 
 
 
4aa133b
 
1f9aed5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7f2b288
1f9aed5
 
 
 
db53419
 
 
6270c4d
 
db53419
 
 
6270c4d
 
388f2ec
3cb0665
2041283
 
 
 
3cb0665
 
2041283
333933b
09a0c7c
a66f61a
f16e37f
4b0d9b5
1bf7bcf
2041283
 
 
 
4b0d9b5
2041283
1bf7bcf
 
2041283
09a0c7c
433f04c
a66f61a
4e8927a
cc47f43
433f04c
2041283
 
 
 
 
 
433f04c
 
2041283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6bb5227
 
a66f61a
6bb5227
bae2850
6bb5227
 
 
 
 
 
 
 
 
 
bae2850
 
a66f61a
bae2850
 
 
 
 
 
 
 
 
 
 
 
433f04c
db53419
f07d5fb
 
6bb5227
bae2850
0d18203
bae2850
 
0d18203
 
db53419
 
 
1f9aed5
 
 
 
 
 
 
 
 
 
 
 
 
 
db53419
 
8017fbe
db53419
 
 
 
 
 
 
 
 
c6d4821
 
db53419
 
489ae08
db53419
 
 
275e724
db53419
 
275e724
22c7377
db53419
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9a4355b
db53419
 
1f9aed5
3754d20
1f9aed5
 
ddeaa60
1f9aed5
aaece51
db53419
 
 
0d18203
 
 
 
 
 
2d3a4d3
 
 
 
 
db53419
 
 
1f9aed5
 
 
 
 
 
 
 
f2df960
1f9aed5
f2df960
 
 
 
 
4aa133b
 
 
 
 
 
1f9aed5
 
 
 
 
 
 
 
 
 
4aa133b
 
 
f6820e5
1f9aed5
 
 
 
 
 
 
 
0d18203
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
from flask import Flask, jsonify, abort
from filmpertutti import filmpertutti
from streamingcommunity import streaming_community
from tantifilm import tantifilm
from lordchannel import lordchannel
from streamingwatch import streamingwatch
import json
import config
import logging
from okru import okru_get_url
# Configure logging
logging.basicConfig(level=logging.INFO)

FILMPERTUTTI = config.FILMPERTUTTI
STREAMINGCOMMUNITY = config.STREAMINGCOMMUNITY
MYSTERIUS = config.MYSTERIUS
TUTTIFILM = config.TUTTIFILM
TF_DOMAIN = config.TF_DOMAIN
LORDCHANNEL = config.LORDCHANNEL
STREAMINGWATCH= config.STREAMINGWATCH
HOST = config.HOST
PORT = int(config.PORT)
HF = config.HF
if HF == "1":
    HF = "🤗️"
    #Cool code to set the hugging face if the service is hosted there.
else:
    HF = ""
if MYSTERIUS == "1":
    from cool import cool

app = Flask(__name__)

MANIFEST = {
    "id": "org.stremio.mammamia",
    "version": "1.0.0",
    "catalogs": [
        {"type": "tv", "id": "tv_channels", "name": "TV Channels"}
    ],
    "resources": ["stream", "catalog","meta"],
    "types": ["movie", "series", "tv"],
    "name": "Mamma Mia",
    "description": "Addon providing HTTPS Stream for Italian Movies/Series",
    "logo": "https://creazilla-store.fra1.digitaloceanspaces.com/emojis/49647/pizza-emoji-clipart-md.png"
}
STREAM = {
    "channels": [
        {
            "id": "la7",
            "title": "LA7",
            "url": "https://d3749synfikwkv.cloudfront.net/v1/master/3722c60a815c199d9c0ef36c5b73da68a62b09d1/cc-74ylxpgd78bpb/Live.m3u8"
        },
        {
            "id": "rai1",
            "title": "Rai 1",
            "url": "https://m3u.iranvids.com/rai01/output.m3u8",
            "behaviorHints": {
                "notWebReady": True,
                "proxyHeaders": {
                    "request": {
                        "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
                    }
                }
            }
        },
        {
            "id": "raai2",
            "title": "Rai 2",
            "url": "https://webhdrunns.mizhls.ru/lb/premium851/index.m3u8",
            "behaviorHints": {
                "notWebReady": True,
                "proxyHeaders": {
                    "request": {
                        "Referer": "https://1qwebplay.xyz/",
                        "Origin": "https://1qwebplay.xyz",
                        "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
                    }
                }
            }
        },
        {
            "id": "sky2q4",
            "title": "Sky News 24",
            "url": "https://08-24.mizhls.ru/fls/cdn/calcioXskysport24/playlist.m3u8",
            "behaviorHints": {
                "notWebReady": True,
                "proxyHeaders": {
                    "request": {
                        "Referer": "https://claplivehdplay.ru/",
                        "Origin": "https://claplivehdplay.ru",
                        "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
                    }
                }
            }
        },
        {
            "id": "skysportcalcio",
            "title": "Sky Calcio",
            "url": "https://fdj49sum3z6ht7bp85wg2n.cdnstrength.net:8443/hls/qgdzborpo.m3u8?s=kYZwtESo9NFAg_gjYx3wYg&e=1724261465",
            "behaviorHints": {
                "notWebReady": True,
                "proxyHeaders": {
                    "request": {
                        "Accept": "*/*",
                        "Accept-Language": "it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7",
                        "Connection": "keep-alive",
                        "If-Modified-Since": "Wed, 21 Aug 2024 11:30:59 GMT",
                        "If-None-Match": "\"66c5cff3-359\"",
                        "Origin": "https://swipebreed.net",
                        "Referer": "https://swipebreed.net/",
                        "Sec-Fetch-Dest": "empty",
                        "Sec-Fetch-Mode": "cors",
                        "Sec-Fetch-Site": "cross-site",
                        "User-Agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
                        "sec-ch-ua": "\"Not-A.Brand\";v=\"99\", \"Chromium\";v=\"124\"",
                        "sec-ch-ua-mobile": "?0",
                        "sec-ch-ua-platform": "\"Android\""
                    }
                }
            }
        },
        {
            "id": "sky24",
            "title": "Sky Sport 24 2nd Test",
            "url": "https://webuit.mizhls.ru/lb/calcioXskysport24/index.m3u8",
            "behaviorHints": {
                "notWebReady": True,
                "proxyHeaders": {
                    "request": {
                        "Referer": "https://ilovetoplay.xyz/",
                        "Origin": "https://ilovetoplay.xyz",
                        "User-Agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
                    }
                }
            }
        },
        {
            "id": "rai2",
            "title": "Rai2test",
            "url": "https://webhdrunns.mizhls.ru/lb/premium851/index.m3u8",
            "behaviorHints": {
                "notWebReady": True,
                "proxyHeaders": {
                    "request": {
                        "Referer": "https://qqwebplay.xyz/",
                        "Origin": "https://qqwebplay.xyz",
                        "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
                    }
                }
            }
        }
    ]
}



okru = {
    "rai11": "https://ok.ru/videoembed/7703488765552?nochat=1",
    "rai22": "https://ok.ru/videoembed/7805618364016?nochat=1"
}

MANIFEST["catalogs"].append({"type": "tv", "id": "channels", "name": "Channels"})


def respond_with(data):
    resp = jsonify(data)
    resp.headers['Access-Control-Allow-Origin'] = '*'
    resp.headers['Access-Control-Allow-Headers'] = '*'
    return resp

@app.route('/manifest.json')
def addon_manifest():
    return respond_with(MANIFEST)

@app.route('/')
def root():
    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"

@app.route('/catalog/<type>/<id>.json')
def addon_catalog(type, id):
    if type != "tv":
        abort(404)
    catalogs = {"metas": []}
    for channel in STREAM["channels"]:
        catalogs["metas"].append({
            "id": channel["id"],
            "type": "tv",
            "name": channel["title"],
            "poster": "",  # Add poster URL if available
            "description": f"Watch {channel['title']}"
        })

    return respond_with(catalogs)

@app.route('/meta/<type>/<id>.json')
def addon_meta(type, id):
    if type != "tv":
        abort(404)
    logging.info("WOAH I AM HERE")
    for channel in STREAM["channels"]:
        if channel["id"] == id:
            logging.info("WOAH HERE TOO")
            logging.info(channel['title'])
            meta = {
                "id": id,
                "type": "tv",
                "name": channel["title"],
                "poster": "",  # Add poster URL if available
                "description": f"Watch {channel['title']}",
                "background": "",  # Add background image URL if available
                "logo": "",  # Add logo URL if available
                "videos": [{
                    "title": channel["title"],
                    "streams": [{
                        "title": channel["title"],
                        "url": channel["url"]
                    }]
                }]
            }
            return respond_with(meta)

    abort(404)


@app.route('/stream/<type>/<id>.json')
def addon_stream(type, id):
    if type not in MANIFEST['types']:
        abort(404)
    streams = {'streams': []}
    if type == "tv":
        for channel in STREAM["channels"]:
            if channel["id"] == id:
                if id in okru:
                    channel_url = okru_get_url(id)
                    streams['streams'].append({
                        'title': "okru"+channel['title'],
                        'url': channel_url
                    })
                
                streams['streams'].append({
                    'title': channel['title'],
                    'url': channel['url']
                })
        if not streams['streams']:
            abort(404)
        return respond_with(streams)
    else:
        logging.debug(f"Handling movie or series: {id}")
        if MYSTERIUS == "1":
            results = cool(id)
            if results:
                for resolution, link in results.items():
                    streams['streams'].append({'title': f'{HF}Mysterious {resolution}', 'url': link})
        if STREAMINGCOMMUNITY == "1":
            url_streaming_community,url_720_streaming_community,quality_sc = streaming_community(id)
            if url_streaming_community is not None:
                if quality_sc == "1080":
                    streams['streams'].append({'title': f'{HF}StreamingCommunity 1080p Max', 'url': url_streaming_community})
                    streams['streams'].append({'title': f'{HF}StreamingCommunity 720p Max', 'url': url_720_streaming_community})
                else:
                    streams['streams'].append({'title': f'{HF}StreamingCommunity 720p Max', 'url': url_streaming_community})
        if LORDCHANNEL == "1":
           url_lordchannel,quality_lordchannel =lordchannel(id)
           if quality_lordchannel == "FULL HD" and url_lordchannel !=  None:
              streams['streams'].append({'title': f'{HF}LordChannel 1080p', 'url': url_lordchannel})
           elif url_lordchannel !=  None:
              streams['streams'].append({'title': f'{HF}LordChannel 720p', 'url': url_lordchannel})            
        if FILMPERTUTTI == "1":
            url_filmpertutti = filmpertutti(id)
            if url_filmpertutti is not None:
                streams['streams'].append({'title': 'Filmpertutti', 'url': url_filmpertutti})
        if TUTTIFILM == "1":
            url_tuttifilm = tantifilm(id)
            if url_tuttifilm:
                if not isinstance(url_tuttifilm, str):
                    for title, url in url_tuttifilm.items():    
                        streams['streams'].append({'title': f'{HF}Tantifilm {title}', 'url': url,  'behaviorHints': {'proxyHeaders': {"request": {"Referer": "https://d000d.com/"}}, 'notWebReady': True}})
        if STREAMINGWATCH == "1":
            url_streamingwatch = streamingwatch(id)
            if url_streamingwatch:
                streams['streams'].append({'title': '{HF}StreamingWatch 720p', 'url': url_streamingwatch})
    if not streams['streams']:
        abort(404)

    return respond_with(streams)


    return respond_with({"meta": meta})
if __name__ == '__main__':
    app.run(host=HOST, port=PORT)