Skip to content

Commit

Permalink
feat: custom MediaFusion urls for elfhosted <3
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ldyy committed Nov 14, 2024
1 parent 9bb4a4e commit bc29eb9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ZILEAN_URL=None # for DMM search - https://github.com/iPromKnight/zilean - ex: h
ZILEAN_TAKE_FIRST=500 # only change it if you know what it is
SCRAPE_TORRENTIO=False # scrape Torrentio
SCRAPE_MEDIAFUSION=False # scrape MediaFusion - has better results for Indian content
MEDIAFUSION_URL=https://mediafusion.elfhosted.com # Allows you to scrape custom instances of MediaFusion
PROXY_DEBRID_STREAM=False # Proxy Debrid Streams (very useful to use your debrid service on multiple IPs at same time)
PROXY_DEBRID_STREAM_PASSWORD=CHANGE_ME # Secret password to enter on configuration page to prevent people from abusing your debrid stream proxy
PROXY_DEBRID_STREAM_MAX_CONNECTIONS=100 # IP-Based connection limit for the Debrid Stream Proxy
Expand Down
5 changes: 4 additions & 1 deletion comet/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ def start_log():
logger.log("COMET", "Zilean: False")

logger.log("COMET", f"Torrentio Scraper: {bool(settings.SCRAPE_TORRENTIO)}")
logger.log("COMET", f"MediaFusion Scraper: {bool(settings.SCRAPE_MEDIAFUSION)}")

mediafusion_url = f" - {settings.MEDIAFUSION_URL}"
logger.log("COMET", f"MediaFusion Scraper: {bool(settings.SCRAPE_MEDIAFUSION)}{mediafusion_url if settings.SCRAPE_MEDIAFUSION else ''}")

logger.log(
"COMET",
f"Debrid Stream Proxy: {bool(settings.PROXY_DEBRID_STREAM)} - Password: {settings.PROXY_DEBRID_STREAM_PASSWORD} - Max Connections: {settings.PROXY_DEBRID_STREAM_MAX_CONNECTIONS} - Default Debrid Service: {settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_SERVICE} - Default Debrid API Key: {settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_APIKEY}",
Expand Down
5 changes: 2 additions & 3 deletions comet/utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,15 +426,14 @@ async def get_torrentio(log_name: str, type: str, full_id: str):

async def get_mediafusion(log_name: str, type: str, full_id: str):
results = []
# https://mediafusion.elfhosted.com/stream/series/tt0903747:1:2.json
try:
try:
get_mediafusion = requests.get(
f"https://mediafusion.elfhosted.com/stream/{type}/{full_id}.json"
f"{settings.MEDIAFUSION_URL}/stream/{type}/{full_id}.json"
).json()
except:
get_mediafusion = requests.get(
f"https://mediafusion.elfhosted.com/stream/{type}/{full_id}.json",
f"{settings.MEDIAFUSION_URL}/stream/{type}/{full_id}.json",
proxies={
"http": settings.DEBRID_PROXY_URL,
"https": settings.DEBRID_PROXY_URL,
Expand Down
3 changes: 2 additions & 1 deletion comet/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AppSettings(BaseSettings):
DATABASE_PATH: Optional[str] = "data/comet.db"
CACHE_TTL: Optional[int] = 86400
DEBRID_PROXY_URL: Optional[str] = None
INDEXER_MANAGER_TYPE: Optional[str] = "jackett"
INDEXER_MANAGER_TYPE: Optional[str] = None
INDEXER_MANAGER_URL: Optional[str] = "http://127.0.0.1:9117"
INDEXER_MANAGER_API_KEY: Optional[str] = None
INDEXER_MANAGER_TIMEOUT: Optional[int] = 30
Expand All @@ -33,6 +33,7 @@ class AppSettings(BaseSettings):
ZILEAN_TAKE_FIRST: Optional[int] = 500
SCRAPE_TORRENTIO: Optional[bool] = False
SCRAPE_MEDIAFUSION: Optional[bool] = False
MEDIAFUSION_URL: Optional[str] = "https://mediafusion.elfhosted.com"
CUSTOM_HEADER_HTML: Optional[str] = None
PROXY_DEBRID_STREAM: Optional[bool] = False
PROXY_DEBRID_STREAM_PASSWORD: Optional[str] = None
Expand Down

0 comments on commit bc29eb9

Please sign in to comment.