novela/containers/novela/scrapers/__init__.py
Ivo Oskamp e4d2e2c636 DB-stored books, full-text search, backup restore, and AO3 scraper
- DB-stored books (Fase 1–6): chapters and images stored in PostgreSQL; grabber writes to DB, EPUB→DB conversion, DB→EPUB export, FTS search page (/search)
- Chapter editor: Monaco editor supports DB-stored books; inline title editing
- Grabber: DB/EPUB storage toggle on Convert page
- Backup: restore from Dropbox snapshot (browse snapshots, restore individual or selected files)
- AO3 scraper: initial implementation
- Changelog: v0.1.2 and v0.1.3 entries added to changelog.py and changelog.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 15:13:08 +02:00

20 lines
620 B
Python

from .base import BaseScraper
from .archiveofourown import ArchiveOfOurOwnScraper
from .awesomedude import AwesomeDudeScraper
from .gayauthors import GayAuthorsScraper
# Register scrapers in priority order (first match wins)
_SCRAPERS: list[type[BaseScraper]] = [
ArchiveOfOurOwnScraper,
AwesomeDudeScraper,
GayAuthorsScraper,
]
def get_scraper(url: str) -> BaseScraper:
"""Return the appropriate scraper instance for the given URL."""
for scraper_cls in _SCRAPERS:
if scraper_cls.matches(url):
return scraper_cls()
raise ValueError(f"No scraper available for URL: {url}")