Socket
Socket
Sign inDemoInstall

x-downloader

Package Overview
Dependencies
9
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    x-downloader

Scraper for download Media from Twitter


Version published
Weekly downloads
12
decreased by-25%
Maintainers
1
Install size
2.13 MB
Created
Weekly downloads
 

Readme

Source

Twitter Media Downloader



Table of Contents

Description

  • Used to download video & image from Twitter
  • Use cookies to view sensitive / nsfw content



  • Then you log in first to go to Home
  • Then go to Network and the search filter becomes https://twitter.com/home
  • If it doesn't appear, refresh the page

\

  • Copy the Cookie and use it

Installation

  • twitter-downloader requires Node.js v12+ to run.

From NPM

npm install twitter-downloader

From YARN

yarn add twitter-downloader

From Github

npm install github:TobyG74/twitter-downloader

Usage

const { TwitterDL } = require("twitter-downloader");

const twitter_video_url = "https://twitter.com/AnimeWithRJ/status/1645156770266923008";
const twitter_image_url = "https://twitter.com/GenshinImpact/status/1645308130857820161";

TwitterDL(twitter_video_url, {
  authorization?: "YOUR_AUTHORIZATION", // undefined == use default authorization
  cookie?: "YOUR_COOKIE" // to display sensitive / nsfw content (no default cookies)
})
    .then((result) => {
        console.log(result);
    })
    .catch((e) => {
        console.log(e);
    });

Response

status: "success" | "error"
message?: string
result?: {
    id: string
    createdAt: string
    description: string
    languange: string
    possiblySensitive: boolean
    possiblySensitiveEditable: boolean
    isQuoteStatus: boolean
    mediaCount: number
    author: {
      username: string
      bio: string
      possiblySensitive: boolean
      verified: boolean
      location: string
      profileBannerUrl: string
      profileImageUrl: string
      url: string
      statistics: {
        favoriteCount: number
        followersCount: number
        friendsCount: number
        statusesCount: number
        listedCount: number
        mediaCount: number
      }
    }
    statistics: {
      replieCount: number
      retweetCount: number
      favoriteCount: number
      viewCount: number
    }
    media: Media[]
}

/** Image Media */
{
  type: string
  image: string
  expandedUrl: string
}[]

/** Video Media */
{
  type: string
  expandedUrl: string
  cover: string
  duration: string
  videos: {
    bitrate: number
    content_type: string
    quality: string
    url: string
  }[]
}[]

Keywords

FAQs

Last updated on 16 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc