output to out/feeds/*
This commit is contained in:
parent
beac981047
commit
6fd3b598ab
11 changed files with 298 additions and 16 deletions
|
|
@ -30,6 +30,14 @@ class RepublisherConfig:
|
|||
scrapy_settings: dict[str, Any]
|
||||
|
||||
|
||||
def feed_output_dir(*, out_dir: Path, feed_slug: str) -> Path:
|
||||
return out_dir / "feeds" / feed_slug
|
||||
|
||||
|
||||
def feed_output_path(*, out_dir: Path, feed_slug: str) -> Path:
|
||||
return feed_output_dir(out_dir=out_dir, feed_slug=feed_slug) / "feed.rss"
|
||||
|
||||
|
||||
def _resolve_path(base_path: Path, value: str) -> Path:
|
||||
path = Path(value).expanduser()
|
||||
if not path.is_absolute():
|
||||
|
|
@ -173,7 +181,7 @@ def build_feed_settings(
|
|||
out_dir: Path,
|
||||
feed_slug: str,
|
||||
) -> Settings:
|
||||
feed_dir = out_dir / feed_slug
|
||||
feed_dir = feed_output_dir(out_dir=out_dir, feed_slug=feed_slug)
|
||||
image_dir = base_settings.get("REPUBLISHER_IMAGE_DIR", IMAGE_DIR)
|
||||
video_dir = base_settings.get("REPUBLISHER_VIDEO_DIR", VIDEO_DIR)
|
||||
audio_dir = base_settings.get("REPUBLISHER_AUDIO_DIR", AUDIO_DIR)
|
||||
|
|
@ -192,7 +200,7 @@ def build_feed_settings(
|
|||
{
|
||||
"REPUBLISHER_OUT_DIR": str(out_dir),
|
||||
"FEEDS": {
|
||||
str(feed_dir / "feed.rss"): {
|
||||
str(feed_output_path(out_dir=out_dir, feed_slug=feed_slug)): {
|
||||
"format": "rss",
|
||||
"postprocessing": [],
|
||||
"feed_name": feed_slug,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue