mirror of
https://github.com/g0ldyy/comet.git
synced 2026-01-12 01:16:12 +01:00
feat(debrid/stremthru): pass stremio video id for magnet cache check
This commit is contained in:
@@ -411,6 +411,7 @@ async def stream(
|
||||
season,
|
||||
episode,
|
||||
kitsu,
|
||||
video_id=full_id,
|
||||
)
|
||||
|
||||
ranked_files = set()
|
||||
|
||||
@@ -44,7 +44,7 @@ class AllDebrid:
|
||||
)
|
||||
|
||||
async def get_files(
|
||||
self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool
|
||||
self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool, **kwargs
|
||||
):
|
||||
chunk_size = 500
|
||||
chunks = [
|
||||
|
||||
@@ -48,7 +48,7 @@ class DebridLink:
|
||||
return responses
|
||||
|
||||
async def get_files(
|
||||
self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool
|
||||
self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool, **kwargs
|
||||
):
|
||||
chunk_size = 10
|
||||
chunks = [
|
||||
|
||||
@@ -49,7 +49,7 @@ class Premiumize:
|
||||
)
|
||||
|
||||
async def get_files(
|
||||
self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool
|
||||
self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool, **kwargs
|
||||
):
|
||||
chunk_size = 100
|
||||
chunks = [
|
||||
|
||||
@@ -42,7 +42,7 @@ class RealDebrid:
|
||||
)
|
||||
|
||||
async def get_files(
|
||||
self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool
|
||||
self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool, **kwargs
|
||||
):
|
||||
chunk_size = 100
|
||||
chunks = [
|
||||
|
||||
@@ -58,11 +58,12 @@ class StremThru:
|
||||
|
||||
return False
|
||||
|
||||
async def get_instant(self, magnets: list):
|
||||
async def get_instant(self, magnets: list, sid: Optional[str] = None):
|
||||
try:
|
||||
magnet = await self.session.get(
|
||||
f"{self.base_url}/magnets/check?magnet={','.join(magnets)}&client_ip={self.client_ip}"
|
||||
)
|
||||
url = f"{self.base_url}/magnets/check?magnet={','.join(magnets)}&client_ip={self.client_ip}"
|
||||
if sid:
|
||||
url = f"{url}&sid={sid}"
|
||||
magnet = await self.session.get(url)
|
||||
return await magnet.json()
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
@@ -70,7 +71,14 @@ class StremThru:
|
||||
)
|
||||
|
||||
async def get_files(
|
||||
self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool
|
||||
self,
|
||||
torrent_hashes: list,
|
||||
type: str,
|
||||
season: str,
|
||||
episode: str,
|
||||
kitsu: bool,
|
||||
video_id: Optional[str] = None,
|
||||
**kwargs,
|
||||
):
|
||||
chunk_size = 25
|
||||
chunks = [
|
||||
@@ -80,7 +88,7 @@ class StremThru:
|
||||
|
||||
tasks = []
|
||||
for chunk in chunks:
|
||||
tasks.append(self.get_instant(chunk))
|
||||
tasks.append(self.get_instant(chunk, sid=video_id))
|
||||
|
||||
responses = await asyncio.gather(*tasks)
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class TorBox:
|
||||
)
|
||||
|
||||
async def get_files(
|
||||
self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool
|
||||
self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool, **kwargs
|
||||
):
|
||||
chunk_size = 50
|
||||
chunks = [
|
||||
|
||||
Reference in New Issue
Block a user