prelinger.fetch_prelinger_videos ================================ .. py:module:: prelinger.fetch_prelinger_videos .. autoapi-nested-parse:: Fetch Prelinger video metadata from the Internet Archive. Two complementary functions are provided: * ``search_prelinger`` - queries the Internet Archive Advanced Search API to discover video identifiers within the Prelinger collection. * ``fetch_item_metadata`` - retrieves the full metadata for a single item via the Internet Archive Metadata (md-read) API. Usage (run directly):: uv run server/plugins/prelinger/fetch_prelinger_videos.py Results are cached in ``prelinger_finland_videos.json`` inside this directory. Attributes ---------- .. autoapisummary:: prelinger.fetch_prelinger_videos.IA_SEARCH_URL prelinger.fetch_prelinger_videos.IA_METADATA_URL prelinger.fetch_prelinger_videos.HEADERS prelinger.fetch_prelinger_videos.plugin Functions --------- .. autoapisummary:: prelinger.fetch_prelinger_videos.search_prelinger prelinger.fetch_prelinger_videos.fetch_item_metadata prelinger.fetch_prelinger_videos.bulk_import Module Contents --------------- .. py:data:: IA_SEARCH_URL :value: 'https://archive.org/advancedsearch.php' .. py:data:: IA_METADATA_URL :value: 'https://archive.org/metadata/{identifier}' .. py:data:: HEADERS .. py:function:: search_prelinger(query: str, rows: int = 50, *, httpx_client: httpx.Client) -> list[str] Search the Prelinger collection and return a list of item identifiers. Uses the Internet Archive Advanced Search API: ``GET https://archive.org/advancedsearch.php`` .. py:function:: fetch_item_metadata(identifier: str, *, httpx_client: httpx.Client) -> server.plugins.prelinger.prelinger_models.PrelingerItem Fetch the full metadata for a single Prelinger item via the md-read API. ``GET https://archive.org/metadata/{identifier}`` .. py:function:: bulk_import(query: str = 'finland', rows: int = 50) -> list[server.plugins.prelinger.prelinger_models.PrelingerItem] Search the Prelinger collection for *query* and return a list of ``PrelingerItem`` objects with full metadata. Results are cached in ``prelinger_finland_videos.json`` (when *query* is ``"finland"``). Re-run with a fresh environment to bypass the cache. .. py:data:: plugin