diff --git a/db/schemas.py b/db/schemas.py
index 50d7d5f..2bef509 100644
--- a/db/schemas.py
+++ b/db/schemas.py
@@ -140,6 +140,13 @@ class StreamingProvider(BaseModel):
"qbittorrent",
"stremthru",
] = Field(alias="sv")
+ stremthru_store_name: Literal[
+ "realdebrid",
+ "debridlink",
+ "alldebrid",
+ "torbox",
+ "premiumize",
+ ] | None = Field(default=None, alias="stsn")
url: HttpUrl | None = Field(default=None, alias="u")
token: str | None = Field(default=None, alias="tk")
email: str | None = Field(default=None, alias="em")
diff --git a/resources/html/configure.html b/resources/html/configure.html
index e6a21eb..5de6b92 100644
--- a/resources/html/configure.html
+++ b/resources/html/configure.html
@@ -138,6 +138,53 @@
+
+
+
+
+ {% set stremthru_stores = [
+ {
+ "value": "",
+ "label": "",
+ },
+ {
+ "value": "torbox",
+ "label": "Torbox",
+ },
+ {
+ "value": "realdebrid",
+ "label": "Real-Debrid",
+ },
+ {
+ "value": "debridlink",
+ "label": "Debrid-Link",
+ },
+ {
+ "value": "premiumize",
+ "label": "Premiumize",
+ },
+ {
+ "value": "alldebrid",
+ "label": "AllDebrid",
+ },
+ ] %}
+
+
+
Don't have an account?
diff --git a/resources/js/config_script.js b/resources/js/config_script.js
index 0f78883..57b850e 100644
--- a/resources/js/config_script.js
+++ b/resources/js/config_script.js
@@ -203,6 +203,7 @@ function updateProviderFields(isChangeEvent = false) {
}
// Toggle visibility of credentials and token input based on provider
+ setElementDisplay('stremthru_config', provider === 'stremthru' ? 'block' : 'none');
if (provider) {
if (servicesRequiringCredentials.includes(provider)) {
setElementDisplay('credentials', 'block');
@@ -349,6 +350,9 @@ function getUserData() {
validateInput('service_url', validateUrl(serviceUrl));
streamingProviderData.url = serviceUrl;
}
+ if (provider === 'stremthru') {
+ streamingProviderData.stremthru_store_name = document.getElementById('stremthru_store_name').value.trim() || null;
+ }
if (servicesRequiringCredentials.includes(provider)) {
validateInput('email', document.getElementById('email').value);
validateInput('password', document.getElementById('password').value);
diff --git a/streaming_providers/cache_helpers.py b/streaming_providers/cache_helpers.py
index 060ecbc..75421e3 100644
--- a/streaming_providers/cache_helpers.py
+++ b/streaming_providers/cache_helpers.py
@@ -18,7 +18,7 @@ async def store_cached_info_hashes(service: str, info_hashes: List[str]) -> None
service: The debrid service name (e.g., 'realdebrid', 'alldebrid')
info_hashes: List of info hashes that are confirmed to be cached
"""
- if not info_hashes:
+ if not info_hashes or service == "stremthru":
return
try:
diff --git a/utils/parser.py b/utils/parser.py
index 2b0de41..7536d74 100644
--- a/utils/parser.py
+++ b/utils/parser.py
@@ -12,7 +12,7 @@ from thefuzz import fuzz
from db.config import settings
from db.models import TorrentStreams, TVStreams
-from db.schemas import Stream, UserData, SortingOption
+from db.schemas import Stream, StreamingProvider, UserData, SortingOption
from streaming_providers import mapper
from streaming_providers.cache_helpers import (
get_cached_status,
@@ -25,6 +25,13 @@ from utils.network import encode_mediaflow_proxy_url
from utils.runtime_const import ADULT_CONTENT_KEYWORDS, TRACKERS, MANIFEST_TEMPLATE
from utils.validation_helper import validate_m3u8_or_mpd_url_with_cache
+def get_cache_service_name(streaming_provider: StreamingProvider):
+ """
+ get service name to use for redis cache retrieval
+ """
+ if streaming_provider.service == "stremthru" and streaming_provider.stremthru_store_name:
+ return streaming_provider.stremthru_store_name
+ return streaming_provider.service
async def filter_and_sort_streams(
streams: list[TorrentStreams], user_data: UserData, user_ip: str | None = None
@@ -87,7 +94,8 @@ async def filter_and_sort_streams(
info_hashes = [stream.id for stream in filtered_streams]
# First check Redis cache
- cached_statuses = await get_cached_status(service, info_hashes)
+ cache_service = get_cache_service_name(user_data.streaming_provider)
+ cached_statuses = await get_cached_status(cache_service, info_hashes)
# Update streams with cached status from Redis
uncached_streams = []