Command Palette

Search for a command to run...

Назад к скиллам
скилл № 48854

rawkode-academy-video-importer

Import YouTube videos into Rawkode Academy: run the video-importer, upload R2 assets, create the platform-videos D1 row and its episode/guest/technology rows…

БесплатноБез исполняемых скриптов
rawkode-academyот rawkode-academy★ 32 звезды на GitHub

Установить rawkode-academy-video-importer в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Rawkode Academy Video Importer

Use this skill when importing a YouTube video into Rawkode Academy, especially when the task mentions projects/rawkode.academy/tasks/video-importer, R2 uploads, transcoding, transcription, captions, or episode descriptions.

Critical Rule

Separate evidence for each stage:

  • Import/upload complete means the importer state has completed and the original R2 assets return 200.
  • The video exists means the importer state has d1_written and videoByID returns it from https://api.rawkode.academy.
  • Transcoding complete means https://content.rawkode.academy/videos/<cuid>/stream.m3u8 returns 200, or Cloud Run shows the execution completed successfully.
  • Transcription complete means https://content.rawkode.academy/videos/<cuid>/captions/en.vtt returns 200.

Do not say transcoding or transcription completed just because the job/workflow was triggered.

Import

  1. Start at the repo root and check for unrelated work:
jj status

Preserve unrelated user changes.

  1. Before running dependency installs, Bun workspace commands, tests, or generated CI checks, synchronize the workspace from the repository root:
cuenv sync -A
  1. Extract the video ID from the YouTube URL. For https://www.youtube.com/watch?v=tKc8Rna3vDQ, use tKc8Rna3vDQ.

  2. Check importer state:

cd projects/rawkode.academy/tasks/video-importer
cuenv exec -e production uv run python youtube_to_r2.py <youtube-id> --show-state
  1. Run the importer:
cuenv exec -e production uv run python youtube_to_r2.py <youtube-id>

If the user already downloaded the video, find the file and pass it explicitly:

find /Users/rawkode/Downloads -maxdepth 1 -type f \( -iname '*.mp4' -o -iname '*.mkv' -o -iname '*.mov' -o -iname '*.webm' \) -print
cuenv exec -e production uv run python youtube_to_r2.py <youtube-id> --local-video /absolute/path/to/video.mp4

The importer downloads or prepares the video, extracts MP3 audio, uploads original.mkv, original.mp3, and thumbnail.webp to rawkode-academy-content, triggers Cloud Run transcoding-job (unless --skip-cloud-run), inserts the video row into the platform-videos D1 database, calls the website's cache invalidation endpoint for videos:<cuid>, and prints the CUID plus the SQL it wrote. The row holds title, subtitle (first description line), slug (from the title), description (plain text), description_doc (the same text as a TipTap document), duration, publishedAt (YouTube upload date, Unix seconds), youtube_id and updated_at. An existing row is never overwritten.

D1 needs CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN (provided by cuenv exec -e production). CACHE_INVALIDATION_TOKEN is optional: without it the importer warns, leaves cache_invalidated incomplete, and the website shows the video after its hourly change detection.

The row makes the video public at publishedAt (usually already past), before transcoding finishes. To hold it back, run with --skip-d1 (uploads only, SQL printed), then re-run the same command without it once transcoding completed: completed steps are skipped, so the re-run only writes D1 and invalidates the cache. The downloaded JPEG thumbnail is only a temporary conversion source; thumbnail.webp is the canonical runtime asset. It keeps state in ~/.youtube_to_r2_state/<youtube-id>.json.

If a turn is interrupted, poll the running session if available before starting a new import. Avoid duplicate uploads for the same YouTube ID.

  1. Verify import/upload:
jq '{cuid, completed_steps, artifacts, title: .video_info.title, duration: .video_info.duration, upload_date: .video_info.upload_date}' /Users/rawkode/.youtube_to_r2_state/<youtube-id>.json

curl -fsS -I https://content.rawkode.academy/videos/<cuid>/original.mkv
curl -fsS -I https://content.rawkode.academy/videos/<cuid>/original.mp3
curl -fsS -I https://content.rawkode.academy/videos/<cuid>/thumbnail.webp

If an older import has both thumbnail.jpg and thumbnail.webp, remove the JPEG after verifying WebP:

cd projects/rawkode.academy/tasks/video-importer
cuenv exec -e production uv run python migrate_thumbnails_to_webp.py --video-id <cuid> --workers 1
curl -fsS -I https://content.rawkode.academy/videos/<cuid>/thumbnail.webp
curl -fsS -I https://content.rawkode.academy/videos/<cuid>/thumbnail.jpg # should return 404

Content (D1 rows)

The repository has no content files any more (the content/ tree is gone); never create Markdown/MDX/YAML for videos, people or technologies. The importer creates the videos row; everything else is rows in the platform services under projects/rawkode.academy/platform/<service> (exact columns in each data-model/schema.ts). Apply SQL with wrangler from the service directory:

cd projects/rawkode.academy/platform/<service>
cuenv exec -e production -- bunx wrangler d1 execute <database> --remote --config read-model
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • agents/openai.yaml

FAQ

Что делает скилл rawkode-academy-video-importer?

Import YouTube videos into Rawkode Academy: run the video-importer, upload R2 assets, create the platform-videos D1 row and its episode/guest/technology rows, invalidate the website cache, verify transcoding, trigger and verify transcription, and avoid claiming triggered jobs are complete before artifacts exist.

Как установить скилл rawkode-academy-video-importer?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл rawkode-academy-video-importer запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить rawkode-academy-video-importer с