feat(graphql): support video uploads
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user