draftbit / twitter-lite

A tiny, full-featured, flexible client / server library for the Twitter API
https://npm.im/twitter-lite
MIT License
794 stars 95 forks source link

media/upload does work for images but not with videos #124

Closed faustoct1 closed 4 years ago

faustoct1 commented 4 years ago

this code works fine with images but doesn't with videos

url = await client.post("media/upload", { media_data: data })

{
  _headers: Headers {
    [Symbol(map)]: [Object: null prototype] {
      'cache-control': [Array],
      connection: [Array],
      'content-disposition': [Array],
      'content-encoding': [Array],
      'content-length': [Array],
      'content-type': [Array],
      date: [Array],
      expires: [Array],
      'last-modified': [Array],
      pragma: [Array],
      server: [Array],
      'set-cookie': [Array],
      status: [Array],
      'strict-transport-security': [Array],
      vary: [Array],
      'x-access-level': [Array],
      'x-connection-hash': [Array],
      'x-frame-options': [Array],
      'x-rate-limit-limit': [Array],
      'x-rate-limit-remaining': [Array],
      'x-rate-limit-reset': [Array],
      'x-response-time': [Array],
      'x-transaction': [Array],
      'x-tsa-request-body-time': [Array],
      'x-twitter-response-tags': [Array],
      'x-xss-protection': [Array]
    }
  },
  request: '/1.1/media/upload.json',
  error: 'media type unrecognized.'
}
faustoct1 commented 4 years ago

got something here

client.get(...) => {"media_id":1284554329119236000,"media_id_string":"1284554329119236097","media_key":"7_1284554329119236097","size":1939232,"processing_info":{"state":"failed","progress_percent":100,"error":{"code":1,"name":"InvalidMedia","message":"file is invalid"}},"_headers":{}}

ishkapoor2000 commented 2 years ago

How to get _media_idstring ?