github jjjake/internetarchive v5.13.0
Version 5.13.0

31 minutes ago

Features and Improvements

  • Metadata reads (ArchiveSession.get_metadata, and so get_item,
    Item.refresh and ia metadata) now send extended_err=1, merged
    with any caller-supplied params. An identifier that exists or existed
    but cannot be served now returns {"error": ..., "errcode": ...} instead
    of {}; ia metadata <identifier> prints that body.
  • Item.errcode (int or None) and Item.error (str or None)
    expose the extended error, so callers can tell a deleted item from one that
    is temporarily unreadable. Item.__repr__ shows them when set.
  • ia metadata --exists prints the error to stderr when the response
    carried one. Exit codes are unchanged.

Bugfixes

  • Item.exists is now False for errcode 103 (unbacked user item,
    never created) and 104 (deleted), and True for every other non-empty
    response, including 101 (creation pending) and 102 (data nodes offline).
    Previously the API returned {} for all of these, so a pending or
    temporarily unreadable item read as not existing.
    Compatibility: exists no longer implies the metadata is loaded. For
    101, 102 and the other non-deleted error codes, exists is True
    while item.metadata is {} and item.files is []; check
    item.error before reading them. As a result ia delete on such an
    item prints "no files found, nothing deleted." and exits 1 instead of
    "item doesn't exist" with exit 0 (no delete requests are sent), and
    ia download still reports it as "item does not exist".
  • Reloading an item (Item.refresh, Item.load) now resets the
    attributes set from the previous response, so an item that was deleted
    or became unreadable no longer keeps its old files and metadata.
    load({}) now replaces the previous response instead of being ignored.
  • ia search --fts and search_items(..., full_text_search=True) returned
    no results after the full-text search API began validating parameter types:
    the request sent scroll as the string "true", which the API now
    rejects with a 400. It is now sent as a JSON boolean. Errors from the
    full-text search API (a 4xx or 5xx status, or a user_message in the
    response body) now raise ValueError with the server's message, so
    ia search --fts prints it and exits 1 instead of printing nothing and
    exiting 0 (#842). This includes an expired scroll id partway through
    iteration, which previously ended the results early without warning, and a
    failed num_found request, which previously returned None.
  • ia search --fts --itemlist crashed with TypeError on the second and
    later scroll pages: the API returns the identifier in _source there
    rather than in fields. The identifier is now taken from
    fields.identifier, else _source.identifier, else the part of the hit's
    _id before the |. search_items(..., full_text_search=True) still
    yields the hits exactly as the API returns them.

Security

  • Development and CI dependencies updated past their open advisories:
    virtualenv 21.15.6 (was 21.14.12) and filelock 4.2.10 (was 3.32.3). On
    Python 3.10 filelock stays at 4.1.0, the last release that supports it, which
    still has open advisories. The security notice in the README now names the
    correct fixed version, v5.5.1 (it said v5.4.2, which was never released).

What's Changed

Other Changes

  • Send FTS scroll as a JSON boolean and raise on FTS API errors by @jjjake in #843
  • Tighten agent rules in AGENTS.md by @jjjake in #845
  • Handle _source hits in ia search --fts --itemlist by @jjjake in #846
  • Send extended_err=1 on metadata reads and tighten Item.exists by @jjjake in #841
  • Upgrade virtualenv and filelock in uv.lock; correct README security notice by @jjjake in #844
  • Date the 5.13.0 changelog section by @jjjake in #848

Full Changelog: v5.12.1...v5.13.0

Don't miss a new internetarchive release

NewReleases is sending notifications on new releases.