Added a config.json
This commit is contained in:
@@ -1,62 +1,111 @@
|
||||
|
||||
# MammaMia
|
||||
|
||||
|
||||
|
||||
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.
|
||||
|
||||
Hosting your own instance is suggested but you can use the public instance [linked](https://mammamia-urlo-mammamia.hf.space/) in the About Page of the repo.
|
||||
|
||||
|
||||
|
||||
# Installation
|
||||
|
||||
## Local
|
||||
|
||||
Install required packages
|
||||
|
||||
|
||||
|
||||
``
|
||||
|
||||
pip install -r requirements.txt
|
||||
|
||||
``
|
||||
|
||||
|
||||
|
||||
Then to start the Flask server just execute:
|
||||
|
||||
``
|
||||
|
||||
python3 run.py
|
||||
|
||||
``
|
||||
|
||||
## Hugging Face
|
||||
|
||||
To host this project with Hugging Face, go to the [linked](https://huggingface.co/spaces/MammaMia-Urlo/MammaMia/) page and follow these steps
|
||||
|
||||
1. Create an Hugging Face Account
|
||||
2. Click on three dots on the top (right) part of the screen
|
||||
3. Click Duplicate this Space
|
||||
4. Insert TMDB Key
|
||||
5. Clone the Project
|
||||
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
|
||||
8. Do not forget to add /manifest.json
|
||||
On Hugging Face you are forced to use the 8080 port because it is the only one allowed to send/get network requests.
|
||||
|
||||
|
||||
1. Create an Hugging Face Account
|
||||
|
||||
2. Click on three dots on the top (right) part of the screen
|
||||
|
||||
3. Click Duplicate this Space
|
||||
|
||||
4. Insert TMDB Key
|
||||
|
||||
5. Clone the Project
|
||||
|
||||
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
|
||||
|
||||
8. Do not forget to add /manifest.json
|
||||
|
||||
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)
|
||||
|
||||
## Render
|
||||
|
||||
To install this project on [Render](https://render.com/) follow these steps:
|
||||
1. Create an Account
|
||||
2. Create a Web Service
|
||||
3. Clone the repo
|
||||
4. Among the other environment variables, put PORT = 8080. This is needed because render needs the Port given as an environment variable.
|
||||
5. As build command put `` pip install -r requirements `` and as run command put ``python3 run.py ``
|
||||
6. Then just finish Render Setup and you are done :)
|
||||
|
||||
1. Create an Account
|
||||
|
||||
2. Create a Web Service
|
||||
|
||||
3. Clone the repo
|
||||
|
||||
4. Among the other environment variables, put PORT = 8080. This is needed because render needs the Port given as an environment variable.
|
||||
|
||||
5. As build command put `` pip install -r requirements `` and as run command put ``python3 run.py ``
|
||||
|
||||
6. Then just finish Render Setup and you are done :)
|
||||
Remember, load_env needs to be disabled in the config.json
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# How to add to Stremio
|
||||
|
||||
Just paste the URL/manifest.json in your search bar.
|
||||
|
||||
# Enviroment Variables
|
||||
|
||||
|
||||
|
||||
| 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
|
||||
|
||||
# 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:
|
||||
| Enviroment Variable | 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 TuttiFilm Provider but in case there are two movies/series with the exactly same name then it might take the wrong one|
|
||||
|load_env|Put "1" if enabled, "0" if disabled. It needs to be enable if you need to load a .env file. On remote hosting services, like Hugging Face or Render, it needs to be disabled. |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+21
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"Siti": {
|
||||
"StreamingCommunity": {
|
||||
"enabled": "1",
|
||||
"domain": "boston"
|
||||
},
|
||||
"Filmpertutti": {
|
||||
"enabled": "1",
|
||||
"domain": "casino"
|
||||
},
|
||||
"Tuttifilm":{
|
||||
"enabled": "1",
|
||||
"domain": "bond",
|
||||
"fast_search": "0"
|
||||
}
|
||||
},
|
||||
"General":{
|
||||
"load_env": "1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#LOAD THE CONFIG
|
||||
import json
|
||||
|
||||
# Open the configuration file
|
||||
with open('config.json') as f:
|
||||
# Load JSON data from file
|
||||
config = json.load(f)
|
||||
|
||||
# Accessing SC_DOMAIN
|
||||
SITE = config["Siti"]
|
||||
FT_DOMAIN = SITE["Filmpertutti"]['domain']
|
||||
SC_DOMAIN = SITE["StreamingCommunity"]['domain']
|
||||
TF_DOMAIN = SITE["Filmpertutti"]['enabled']
|
||||
FILMPERTUTTI = SITE["Filmpertutti"]['enabled']
|
||||
STREAMINGCOMMUNITY = SITE["StreamingCommunity"]['enabled']
|
||||
#General
|
||||
GENERAL = config['General']
|
||||
dotenv = GENERAL["load_env"]
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import requests
|
||||
from tmdbv3api import TMDb, Movie, TV
|
||||
from loadenv import load_env
|
||||
TMDB_KEY, _, _, _,_ = load_env()
|
||||
TMDB_KEY= load_env()
|
||||
def get_TMDb_id_from_IMDb_id(imdb_id):
|
||||
response = requests.get(f'https://api.themoviedb.org/3/find/{imdb_id}',
|
||||
params={'external_source': 'imdb_id', 'api_key': f'{TMDB_KEY}'})
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
TMDB_KEY= "INSERT YOUR API KEY HERE"
|
||||
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"
|
||||
|
||||
|
||||
|
||||
+3
-2
@@ -7,12 +7,13 @@ import re
|
||||
from datetime import datetime
|
||||
import dateparser
|
||||
from convert import get_TMDb_id_from_IMDb_id
|
||||
from loadenv import load_env
|
||||
from info import get_info, is_movie
|
||||
from convert_date import convert_US_date
|
||||
import logging
|
||||
import config
|
||||
|
||||
FT_DOMAIN = config.FT_DOMAIN
|
||||
|
||||
_, FT_DOMAIN,_,_ ,_= load_env()
|
||||
#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',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from loadenv import load_env
|
||||
from tmdbv3api import TMDb, Movie, TV
|
||||
from convert_date import convert_US_date, convert_IT_date
|
||||
TMDB_KEY,_,_,FILMPERTUTTI,STREAMINGCOMMUNITY = load_env()
|
||||
TMDB_KEY= load_env()
|
||||
|
||||
def get_info(tmbda,ismovie,type):
|
||||
tmdb = TMDb()
|
||||
|
||||
+10
-7
@@ -1,10 +1,13 @@
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
load_dotenv(".env")
|
||||
import config
|
||||
|
||||
dotenv = config.dotenv
|
||||
#You need to keep dotenv disabled on remote servers
|
||||
if dotenv == "1":
|
||||
from dotenv import load_dotenv
|
||||
load_dotenv(".env")
|
||||
|
||||
|
||||
def load_env():
|
||||
TMDB_KEY = os.getenv('TMDB_KEY')
|
||||
FT_DOMAIN = os.getenv('FT_DOMAIN')
|
||||
SC_DOMAIN= os.getenv('SC_DOMAIN')
|
||||
FILMPERTUTTI = os.getenv('FILMPERTUTTI')
|
||||
STREAMINGCOMMUNITY = os.getenv('STREAMINGCOMMUNITY')
|
||||
return TMDB_KEY, FT_DOMAIN, SC_DOMAIN, FILMPERTUTTI, STREAMINGCOMMUNITY
|
||||
return TMDB_KEY
|
||||
@@ -1,8 +1,12 @@
|
||||
from flask import Flask, jsonify, abort
|
||||
from filmpertutti import filmpertutti
|
||||
from streamingcommunity import streaming_community
|
||||
from loadenv import load_env
|
||||
TMDB_KEY, FT_DOMAIN, SC_DOMAIN, FILMPERTUTTI, STREAMINGCOMMUNITY = load_env()
|
||||
import json
|
||||
import config
|
||||
|
||||
FILMPERTUTTI = config.FILMPERTUTTI
|
||||
STREAMINGCOMMUNITY = config.STREAMINGCOMMUNITY
|
||||
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@@ -5,10 +5,10 @@ from bs4 import BeautifulSoup,SoupStrainer
|
||||
from datetime import datetime
|
||||
import dateparser
|
||||
from convert import get_TMDb_id_from_IMDb_id
|
||||
from loadenv import load_env
|
||||
from info import get_info, is_movie
|
||||
import config
|
||||
#Get domain
|
||||
_, _,SC_DOMAIN,_ ,_= load_env()
|
||||
SC_DOMAIN= config.SC_DOMAIN
|
||||
|
||||
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',
|
||||
@@ -83,7 +83,7 @@ def streaming_community(imdb):
|
||||
tmdba = get_TMDb_id_from_IMDb_id(imdb_id)
|
||||
showname = requests.get(f'https://v3.sg.media-imdb.com/suggestion/a/{imdb_id}.json')
|
||||
showname = showname.json()
|
||||
showname = showname['d'][0]['l']
|
||||
showname = showname['d'][-1]['l']
|
||||
else:
|
||||
#else just equals them
|
||||
tmdba = imdb_id.replace("tmdb:","")
|
||||
|
||||
Reference in New Issue
Block a user