@renoise/video-maker 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/.claude-plugin/plugin.json +5 -0
  2. package/README.md +50 -0
  3. package/hooks/hooks.json +16 -0
  4. package/hooks/session-start.sh +17 -0
  5. package/lib/gemini.ts +49 -0
  6. package/package.json +22 -0
  7. package/skills/director/SKILL.md +272 -0
  8. package/skills/director/references/narrative-pacing.md +257 -0
  9. package/skills/director/references/style-library.md +179 -0
  10. package/skills/product-sheet-generate/SKILL.md +75 -0
  11. package/skills/renoise-gen/SKILL.md +362 -0
  12. package/skills/renoise-gen/references/api-endpoints.md +138 -0
  13. package/skills/renoise-gen/references/video-capabilities.md +524 -0
  14. package/skills/renoise-gen/renoise-cli.mjs +723 -0
  15. package/skills/scene-generate/SKILL.md +52 -0
  16. package/skills/short-film-editor/SKILL.md +479 -0
  17. package/skills/short-film-editor/examples/mystery-package-4shot.md +260 -0
  18. package/skills/short-film-editor/references/continuity-guide.md +170 -0
  19. package/skills/short-film-editor/scripts/analyze-beats.py +271 -0
  20. package/skills/short-film-editor/scripts/batch-generate.sh +150 -0
  21. package/skills/short-film-editor/scripts/generate-storyboard-html.ts +714 -0
  22. package/skills/short-film-editor/scripts/split-grid.sh +70 -0
  23. package/skills/tiktok-content-maker/SKILL.md +143 -0
  24. package/skills/tiktok-content-maker/examples/dress-demo.md +86 -0
  25. package/skills/tiktok-content-maker/references/ecom-prompt-guide.md +261 -0
  26. package/skills/tiktok-content-maker/scripts/analyze-images.ts +122 -0
  27. package/skills/video-download/SKILL.md +161 -0
  28. package/skills/video-download/scripts/download-video.sh +91 -0
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: video-download
3
+ description: >
4
+ Downloads videos from YouTube, TikTok, Douyin, Bilibili, Instagram, XiaoHongShu and 1000+ platforms.
5
+ Primary: yt-dlp. Fallback: agent-browser + GreenVideo for Douyin/TikTok when yt-dlp fails.
6
+ Use when user says "download video", "save video", "下载视频", "抓取视频", "无水印下载",
7
+ or pastes a video URL. Do NOT use for AI video generation or video editing.
8
+ allowed-tools: Bash
9
+ metadata:
10
+ author: renoise
11
+ version: 0.2.0
12
+ category: utility
13
+ tags: [download, youtube, tiktok, douyin, yt-dlp, greenvideo]
14
+ ---
15
+
16
+ # Video Download
17
+
18
+ Download videos from YouTube, TikTok, and other platforms to local MP4 files using yt-dlp. Handles format selection, platform-prefixed dedup, and TikTok cookie fallback automatically.
19
+
20
+ ## Prerequisites
21
+
22
+ Verify yt-dlp is installed:
23
+
24
+ ```bash
25
+ yt-dlp --version
26
+ ```
27
+
28
+ If missing: `brew install yt-dlp` (macOS) or `pip install yt-dlp`.
29
+
30
+ ### Optional (for Douyin/TikTok fallback)
31
+
32
+ - `agent-browser` installed globally (`npm install -g agent-browser`)
33
+ - Chrome for Testing installed (`agent-browser install`)
34
+
35
+ ## Usage
36
+
37
+ ### Single Video
38
+
39
+ Run the download script with the video URL:
40
+
41
+ ```bash
42
+ bash ${CLAUDE_SKILL_DIR}/scripts/download-video.sh '<URL>'
43
+ ```
44
+
45
+ The script handles everything automatically:
46
+ - Extracts a platform-prefixed video ID (`yt-dQw4w9WgXcQ`, `tk-7571284267028729101`, `vid-aHR0cHM6Ly93d3`)
47
+ - Saves to `resources/references/<video_id>.mp4`
48
+ - Skips download if file already exists (dedup)
49
+ - Retries TikTok downloads with `--cookies-from-browser chrome` on failure
50
+ - Removes zero-byte leftovers from interrupted downloads
51
+
52
+ ### Custom Output Directory
53
+
54
+ ```bash
55
+ bash ${CLAUDE_SKILL_DIR}/scripts/download-video.sh '<URL>' 'path/to/output'
56
+ ```
57
+
58
+ ### Batch Download
59
+
60
+ Run the script in a loop:
61
+
62
+ ```bash
63
+ for URL in '<URL1>' '<URL2>' '<URL3>'; do
64
+ bash ${CLAUDE_SKILL_DIR}/scripts/download-video.sh "$URL"
65
+ done
66
+ ```
67
+
68
+ ## Script Output
69
+
70
+ The script prints one of three status lines:
71
+
72
+ | Output | Meaning |
73
+ |--------|---------|
74
+ | `ALREADY_EXISTS: <path>` | File already downloaded, skipped |
75
+ | `DOWNLOADED: <path>` | Download succeeded |
76
+ | `FAILED: <message>` | Download failed (exit code 1) |
77
+
78
+ ## Troubleshooting
79
+
80
+ | Error | Solution |
81
+ |-------|----------|
82
+ | `HTTP Error 403` (TikTok/Douyin) | Script auto-retries with cookies. If still failing, use **GreenVideo Fallback** below |
83
+ | `--max-filesize` skipped | Video exceeds 200M limit. Download manually with `-f 'best[height<=720]'` |
84
+ | `is not a valid URL` | Ensure URL is wrapped in single quotes |
85
+ | `Requested formats are incompatible` | yt-dlp auto-transcodes, no action needed |
86
+
87
+ ## Video ID Logic
88
+
89
+ | Platform | Pattern | Example ID |
90
+ |----------|---------|------------|
91
+ | YouTube | `watch?v=`, `shorts/`, `embed/`, `youtu.be/` → 11-char ID | `yt-dQw4w9WgXcQ` |
92
+ | TikTok | 15+ digit numeric ID in URL | `tk-7571284267028729101` |
93
+ | Other | Base64url of URL, first 16 chars | `vid-aHR0cHM6Ly93d3` |
94
+
95
+ ---
96
+
97
+ ## GreenVideo Fallback (for Douyin/TikTok)
98
+
99
+ When yt-dlp fails for Douyin or TikTok URLs (common with 403 errors or region-restricted content), use GreenVideo as a browser-based fallback. Requires `agent-browser` (see Prerequisites).
100
+
101
+ ### Decision Logic
102
+
103
+ ```
104
+ User gives URL → Try yt-dlp first
105
+ ↓ fails (403 / no result)
106
+ Is it Douyin/TikTok?
107
+ ↓ yes
108
+ Use agent-browser + GreenVideo
109
+ ↓ no
110
+ Report error, suggest manual download
111
+ ```
112
+
113
+ ### Step 1: Open GreenVideo
114
+
115
+ ```bash
116
+ agent-browser open "https://greenvideo.cc/en/"
117
+ ```
118
+
119
+ ### Step 2: Paste URL and Parse
120
+
121
+ ```bash
122
+ agent-browser snapshot
123
+ # Find the input textbox ref (e.g., @e63)
124
+ agent-browser fill <input-ref> "<video-url>"
125
+ agent-browser click <start-button-ref>
126
+ ```
127
+
128
+ Wait 5 seconds for parsing to complete, then snapshot to verify results.
129
+
130
+ ### Step 3: Extract Video Direct URL
131
+
132
+ The video URL is stored in Nuxt state. Extract it with:
133
+
134
+ ```bash
135
+ agent-browser eval "
136
+ (function() {
137
+ const nuxtData = window.__NUXT__;
138
+ if (!nuxtData) return 'ERROR: No Nuxt data found';
139
+ const str = JSON.stringify(nuxtData);
140
+ const mp4Match = str.match(/https?:[^\\\"]*(?:mp4|video|play|aweme|douyinvod|bilivideo)[^\\\"]{0,500}/g);
141
+ if (mp4Match && mp4Match.length > 0) return mp4Match[0];
142
+ return 'ERROR: No video URL found in Nuxt state';
143
+ })()
144
+ "
145
+ ```
146
+
147
+ ### Step 4: Download and Cleanup
148
+
149
+ ```bash
150
+ curl -L -o ~/Downloads/<filename>.mp4 "<extracted-video-url>"
151
+ agent-browser close
152
+ ```
153
+
154
+ ### GreenVideo Troubleshooting
155
+
156
+ | Issue | Solution |
157
+ |-------|----------|
158
+ | Parse fails or no result | Check URL is valid and publicly accessible. Some `/user/self` URLs need the direct video URL |
159
+ | No video URL in Nuxt state | Try clicking download button and check for `<video>` elements: `agent-browser eval "document.querySelectorAll('video').length"` |
160
+ | Download fails (403) | Video URLs expire quickly — extract and download immediately. Try adding `-H "Referer: https://greenvideo.cc/"` to curl |
161
+ | agent-browser not responding | Run `agent-browser close` then `agent-browser open "https://greenvideo.cc/en/"` |
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env bash
2
+ # download-video.sh — Download video to resources/references/ with dedup and platform detection
3
+ #
4
+ # Usage:
5
+ # download-video.sh <URL> [output_dir]
6
+ #
7
+ # Features:
8
+ # - Extracts platform-prefixed video ID (yt-xxx, tk-xxx, vid-xxx)
9
+ # - Skips download if file already exists (dedup)
10
+ # - Auto-retries TikTok with --cookies-from-browser chrome on 403
11
+ # - Outputs final file path on success
12
+
13
+ set -euo pipefail
14
+
15
+ URL="${1:?Usage: download-video.sh <URL> [output_dir]}"
16
+ OUTPUT_DIR="${2:-resources/references}"
17
+
18
+ # --- Video ID extraction ---
19
+
20
+ extract_video_id() {
21
+ local url="$1"
22
+
23
+ # YouTube: watch?v=, shorts/, embed/, youtu.be/
24
+ if [[ "$url" =~ (youtube\.com/(watch\?v=|shorts/|embed/)|youtu\.be/)([\w-]{11}|[A-Za-z0-9_-]{11}) ]]; then
25
+ local yt_id
26
+ yt_id=$(echo "$url" | grep -oE '(watch\?v=|shorts/|embed/|youtu\.be/)([A-Za-z0-9_-]{11})' | grep -oE '[A-Za-z0-9_-]{11}$')
27
+ echo "yt-${yt_id}"
28
+ return
29
+ fi
30
+
31
+ # TikTok: numeric ID (15+ digits)
32
+ if [[ "$url" =~ tiktok\.com ]]; then
33
+ local tk_id
34
+ tk_id=$(echo "$url" | grep -oE '[0-9]{15,}' | head -1)
35
+ if [[ -n "$tk_id" ]]; then
36
+ echo "tk-${tk_id}"
37
+ return
38
+ fi
39
+ fi
40
+
41
+ # Fallback: base64url-encoded URL, first 16 chars
42
+ local b64
43
+ b64=$(echo -n "$url" | base64 | tr '+/' '-_' | tr -d '=' | head -c 16)
44
+ echo "vid-${b64}"
45
+ }
46
+
47
+ VIDEO_ID=$(extract_video_id "$URL")
48
+ OUTPUT="${OUTPUT_DIR}/${VIDEO_ID}.mp4"
49
+
50
+ # --- Dedup check ---
51
+
52
+ if [[ -f "$OUTPUT" && $(stat -f%z "$OUTPUT" 2>/dev/null || stat -c%s "$OUTPUT" 2>/dev/null) -gt 0 ]]; then
53
+ echo "ALREADY_EXISTS: $OUTPUT"
54
+ exit 0
55
+ fi
56
+
57
+ # Remove zero-byte leftover from interrupted download
58
+ [[ -f "$OUTPUT" ]] && rm -f "$OUTPUT"
59
+
60
+ mkdir -p "$OUTPUT_DIR"
61
+
62
+ # --- Download ---
63
+
64
+ YT_DLP_ARGS=(
65
+ -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best'
66
+ --merge-output-format mp4
67
+ --no-playlist
68
+ --max-filesize 200M
69
+ -o "$OUTPUT"
70
+ )
71
+
72
+ echo "Downloading: $URL"
73
+ echo "Output: $OUTPUT"
74
+
75
+ if yt-dlp "${YT_DLP_ARGS[@]}" "$URL"; then
76
+ echo "DOWNLOADED: $OUTPUT"
77
+ exit 0
78
+ fi
79
+
80
+ # --- TikTok 403 retry with cookies ---
81
+
82
+ if [[ "$URL" =~ tiktok\.com ]]; then
83
+ echo "Retrying TikTok with browser cookies..."
84
+ if yt-dlp "${YT_DLP_ARGS[@]}" --cookies-from-browser chrome "$URL"; then
85
+ echo "DOWNLOADED: $OUTPUT"
86
+ exit 0
87
+ fi
88
+ fi
89
+
90
+ echo "FAILED: Could not download $URL"
91
+ exit 1