- 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>
20 lines
620 B
Python
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}")
|