feat(graphql): support video uploads

This commit is contained in:
Peter Steinberger
2025-12-26 15:27:35 +01:00
parent 3be2e3ae7e
commit 0bf7190c95
5 changed files with 33 additions and 25 deletions
-12
View File
@@ -407,12 +407,6 @@ program
}
}
const hasVideo = media.some((m) => m.mime.startsWith('video/'));
if (hasVideo) {
console.error(`${p('err')}Video uploads are only supported via Sweetistics (for now).`);
process.exit(1);
}
const { cookies, warnings } = await resolveCredentials({
authToken: opts.authToken,
ct0: opts.ct0,
@@ -547,12 +541,6 @@ program
}
}
const hasVideo = media.some((m) => m.mime.startsWith('video/'));
if (hasVideo) {
console.error(`${p('err')}Video uploads are only supported via Sweetistics (for now).`);
process.exit(1);
}
const { cookies, warnings } = await resolveCredentials({
authToken: opts.authToken,
ct0: opts.ct0,
+1 -6
View File
@@ -387,11 +387,6 @@ export class TwitterClient {
const category = this.mediaCategoryForMime(input.mimeType);
if (!category) return { success: false, error: `Unsupported media type: ${input.mimeType}` };
// Keep scope small: images/gif first. Video requires longer processing + larger chunks.
if (input.mimeType.startsWith('video/')) {
return { success: false, error: 'Video uploads are not supported via GraphQL yet (use Sweetistics)' };
}
try {
const initParams = new URLSearchParams({
command: 'INIT',
@@ -501,7 +496,7 @@ export class TwitterClient {
}
}
if (input.alt) {
if (input.alt && input.mimeType.startsWith('image/')) {
const metaResp = await this.fetchWithTimeout(TWITTER_MEDIA_METADATA_URL, {
method: 'POST',
headers: this.getJsonHeaders(),