upgrade upload images to v2
This commit is contained in:
parent
608185fd9a
commit
8bb1fc826f
1 changed files with 2 additions and 2 deletions
|
|
@ -319,7 +319,7 @@ export class XProvider extends SocialAbstract implements SocialProvider {
|
|||
return {
|
||||
id: await this.runInConcurrent(
|
||||
async () =>
|
||||
client.v1.uploadMedia(
|
||||
client.v2.uploadMedia(
|
||||
m.path.indexOf('mp4') > -1
|
||||
? Buffer.from(await readOrFetch(m.path))
|
||||
: await sharp(await readOrFetch(m.path), {
|
||||
|
|
@ -331,7 +331,7 @@ export class XProvider extends SocialAbstract implements SocialProvider {
|
|||
.gif()
|
||||
.toBuffer(),
|
||||
{
|
||||
mimeType: lookup(m.path) || '',
|
||||
media_type: (lookup(m.path) || '') as any,
|
||||
}
|
||||
),
|
||||
true
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue