# twitter-url

> Crude but effective way of getting the internal twitter video url

Latest version **1.1.3** (published 2021-10-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install twitter-url
pnpm add twitter-url
yarn add twitter-url
bun add twitter-url
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2021-10-02 |
| First published | 2021-09-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Prince Komali |
| Maintainers | komali09 |
| Keywords | twitter, download, url |

## Links

- npm: https://www.npmjs.com/package/twitter-url
- Repository: https://github.com/PrinceKomali/twitter-url
- Homepage: https://github.com/PrinceKomali/twitter-url#readme
- Issues: https://github.com/PrinceKomali/twitter-url/issues
- npm.io page: https://npm.io/package/twitter-url

## Dependencies (1)

- [sync-fetch](https://npm.io/package/sync-fetch.md) ^0.3.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.1.3 (latest) — 2021-10-02
- 1.0.3 — 2021-10-02
- 1.0.2 — 2021-09-13
- 1.0.1 — 2021-09-05
- 1.0.0 — 2021-09-05

## README

# twitter-url
A very crude way to get the internal twitter video url
```js
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

|       |  |
| ----------- | ----------- |
| `parseUrl`    | Returns the video id and user as an object<br>```{id: video_id, user: user}```       |
| `getDetails`| Returns the entire response fetched by the twitter API
| `getDetailsConcise` | Returns a stripped down result with the important details

`getDetails` returns 
```js
{
  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
```js
{
  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'
}
```

---
_Source: https://npm.io/package/twitter-url · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
