Skip to content

Lazy-load yt-dlp media players in card template#34

Open
FellowTraveler wants to merge 1 commit into
ArchiveBox:mainfrom
FellowTraveler:ytdlp-lazy-media-card
Open

Lazy-load yt-dlp media players in card template#34
FellowTraveler wants to merge 1 commit into
ArchiveBox:mainfrom
FellowTraveler:ytdlp-lazy-media-card

Conversation

@FellowTraveler
Copy link
Copy Markdown

@FellowTraveler FellowTraveler commented Jun 7, 2026

Companion to ArchiveBox/ArchiveBox#1819.

Moves the yt-dlp media player behavior into the yt-dlp plugin card template, where plugin-specific rendering belongs.

The card now:

  • renders lightweight play buttons and file links initially
  • creates the video/audio element only after the user clicks
  • keeps non-browser-playable files as regular links
  • URL-encodes generated href and data-src values so filenames with reserved characters still work

Also fixes Claude integration test behavior for public CI:

  • live Claude Code / Anthropic tests skip when ANTHROPIC_API_KEY is absent instead of failing the PR
  • explicit CLAUDECODE_BINARY env overrides are respected before hydrated binary defaults

Verification:

PYTHONPATH=/Users/au/src/abx-plugins PATH=/Users/au/src/ArchiveBox/.venv/bin:$PATH pytest abx_plugins/plugins/ytdlp/tests/test_ytdlp.py::test_card_template_loads_browser_media_on_click abx_plugins/plugins/ytdlp/tests/test_ytdlp.py::test_card_template_links_non_browser_media_without_player -q
2 passed

ANTHROPIC_API_KEY unset:
PYTHONPATH=/Users/au/src/abx-plugins PATH=/Users/au/src/ArchiveBox/.venv/bin:$PATH pytest abx_plugins/plugins/claudecode/tests/test_claudecode.py abx_plugins/plugins/claudecodeextract/tests/test_claudecodeextract.py abx_plugins/plugins/claudecodecleanup/tests/test_claudecodecleanup.py -q
26 passed, 7 skipped

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

1 issue found across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread abx_plugins/plugins/ytdlp/templates/card.html Outdated
@FellowTraveler FellowTraveler force-pushed the ytdlp-lazy-media-card branch from 4d1de44 to ef0d535 Compare June 7, 2026 00:54
@FellowTraveler FellowTraveler force-pushed the ytdlp-lazy-media-card branch from ef0d535 to d80fdf1 Compare June 7, 2026 02:20
@FellowTraveler
Copy link
Copy Markdown
Author

CI note: this PR also fixes the Claude plugin failures currently visible on ArchiveBox/ArchiveBox#1819.

Those ArchiveBox checks clone/test upstream ArchiveBox/abx-plugins; on current upstream, the Claude Code integration fixture fails public PR CI when ANTHROPIC_API_KEY is absent. This PR changes that behavior to skip live Claude/Anthropic integration tests when credentials are not present, while keeping non-live tests green.

Local verification with ANTHROPIC_API_KEY unset:

PYTHONPATH=/Users/au/src/abx-plugins PATH=/Users/au/src/ArchiveBox/.venv/bin:$PATH pytest abx_plugins/plugins/claudecode/tests/test_claudecode.py abx_plugins/plugins/claudecodeextract/tests/test_claudecodeextract.py abx_plugins/plugins/claudecodecleanup/tests/test_claudecodecleanup.py -q
26 passed, 7 skipped

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.

1 participant