Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #52 from LimeDrive:develop
Browse files Browse the repository at this point in the history
Add priority and download selection on debrid services
  • Loading branch information
LimeDrive authored Oct 2, 2024
2 parents 73583c5 + 297a50d commit fde3631
Show file tree
Hide file tree
Showing 10 changed files with 973 additions and 732 deletions.
1,045 changes: 513 additions & 532 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "stream-fusion"
version = "2.0.5"
version = "2.1.0"
description = "StreamFusion is an advanced plugin for Stremio that significantly enhances its streaming capabilities with debrid service."
authors = ["LimeDrive <[email protected]>"]
readme = "README.md"
Expand Down Expand Up @@ -35,7 +35,7 @@ timeout-decorator = "^0.5.0"
tenacity = "^8.5.0"
aiohttp-socks = "^0.8.4"
tmdbv3api = "^1.9.0"
rank-torrent-name = "^1.0.4"
rank-torrent-name = "^1.2.0"
orjson = "^3.10.7"
alembic = "^1.13.2"
ujson = "^5.10.0"
Expand Down
18 changes: 16 additions & 2 deletions stream_fusion/settings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import enum
import multiprocessing
import os
from pydantic import Field, ValidationError
from pydantic import Field, ValidationError, field_validator
from pydantic_settings import BaseSettings, SettingsConfigDict
from yarl import URL

Expand Down Expand Up @@ -57,7 +57,7 @@ class Settings(BaseSettings):

# PROXY
proxied_link: bool = check_env_variable("RD_TOKEN") or check_env_variable("AD_TOKEN")
proxy_url: str | None = None
proxy_url: str | URL | None = None
playback_proxy: bool | None = (
None # If set, the link will be proxied through the given proxy.
)
Expand Down Expand Up @@ -139,6 +139,20 @@ class Settings(BaseSettings):
develop: bool = False
reload: bool = False

@field_validator('proxy_url')
@classmethod
def validate_and_create_proxy_url(cls, v: str | None) -> URL | None:
if v is None:
return None

v = v.strip('"\'')
if not v.startswith(('http://', 'https://')):
v = 'http://' + v
try:
return URL(v)
except ValueError as e:
raise ValueError(f"Invalid proxy URL: {e}")

@property
def pg_url(self) -> URL:
"""
Expand Down
Loading

0 comments on commit fde3631

Please sign in to comment.