Skip to content

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

Open
FellowTraveler wants to merge 2 commits into
ArchiveBox:mainfrom
FellowTraveler:ytdlp-lazy-media-card
Open

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

Conversation

@FellowTraveler

@FellowTraveler FellowTraveler commented Jun 7, 2026

Copy link
Copy Markdown

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

@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.

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 2 times, most recently from ef0d535 to d80fdf1 Compare June 7, 2026 02:20
@FellowTraveler

FellowTraveler commented Jun 7, 2026

Copy link
Copy Markdown
Author

Update: this note is superseded by maintainer feedback below.

I removed the Claude/Anthropic missing-key skip behavior from this PR, per @pirate’s request. The Claude integration tests now keep their upstream behavior: they fail when ANTHROPIC_API_KEY is absent.

That means this abx-plugins PR no longer attempts to clear the Claude failures visible on ArchiveBox/ArchiveBox#1819. Those failures are expected on contributor PR CI until the run is approved or a maintainer-side CI environment with credentials is used.

@FellowTraveler FellowTraveler force-pushed the ytdlp-lazy-media-card branch 3 times, most recently from e5ec88c to 1b71a75 Compare June 8, 2026 23:32
@pirate

pirate commented Jun 9, 2026

Copy link
Copy Markdown
Member

I don't want to ever skip the claude tests, can you remove that skip case. It's fine if they're failing for contributor PRs until I approve the run.

@FellowTraveler FellowTraveler force-pushed the ytdlp-lazy-media-card branch 2 times, most recently from 00503ac to 8d30c12 Compare June 9, 2026 03:10
@FellowTraveler

FellowTraveler commented Jun 9, 2026

Copy link
Copy Markdown
Author

Done in 779a2ed: removed the Claude/Anthropic missing-key skip behavior from this PR and restored the branch to the media-card/uBlock changes only.

Local verification after the change:

uv run --no-sync --no-sources prek run --all-files
# passed

pytest -q 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 abx_plugins/plugins/ublock/tests/test_ublock.py::test_blocks_ads_on_canyoublockit_extreme --basetemp=tests/out
# 3 passed in 71.40s

@FellowTraveler FellowTraveler force-pushed the ytdlp-lazy-media-card branch 2 times, most recently from 779a2ed to 41878e4 Compare June 11, 2026 09:21
@FellowTraveler FellowTraveler force-pushed the ytdlp-lazy-media-card branch from c75ac3b to 22731f9 Compare June 17, 2026 11:11
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