app/collectors/trackerslist.py (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
from __future__ import annotations
import httpx
from sqlalchemy.ext.asyncio import AsyncSession
from app.collectors.base import EnrichmentFeed, ImportStats, import_source_feeds
from app.config import Settings
SOURCE_NAME = "trackerslist"
class TrackerslistCollector:
name = SOURCE_NAME
async def import_once(
self, session: AsyncSession, client: httpx.AsyncClient, settings: Settings
) -> ImportStats:
return await import_source_feeds(
session,
client,
source_name=SOURCE_NAME,
primary_url=settings.trackerslist_all_url,
enrichments=[EnrichmentFeed(url=settings.trackerslist_best_url, is_best=True)],
)
|