You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tiktok): lower upload memory cap, drop redundant avatar string outputs
Cap the file-upload video buffer at 250MB instead of TikTok's 4GB ceiling —
relaying that much through this server's memory per request isn't safe
under concurrent load, and larger files can still go through the
PULL_FROM_URL path, which never buffers on our server. Also drop the
now-redundant avatarUrl/avatarUrl100/avatarLargeUrl string outputs from
Get User Info in favor of the file-typed avatarFile output alone, since
the feature is unreleased and the raw URL is still reachable via
avatarFile.url. Cover image URLs on List/Query Videos are confirmed to be
signed, expiring TikTok CDN links; left as strings (no file-output
conversion path exists for fields nested inside array items) but
documented the expiry behavior more clearly.
Co-authored-by: Cursor <cursoragent@cursor.com>
| ↳ `coverImageUrl`| string |Signed cover image URL from TikTok CDN. Publicly fetchable without auth, but time-limited \(embeds an x-expires param\) — use it right away rather than storing it for later.|
70
67
| ↳ `embedLink`| string | Embeddable video URL |
71
68
| ↳ `duration`| number | Video duration in seconds |
72
69
| ↳ `createTime`| number | Unix timestamp when video was created |
@@ -98,7 +95,7 @@ Query specific TikTok videos by their IDs to get fresh metadata including cover
98
95
|`videos`| array | List of queried TikTok videos |
| ↳ `coverImageUrl`| string |Signed cover image URL from TikTok CDN. Publicly fetchable without auth, but time-limited \(embeds an x-expires param\) — use it right away rather than storing it for later.|
102
99
| ↳ `embedLink`| string | Embeddable video URL |
103
100
| ↳ `duration`| number | Video duration in seconds |
104
101
| ↳ `createTime`| number | Unix timestamp when video was created |
/** TikTok requires each chunk between 5MB and 64MB; the final chunk absorbs the remainder (up to ~2x this size, well under the 128MB cap). Capped at 1000 chunks total, which this default comfortably satisfies up to TikTok's 4GB video size limit. */
26
26
constDEFAULT_CHUNK_SIZE=10_000_000
27
27
28
-
/** TikTok's documented maximum video file size. Enforced before downloading the file into
29
-
* memory so an oversized upload fails fast instead of materializing multiple GB in-process. */
30
-
constTIKTOK_MAX_VIDEO_BYTES=4*1024*1024*1024
28
+
/** Maximum size this route will buffer in memory for a single file-upload request. TikTok's
29
+
* own limit is 4GB, but relaying that much through this server's memory per request isn't
30
+
* safe under concurrent load. Enforced before downloading the file so an oversized upload
31
+
* fails fast with a clean 413 instead of materializing hundreds of MB to multiple GB
32
+
* in-process. Users with larger files can use the "Public URL" source instead, since
33
+
* PULL_FROM_URL never routes bytes through this process. */
'Signed cover image URL from TikTok CDN. Publicly fetchable without auth, but time-limited (embeds an x-expires param) — use it right away rather than storing it for later.',
96
97
optional: true,
97
98
},
98
99
embedLink: {type: 'string',description: 'Embeddable video URL',optional: true},
'Signed cover image URL from TikTok CDN. Publicly fetchable without auth, but time-limited (embeds an x-expires param) — use it right away rather than storing it for later.',
91
92
optional: true,
92
93
},
93
94
embedLink: {type: 'string',description: 'Embeddable video URL',optional: true},
0 commit comments