Skip to content

feat(download): Support for TikTok photo slideshows - #220

Open
Rasmus257 wants to merge 1 commit into
bradautomates:mainfrom
Rasmus257:feat/tiktok-slideshows
Open

Rasmus257 wants to merge 1 commit into
bradautomates:mainfrom
Rasmus257:feat/tiktok-slideshows

Conversation

@Rasmus257

Copy link
Copy Markdown

Why

/watch can't read TikTok photo slideshows, and the slides are the whole content of those posts. yt-dlp rejects /photo/ URLs as Unsupported URL. On /video/ URLs it downloads only the soundtrack mp3, and frame extraction then crashes with ffmpeg scene extraction failed: Input #0, mp3.

What changed

  • gallery-dl fallback. When yt-dlp returns no video, or only audio when frames were wanted, download.py falls back to gallery-dl if it's on PATH. It returns the slide images, soundtrack and caption, or the video file for posts yt-dlp couldn't fetch. It's optional: without gallery-dl, behavior matches today apart from the crash fix below.
  • Slides in the report. Slides are scaled with the existing 512px/1998px clamp and are not deduped. The report lists them as slide N, with the post caption as Title. A 9-slide post is about 4k image tokens at the default width.
  • No crash on audio-only downloads. A download with no video stream now skips frame extraction instead of crashing, and still goes on to Whisper.
  • Tests. 9 new tests with no network: fallback routing, slide extraction, an in-process report run, and the audio-only guard. 6 of them fail on main and pass here; the full suite passes (80). Also checked by hand on real slideshow and video URLs, with and without yt-dlp browser impersonation.

@frinsen

frinsen commented Sep 21, 2026

Copy link
Copy Markdown

Thanks @Rasmus257 — this is in the community fork frinsen/claude-video as of v0.3.0: adapted in part — the crash when yt-dlp hands back only the mp3 is fixed (the run finishes transcript-only with a clear Frames line). The gallery-dl slideshow support is deferred, listed in the CHANGELOG as a candidate.

You're credited in AUTHORS.md, and the whole set is offered back here in #237.

Verohomie added a commit to Verohomie/claude-video that referenced this pull request Sep 25, 2026
Two independent fixes, together because both touch frames.py and watch.py in the
same places and splitting them would mean staging half-edited files.

WATCH_MAX_FPS. The 2 fps ceiling was a module constant, so a sub-second or
fast-action clip yielded one or two frames of the moment that mattered with no
way to ask for more. It now resolves through get_config() exactly like
WATCH_DETAIL and WATCH_QUALITY: environment first, then ~/.config/watch/.env,
then the default, with an unusable value falling back rather than raising -- a
typo must not take down a run that already paid for a download. Deliberately not
the upstream shape, which read os.environ once at import and so was the one
setting that could not live in the config file.

Rejecting non-finite values is not hypothetical tidiness: "1e400" parses to
infinity and compares greater than zero, which would have left --fps unclamped
entirely. A test caught it.

--fps above the ceiling now says so and names the setting, instead of being
silently reduced.

Audio-only sources. get_metadata reported has_audio but never has_video, so a
local .mp3 at default detail reached the extractors and died on a raw "ffmpeg
scene extraction failed" -- after the download had been paid for.
test_the_extractors_really_do_fail_on_audio pins that as the counterfactual.
watch.py now detects it, says so once, and continues transcript-only.

The audio still goes to Whisper: clearing video_path skips the frame engines,
so the transcription call takes a separate audio_source. Getting that wrong
would have turned a crash into a silently empty transcript, which is worse.

Cover art is handled: ffprobe reports an MP3's embedded JPEG as a video stream,
so presence alone is not enough -- the attached_pic disposition and a
single-frame count both rule it out.

Verified end to end: a 6s tone file exits 0 with "0 selected" and no bogus
Resolution line. Issue bradautomates#37 for the ceiling; from PR bradautomates#220 by @Rasmus257 for the
audio-only half.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…jects /photo/ URLs and returns only the soundtrack for /video/ ones, which crashed frame extraction
@Rasmus257
Rasmus257 force-pushed the feat/tiktok-slideshows branch from 64edc2d to eec9da0 Compare November 10, 2026 15:49
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