diff --git a/comet/scrapers/aiostreams.py b/comet/scrapers/aiostreams.py index 9429245..5aaf821 100644 --- a/comet/scrapers/aiostreams.py +++ b/comet/scrapers/aiostreams.py @@ -40,4 +40,4 @@ async def get_aiostreams(manager, url: str, uuid_password: str | None = None): except Exception as e: log_scraper_error("AIOStreams", url, manager.media_id, e) - await manager.filter_manager(torrents) + await manager.filter_manager("AIOStreams", torrents) diff --git a/comet/scrapers/bitmagnet.py b/comet/scrapers/bitmagnet.py index ed59b42..26f5759 100644 --- a/comet/scrapers/bitmagnet.py +++ b/comet/scrapers/bitmagnet.py @@ -98,4 +98,4 @@ async def get_bitmagnet(manager, session: aiohttp.ClientSession, url: str): offset += batch_size * limit - await manager.filter_manager(torrents) + await manager.filter_manager("BitMagnet", torrents) diff --git a/comet/scrapers/comet.py b/comet/scrapers/comet.py index bca1620..e97eec1 100644 --- a/comet/scrapers/comet.py +++ b/comet/scrapers/comet.py @@ -37,4 +37,4 @@ async def get_comet(manager, url: str): log_scraper_error("Comet", url, manager.media_id, e) pass - await manager.filter_manager(torrents) + await manager.filter_manager("Comet", torrents) diff --git a/comet/scrapers/debridio.py b/comet/scrapers/debridio.py index a28d924..edc17d0 100644 --- a/comet/scrapers/debridio.py +++ b/comet/scrapers/debridio.py @@ -43,4 +43,4 @@ async def get_debridio(manager, session: aiohttp.ClientSession): "Debridio", settings.DEBRIDIO_API_KEY, manager.media_only_id, e ) - await manager.filter_manager(torrents) + await manager.filter_manager("Debridio", torrents) diff --git a/comet/scrapers/jackett.py b/comet/scrapers/jackett.py index 8075321..2bb5a64 100644 --- a/comet/scrapers/jackett.py +++ b/comet/scrapers/jackett.py @@ -125,4 +125,4 @@ async def get_jackett(manager, session: aiohttp.ClientSession, title: str, seen: f"Exception while getting torrents for {title} with Jackett: {e}" ) - await manager.filter_manager(torrents) + await manager.filter_manager("Jackett", torrents) diff --git a/comet/scrapers/jackettio.py b/comet/scrapers/jackettio.py index 611ed65..b5463d1 100644 --- a/comet/scrapers/jackettio.py +++ b/comet/scrapers/jackettio.py @@ -44,4 +44,4 @@ async def get_jackettio(manager, url: str): except Exception as e: log_scraper_error("Jackettio", url, manager.media_id, e) - await manager.filter_manager(torrents) + await manager.filter_manager("Jackettio", torrents) diff --git a/comet/scrapers/manager.py b/comet/scrapers/manager.py index 18c9883..62e1f15 100644 --- a/comet/scrapers/manager.py +++ b/comet/scrapers/manager.py @@ -260,8 +260,9 @@ class TorrentManager: torrent["parsed"] = parsed self.ready_to_cache.append(torrent) - async def filter_manager(self, torrents: list): + async def filter_manager(self, scraper_name: str, torrents: list): if len(torrents) == 0: + logger.log("SCRAPER", f"Scraper {scraper_name} found 0 torrents.") return new_torrents = [ @@ -269,12 +270,11 @@ class TorrentManager: for torrent in torrents if (torrent["infoHash"], torrent["title"]) not in self.seen_hashes ] - + self.seen_hashes.update( (torrent["infoHash"], torrent["title"]) for torrent in new_torrents ) - scraper_name = torrents[0]["tracker"].split("|")[0] logger.log( "SCRAPER", f"Scraper {scraper_name} found {len(torrents)} torrents, {len(new_torrents)} new.", diff --git a/comet/scrapers/mediafusion.py b/comet/scrapers/mediafusion.py index c054707..6883c9c 100644 --- a/comet/scrapers/mediafusion.py +++ b/comet/scrapers/mediafusion.py @@ -44,4 +44,4 @@ async def get_mediafusion(manager, url: str, api_password: str | None): log_scraper_error("MediaFusion", url, manager.media_id, e) pass - await manager.filter_manager(torrents) + await manager.filter_manager("MediaFusion", torrents) diff --git a/comet/scrapers/nyaa.py b/comet/scrapers/nyaa.py index 4371064..11e2c56 100644 --- a/comet/scrapers/nyaa.py +++ b/comet/scrapers/nyaa.py @@ -123,4 +123,4 @@ async def get_nyaa(manager): except Exception as e: log_scraper_error("Nyaa", "https://nyaa.si", manager.media_id, e) - await manager.filter_manager(torrents) + await manager.filter_manager("Nyaa", torrents) diff --git a/comet/scrapers/prowlarr.py b/comet/scrapers/prowlarr.py index 73f8f9c..11dec07 100644 --- a/comet/scrapers/prowlarr.py +++ b/comet/scrapers/prowlarr.py @@ -121,4 +121,4 @@ async def get_prowlarr(manager, session: aiohttp.ClientSession, title: str, seen f"Exception while getting torrents for {title} with Prowlarr: {e}" ) - await manager.filter_manager(torrents) + await manager.filter_manager("Prowlarr", torrents) diff --git a/comet/scrapers/stremthru.py b/comet/scrapers/stremthru.py index 5be6c36..e0fb300 100644 --- a/comet/scrapers/stremthru.py +++ b/comet/scrapers/stremthru.py @@ -57,4 +57,4 @@ async def get_stremthru(manager, session: aiohttp.ClientSession, url: str): except Exception as e: log_scraper_error("StremThru", url, manager.media_only_id, e) - await manager.filter_manager(torrents) + await manager.filter_manager("StremThru", torrents) diff --git a/comet/scrapers/torbox.py b/comet/scrapers/torbox.py index 4ffdd2c..f0f7b81 100644 --- a/comet/scrapers/torbox.py +++ b/comet/scrapers/torbox.py @@ -30,4 +30,4 @@ async def get_torbox(manager, session: aiohttp.ClientSession): except Exception as e: log_scraper_error("TorBox", settings.TORBOX_API_KEY, manager.media_only_id, e) - await manager.filter_manager(torrents) + await manager.filter_manager("TorBox", torrents) diff --git a/comet/scrapers/torrentio.py b/comet/scrapers/torrentio.py index 66a8895..4b92738 100644 --- a/comet/scrapers/torrentio.py +++ b/comet/scrapers/torrentio.py @@ -48,4 +48,4 @@ async def get_torrentio(manager, url: str): except Exception as e: log_scraper_error("Torrentio", url, manager.media_id, e) - await manager.filter_manager(torrents) + await manager.filter_manager("Torrentio", torrents) diff --git a/comet/scrapers/zilean.py b/comet/scrapers/zilean.py index 3a8658f..0d5319c 100644 --- a/comet/scrapers/zilean.py +++ b/comet/scrapers/zilean.py @@ -31,4 +31,4 @@ async def get_zilean(manager, session: aiohttp.ClientSession, url: str): f"Exception while getting torrents for {manager.title} with Zilean ({url}): {e}" ) - await manager.filter_manager(torrents) + await manager.filter_manager("Zilean", torrents)