Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.2.1 #66

Merged
merged 6 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 2 additions & 0 deletions stream_fusion/services/postgresql/models/torrentitem_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions stream_fusion/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stream_fusion/utils/debrid/get_debrid_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
8 changes: 2 additions & 6 deletions stream_fusion/web/lifespan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion stream_fusion/web/root/search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)