diff --git a/pyproject.toml b/pyproject.toml index 982a1fa..1f816b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "stream-fusion" -version = "2.2.0" +version = "2.2.1" description = "StreamFusion is an advanced plugin for Stremio that significantly enhances its streaming capabilities with debrid service." authors = ["LimeDrive "] readme = "README.md" diff --git a/stream_fusion/services/postgresql/models/torrentitem_model.py b/stream_fusion/services/postgresql/models/torrentitem_model.py index 547b914..098fb0b 100644 --- a/stream_fusion/services/postgresql/models/torrentitem_model.py +++ b/stream_fusion/services/postgresql/models/torrentitem_model.py @@ -72,6 +72,8 @@ def from_torrent_item(cls, torrent_item: TorrentItem): model_dict[attr] = value.model_dump() if value else None elif attr == "availability": model_dict[attr] = False + elif attr == "seeders": + model_dict[attr] = int(value) if value else 0 else: model_dict[attr] = value diff --git a/stream_fusion/settings.py b/stream_fusion/settings.py index 69a9b84..d08748a 100644 --- a/stream_fusion/settings.py +++ b/stream_fusion/settings.py @@ -20,9 +20,9 @@ class LogLevel(str, enum.Enum): class DebridService(str, enum.Enum): """Possible debrid services.""" - RD = "RD" - AD = "AD" - TB = "TB" + RD = "Real-Debrid" + AD = "AllDebrid" + TB = "TorBox" class NoCacheVideoLanguages(str, enum.Enum): @@ -70,7 +70,7 @@ class Settings(BaseSettings): ) ) use_https: bool = False - download_service: DebridService = DebridService.TB + download_service: DebridService | None = None no_cache_video_language: NoCacheVideoLanguages = NoCacheVideoLanguages.FR # PROXY diff --git a/stream_fusion/utils/debrid/get_debrid_service.py b/stream_fusion/utils/debrid/get_debrid_service.py index 43cc251..871a9fe 100644 --- a/stream_fusion/utils/debrid/get_debrid_service.py +++ b/stream_fusion/utils/debrid/get_debrid_service.py @@ -36,11 +36,11 @@ def get_download_service(config): if not service: logger.error("No download service found in the user config.") return - if service == "RD": + if service == "Real-Debrid": return RealDebrid(config) - elif service == "AD": + elif service == "AllDebrid": return AllDebrid(config) - elif service == "TB": + elif service == "TorBox": return Torbox(config) else: logger.error("Invalid service configuration return by stremio in the query.") diff --git a/stream_fusion/web/lifespan.py b/stream_fusion/web/lifespan.py index fe526b3..3996b0c 100644 --- a/stream_fusion/web/lifespan.py +++ b/stream_fusion/web/lifespan.py @@ -62,12 +62,8 @@ async def lifespan_setup( if settings.playback_proxy and settings.proxy_url: parsed_url = URL(settings.proxy_url) - if parsed_url.scheme in ("socks5", "socks5h", "socks4"): - connector = ProxyConnector.from_url(settings.proxy_url, limit=100, limit_per_host=50) - elif parsed_url.scheme in ("http", "https"): - connector = aiohttp.TCPConnector( - limit=100, limit_per_host=50, proxy=settings.proxy_url - ) + if parsed_url.scheme in ("socks5", "socks5h", "socks4", "http", "https"): + connector = ProxyConnector.from_url(parsed_url, limit=100, limit_per_host=50) else: raise ValueError(f"Unsupported proxy scheme: {parsed_url.scheme}") else: diff --git a/stream_fusion/web/root/search/views.py b/stream_fusion/web/root/search/views.py index 67af062..e1b7de2 100644 --- a/stream_fusion/web/root/search/views.py +++ b/stream_fusion/web/root/search/views.py @@ -316,7 +316,7 @@ def stream_processing(search_results, media, config): stream_list = stream_processing(search_results, media, config) streams = [Stream(**stream) for stream in stream_list] - await redis_cache.set(stream_cache_key(media), streams, expiration=3600) + await redis_cache.set(stream_cache_key(media), streams, expiration=1200) total_time = time.time() - start logger.info(f"Search: Request completed in {total_time:.2f} seconds") return SearchResponse(streams=streams)