mirror of
https://github.com/g0ldyy/comet.git
synced 2026-01-12 01:16:12 +01:00
Merge pull request #329 from g0ldyy/debridio-scraper
feat: debridio scraper
This commit is contained in:
@@ -124,6 +124,9 @@ JACKETTIO_URL=https://jackettio.example.com # Full manifest URL without /manifes
|
||||
# Multi-instance example:
|
||||
# JACKETTIO_URL='["https://jackettio1.example.com", "https://jackettio2.example.com"]'
|
||||
|
||||
SCRAPE_DEBRIDIO=True
|
||||
DEBRIDIO_API_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
|
||||
# ============================== #
|
||||
# Debrid Stream Proxy Settings #
|
||||
# ============================== #
|
||||
|
||||
@@ -5,11 +5,7 @@
|
||||
- The first Stremio addon to Proxy Debrid Streams to allow use of the Debrid Service on multiple IPs at the same time on the same account!
|
||||
- IP-Based Max Connection Limit
|
||||
- Administration Dashboard with Bandwidth Manager, Metrics and more...
|
||||
- Jackett and Prowlarr support
|
||||
- [Zilean](https://github.com/iPromKnight/zilean) Scraper
|
||||
- [Torrentio](https://torrentio.strem.fun/) Scraper
|
||||
- [MediaFusion](https://mediafusion.elfhosted.com/) Scraper
|
||||
- [Stremthru](https://github.com/MunifTanjim/stremthru/) Scraper
|
||||
- Supported Scrapers: Jackett, Prowlarr, Torrentio, Zilean, MediaFusion, Debridio, StremThru, AIOStreams, Comet, Jackettio
|
||||
- Caching system ft. SQLite / PostgreSQL
|
||||
- Blazing Fast Background Scraper
|
||||
- Smart Torrent Ranking powered by [RTN](https://github.com/dreulavelle/rank-torrent-name)
|
||||
|
||||
@@ -242,6 +242,14 @@ def start_log():
|
||||
f"Jackettio Scraper: {bool(settings.SCRAPE_JACKETTIO)}{jackettio_url}",
|
||||
)
|
||||
|
||||
debridio_api_key = (
|
||||
f" - {settings.DEBRIDIO_API_KEY}" if settings.SCRAPE_DEBRIDIO else ""
|
||||
)
|
||||
logger.log(
|
||||
"COMET",
|
||||
f"Debridio Scraper: {bool(settings.SCRAPE_DEBRIDIO)}{debridio_api_key}",
|
||||
)
|
||||
|
||||
logger.log(
|
||||
"COMET",
|
||||
f"Debrid Stream Proxy: {bool(settings.PROXY_DEBRID_STREAM)} - Password: {settings.PROXY_DEBRID_STREAM_PASSWORD} - Max Connections: {settings.PROXY_DEBRID_STREAM_MAX_CONNECTIONS} - Default Debrid Service: {settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_SERVICE} - Default Debrid API Key: {settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_APIKEY}",
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import aiohttp
|
||||
|
||||
from comet.utils.general import log_scraper_error, size_to_bytes
|
||||
from comet.utils.torrent import extract_trackers_from_magnet
|
||||
from comet.utils.models import settings
|
||||
|
||||
|
||||
async def get_debridio(manager, session: aiohttp.ClientSession):
|
||||
torrents = []
|
||||
|
||||
try:
|
||||
data = await session.get(
|
||||
f"https://debapi.debridio.com/{settings.DEBRIDIO_API_KEY}/search/{manager.media_only_id}"
|
||||
)
|
||||
data = await data.json()
|
||||
|
||||
for torrent in data:
|
||||
size = torrent["size"]
|
||||
if isinstance(size, str):
|
||||
size = size_to_bytes(size)
|
||||
elif isinstance(size, int):
|
||||
pass
|
||||
else:
|
||||
size = None
|
||||
|
||||
torrents.append(
|
||||
{
|
||||
"title": torrent["name"],
|
||||
"infoHash": torrent["hash"],
|
||||
"fileIndex": None,
|
||||
"seeders": torrent["seeders"],
|
||||
"size": size,
|
||||
"tracker": f"Debridio|{torrent['indexer']}",
|
||||
"sources": extract_trackers_from_magnet(torrent["magnet"]),
|
||||
}
|
||||
)
|
||||
except Exception as e:
|
||||
log_scraper_error(
|
||||
"Debridio", settings.DEBRIDIO_API_KEY, manager.media_only_id, e
|
||||
)
|
||||
|
||||
await manager.filter_manager(torrents)
|
||||
@@ -1,6 +1,5 @@
|
||||
import re
|
||||
|
||||
|
||||
from comet.utils.general import (
|
||||
size_to_bytes,
|
||||
log_scraper_error,
|
||||
|
||||
@@ -28,6 +28,7 @@ from .comet import get_comet
|
||||
from .stremthru import get_stremthru
|
||||
from .aiostreams import get_aiostreams
|
||||
from .jackettio import get_jackettio
|
||||
from .debridio import get_debridio
|
||||
|
||||
|
||||
class TorrentManager:
|
||||
@@ -85,6 +86,8 @@ class TorrentManager:
|
||||
tasks.extend(get_all_aiostreams_tasks(self))
|
||||
if settings.SCRAPE_JACKETTIO:
|
||||
tasks.extend(get_all_jackettio_tasks(self))
|
||||
if settings.SCRAPE_DEBRIDIO:
|
||||
tasks.append(get_debridio(self, session))
|
||||
if settings.INDEXER_MANAGER_API_KEY:
|
||||
queries = [self.title]
|
||||
|
||||
|
||||
@@ -70,6 +70,8 @@ class AppSettings(BaseSettings):
|
||||
AIOSTREAMS_URL: Optional[Union[str, List[str]]] = None
|
||||
SCRAPE_JACKETTIO: Optional[bool] = False
|
||||
JACKETTIO_URL: Optional[Union[str, List[str]]] = None
|
||||
SCRAPE_DEBRIDIO: Optional[bool] = False
|
||||
DEBRIDIO_API_KEY: Optional[str] = None
|
||||
CUSTOM_HEADER_HTML: Optional[str] = None
|
||||
PROXY_DEBRID_STREAM: Optional[bool] = False
|
||||
PROXY_DEBRID_STREAM_PASSWORD: Optional[str] = "".join(
|
||||
@@ -106,7 +108,7 @@ class AppSettings(BaseSettings):
|
||||
"TORRENTIO_URL",
|
||||
"MEDIAFUSION_URL",
|
||||
"AIOSTREAMS_URL",
|
||||
"JACKETTIO_URL"
|
||||
"JACKETTIO_URL",
|
||||
)
|
||||
def normalize_urls(cls, v):
|
||||
if isinstance(v, str):
|
||||
|
||||
Reference in New Issue
Block a user