@acedatacloud/skills 2026.726.5 → 2026.726.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acedatacloud/skills",
3
- "version": "2026.726.5",
3
+ "version": "2026.726.6",
4
4
  "description": "Agent Skills for AceDataCloud AI services — music, image, video generation, LLM chat, web search. Compatible with Claude Code, GitHub Copilot, Gemini CLI, OpenAI Codex, and 30+ AI coding agents.",
5
5
  "keywords": [
6
6
  "agent-skills",
@@ -110,8 +110,39 @@ curl -sS -H "Authorization: Bearer $GOOGLE_YOUTUBE_TOKEN" \
110
110
  file you're about to upload. Uploads are a two-step *resumable* flow:
111
111
  init with metadata → PUT the bytes.
112
112
 
113
+ ### If the source is a URL, fetch it first
114
+
115
+ Videos produced by a generation API (Maestro, Seedance, Veo, …) come back as a
116
+ CDN URL, not a local file. Download it and verify you actually got a video
117
+ before starting the upload:
118
+
113
119
  ```bash
114
- FILE="/path/to/video.mp4"
120
+ SRC="https://example.cdn.acedata.cloud/path/video.mp4"
121
+ FILE=$(mktemp) # plain mktemp — `mktemp /tmp/x-XXXXXX.mp4` is not portable
122
+
123
+ # -f: fail on 4xx/5xx instead of saving the error page. -L: follow CDN redirects.
124
+ curl -fsSL -o "$FILE" -w 'http=%{http_code} size=%{size_download}\n' "$SRC"
125
+
126
+ # Two distinct failures, two distinct messages — a 404/DNS error is a bad URL,
127
+ # not a bad video, and saying so saves the next step from misdiagnosing it.
128
+ [ -s "$FILE" ] \
129
+ || { echo "download failed (see http= above) — nothing to upload"; rm -f "$FILE"; exit 1; }
130
+
131
+ # A 200 can still be an HTML interstitial or an expired-link page. Reject that
132
+ # rather than allow-listing one container, so WebM/MOV/AVI still pass. `grep -a`
133
+ # is required — without it grep treats a binary header as "no match".
134
+ head -c 512 "$FILE" | grep -qai '<html\|<!doctype' \
135
+ && { echo "got an HTML page, not a video"; rm -f "$FILE"; exit 1; }
136
+ ```
137
+
138
+ `--upload-file` ignores the filename; YouTube keys off the
139
+ `Content-Type: video/*` header, so the extensionless temp file is fine.
140
+
141
+ ### The upload itself
142
+
143
+ ```bash
144
+ # Falls back to the placeholder only if the fetch step above didn't set FILE.
145
+ FILE="${FILE:-/path/to/video.mp4}"
115
146
  TITLE="My title"
116
147
  DESC="My description"
117
148
  # privacyStatus: public | unlisted | private
@@ -129,12 +160,19 @@ UPLOAD_URL=$(curl -sS -D - -o /dev/null \
129
160
  -d "$META" | tr -d '\r' | awk '/^[Ll]ocation:/{print $2}')
130
161
 
131
162
  # 2. Upload the bytes -> returns the created video resource (has .id).
132
- curl -sS -H "Authorization: Bearer $GOOGLE_YOUTUBE_TOKEN" \
163
+ RESULT=$(curl -sS -H "Authorization: Bearer $GOOGLE_YOUTUBE_TOKEN" \
133
164
  -H "Content-Type: video/*" \
134
- -X PUT --upload-file "$FILE" "$UPLOAD_URL" \
135
- | jq '{id: .id, url: ("https://www.youtube.com/watch?v=" + .id), privacy: .status.privacyStatus}'
165
+ -X PUT --upload-file "$FILE" "$UPLOAD_URL")
166
+ echo "$RESULT" | jq -e .id >/dev/null 2>&1 \
167
+ || { echo "upload failed: $(echo "$RESULT" | jq -r '.error.message' 2>/dev/null || echo "$RESULT")"; exit 1; }
168
+ echo "$RESULT" | jq '{id: .id, url: ("https://www.youtube.com/watch?v=" + .id), privacy: .status.privacyStatus}'
136
169
  ```
137
170
 
171
+ Delete a downloaded temp file only **after** you've confirmed an id came back
172
+ (`echo "$RESULT" | jq -e .id >/dev/null && rm -f "$FILE"`). On a 401/403 or a
173
+ dropped connection the download is still good and re-uploading beats re-fetching
174
+ a few hundred MB.
175
+
138
176
  `categoryId` `22` = "People & Blogs" (a safe default). To set a custom
139
177
  thumbnail (needs the file to be processed first), call
140
178
  `POST /upload/youtube/v3/thumbnails/set?videoId=VIDEO_ID` with the image.