foley.sources.internet_archive.adapter#
Internet Archive retrieve adapter: opt-in discovery of archival sounds, never auto-verified.
Items come from advancedsearch.php restricted to audio with a licenseurl. Each
item’s licence string goes through the one licence SSOT and the config’s allowlist, and
every candidate gets rights_verified=False whatever it says: the field is what the
uploader asserted. So foley.sources.pull.add_from() skips these until a person has
confirmed an item; the adapter is for finding and fetching, not for clearing.
Constructing it without the opt-in raises SourceConfigurationError.
Module Attributes
Registry convention (arioso): the loader imports |
Classes
Registry convention (arioso): the loader imports |
|
|
Opt-in Internet Archive adapter (a |
- foley.sources.internet_archive.adapter.Adapter#
Registry convention (arioso): the loader imports
adapter.Adapter.
- class foley.sources.internet_archive.adapter.InternetArchiveAdapter(config=None, *, opt_in=None, http=None)[source]#
Bases:
objectOpt-in Internet Archive adapter (a
SourceAdapter).- Parameters:
- download(source_id)[source]#
The first audio file of the item under
max_file_bytes(see the config).- Raises:
LookupError – If the item’s licence is not accepted (checked here too, so a direct call cannot fetch what a search would have dropped), or it has no suitable audio file.
- Return type:
- get(source_id)[source]#
Resolve one item identifier to its record.
- Raises:
LookupError – If the item is missing or its licence is not accepted.
- Return type:
- invoke_native(url, **params)[source]#
GET an Internet Archive
urlwith nativeparams; return the parsed JSON (#61).It bypasses the licence filter and the per-item licence check that
search()applies: the caller owns licence gating for what comes back.- Return type:
- search(query, *, license=None, k=15, page=1, sources=None, provider_params=None, **kw)[source]#
Search archive audio for
query; return candidates (all unverified).licenseis a licence id ('CC0-1.0';'cc0'is an alias) and keeps only items under it;Nonekeeps every accepted licence. The default isNone, unlike the other CC sources’'cc0', because every archive licence is an unverified claim anyway;add_fromalways passes its own ('cc0') default. The query always asks for items with alicenseurl.pageis the results page (1-based,kper page);sourcesrestricts it to these archive collections.provider_paramsare native advancedsearch params merged over the translated ones (#61); aqis ANDed onto foley’s as one group, never replaces it (the config’sprovider_paramspolicy). One that namesmediatyperaisesSearchArgumentError, whatever the licence: ANDed with foley’smediatype:audioit could match nothing (#203). Acollection:clause is fine, and withsourcesit narrows them.