1.1.3 • Published 3 years ago

twitter-url v1.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

twitter-url

A very crude way to get the internal twitter video url

let  {parseUrl, getDetailsConcise} = require("twitter-url");
let {id} = parseUrl("https://twitter.com/LetMeThinkOfAU1/status/1334241608078790659");
let  details = getDetailsConcise(id);

console.log(details.highest_video_url); //https://video.twimg.com/ext_tw_video/1334241558246252544/pu/vid/1280x720/XnFplcd-MwKi4HFw.mp4?tag=10

API

parseUrlReturns the video id and user as an object{id: video_id, user: user}
getDetailsReturns the entire response fetched by the twitter API
getDetailsConciseReturns a stripped down result with the important details

getDetails returns

{
  globalObjects: {
    tweets: { '0000000000000000000': [Object] },
    users: { '0000000000000000000': [Object] },
    moments: {},
    cards: {},
    places: {},
    media: {},
    broadcasts: {},
    topics: {},
    lists: {}
  },
  timeline: {
    id: 'Conversation-0000000000000000000',
    instructions: [ [Object], [Object] ],
    responseObjects: { feedbackActions: {} }
  }
}

getDetailsConcise returns

{
  videos: {
    aspect_ratio: [ 16, 9 ],
    duration_millis: 29733,
    variants: [ [Object], [Object], [Object], [Object] ]
  },
  title: 'This is an example',
  highest_video_url: 'https://video.twimg.com/ext_tw_video/0000000000000000000/pu/vid/1280x720/xxxxxxxxxxxxx.mp4?tag=10',
  thumbnail: 'http://pbs.twimg.com/ext_tw_video_thumb/0000000000000000000/pu/img/xxxxxxxxxxxxx.jpg',
  user_name: 'name'
}
1.1.3

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago