Files
auto-archiver/src/auto_archiver/modules/cli_feeder/cli_feeder.py
2025-06-21 15:54:51 +01:00

19 lines
622 B
Python

from auto_archiver.core.feeder import Feeder
from auto_archiver.core.metadata import Metadata
from auto_archiver.core.consts import SetupError
class CLIFeeder(Feeder):
def setup(self) -> None:
self.urls = self.config["urls"]
if not self.urls:
raise SetupError(
"No URLs provided. Please provide at least one URL via the command line, or set up an alternative feeder. Use --help for more information."
)
def __iter__(self) -> Metadata:
urls = self.config["urls"]
for url in urls:
m = Metadata().set_url(url)
yield m