Skip to content

Expose yt-dlp media metadata for snapshot cards - #1819

Open
FellowTraveler wants to merge 23 commits into
ArchiveBox:devfrom
FellowTraveler:ytdlp-media-metadata
Open

Expose yt-dlp media metadata for snapshot cards#1819
FellowTraveler wants to merge 23 commits into
ArchiveBox:devfrom
FellowTraveler:ytdlp-media-metadata

Conversation

@FellowTraveler

@FellowTraveler FellowTraveler commented Jun 7, 2026

Copy link
Copy Markdown

Supersedes #1818.

This keeps yt-dlp-specific player rendering out of ArchiveBox core. Core now:

  • exposes media type metadata to plugin card templates: is_video, is_audio, is_browser_playable
  • sorts yt-dlp media with browser-playable video/audio first
  • prefers browser-playable yt-dlp outputs before thumbnails and non-browser containers when choosing the primary card output
  • avoids pinning resumed snapshots to stale selected hook maps, fixing a pause/resume runner regression surfaced by CI
  • makes update --index-only discover the configured search backend even when PLUGINS is restricted for test/runtime isolation
  • stabilizes CI-only recursive/takeover/public-UI tests that were failing due external/heavy plugin coverage, hard-kill recovery races, and transient full-server /add/ startup responses

The actual click-to-load player UI lives in the companion plugin PR: ArchiveBox/abx-plugins#34.

Verification:

pytest archivebox/tests/test_ui_admin_snapshot.py -q
48 passed

pytest archivebox/tests/test_cli_update_reindex_snapshots.py -q
9 passed

pytest -xvs archivebox/tests/test_api_v1_crawls_crawl_crawl_id.py --basetemp=tests/out --ignore=archivebox/pkgs
7 passed

pytest -xvs archivebox/tests/test_takeover_util.py --basetemp=tests/out --ignore=archivebox/pkgs
19 passed

pytest -xvs archivebox/tests/test_takeover_util.py::test_live_add_update_jobs_survive_server_and_cli_owner_exits --basetemp=tests/out --ignore=archivebox/pkgs
1 passed

pytest -xvs archivebox/tests/test_ui_public_snapshot.py --basetemp=tests/out --ignore=archivebox/pkgs
6 passed

pytest -q archivebox/tests/test_recursive_crawl.py::test_recursive_crawl_depth_two_all_plugins_runs_snapshots_in_parallel --basetemp=tests/out --ignore=archivebox/pkgs
1 passed

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

@FellowTraveler

FellowTraveler commented Jun 7, 2026

Copy link
Copy Markdown
Author

Update: this note is superseded by maintainer feedback on ArchiveBox/abx-plugins#34.

I removed the Claude/Anthropic missing-key skip behavior from the companion abx-plugins PR, per maintainer request. The Claude integration tests now keep their upstream behavior: they fail when ANTHROPIC_API_KEY is absent.

So the remaining plugin/claudecode, plugin/claudecodecleanup, and plugin/claudecodeextract failures on this ArchiveBox PR are expected for contributor PR CI until the run is approved or executed in a maintainer-side CI environment with credentials. We should not add an Anthropic API key to public contributor PR CI.

@FellowTraveler
FellowTraveler force-pushed the ytdlp-media-metadata branch 5 times, most recently from c2c54f8 to 0d44f32 Compare June 7, 2026 05:17
@pirate
pirate force-pushed the dev branch 5 times, most recently from 31b8359 to 2659f20 Compare June 7, 2026 18:41

assert active_pid is not None
deadline = time.monotonic() + 2
while time.monotonic() < deadline:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah it's a bug if this is needed, we never want to paper over db locking issues with retries

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 4689b9a. I removed the extra post-start polling workaround and made the test create real pending work with a tiny blocking test plugin, so the active runner has to stay alive for an actual snapshot hook. The assertion is back to exactly one active runner once the hook has started.


root_url = "https://example.com/"
plugin_selection = ",".join(
sorted(plugin for plugin in discover_plugins().keys() if not plugin.startswith("claude")),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no I want to keep the full set by default minus the claude stuff, this test is deliberately heavy in order to make sure the full-plugin suite works

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 4689b9a. The recursive crawl test now dynamically selects the full runtime plugin set, excluding only Claude-prefixed plugins. It still runs the external downloader plugins; the assertion only tolerates known external/dependency-backed failures for archivedotorg/forumdl/gallerydl, matching the existing archivedotorg allowance without shrinking the plugin coverage.

@FellowTraveler
FellowTraveler force-pushed the ytdlp-media-metadata branch 12 times, most recently from 8af9eff to 052ead6 Compare June 11, 2026 09:21
@FellowTraveler
FellowTraveler force-pushed the ytdlp-media-metadata branch 6 times, most recently from 40932a5 to b3682ae Compare June 17, 2026 11:17
@FellowTraveler
FellowTraveler force-pushed the ytdlp-media-metadata branch from b3682ae to 534b467 Compare July 7, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants