MIT License

项目介绍

hostinger-bot/btch-downloader 是一个托管在 GitHub 上的开源项目,主要使用 TypeScript 编写,采用 MIT License 许可证,目前获得 86 个 Star、22 次 Fork。

仓库全名
hostinger-bot/btch-downloader
开源许可证
MIT License
Star 数
86
Fork 数
22
未关闭 Issue
3

README 摘要

btch-downloader Support Me A lightweight TypeScript/JavaScript client SDK for downloading videos, images, and audio from Instagram, TikTok, YouTube, Capcut, Pinterest, Twitter, X, Google Drive, MediaFire, Douyin, SnackVideo, Xiaohongshu (and Profile), Cocofun, Spotify, Youtube Search, SounCloud, Threads, Kuaishou and Facebook. Project Prerequisites To ensure this project runs smoothly, make sure you have the…

完整内容见 GitHub 原始 README 或本页 。

常见问题

btch-downloader 用什么语言开发?

主要使用 TypeScript 编写,采用 MIT License 许可证,目前有 86 个 Star。

btch-downloader 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 btch-downloader 的源码?

可以直接克隆仓库:git clone https://github.com/hostinger-bot/btch-downloader.git,默认分支为 main;安装与运行步骤见仓库 README。

btch-downloader 最近还在维护吗?

仓库最近一次更新为 2 天前,当前有 3 个未关闭 Issue;Star 数为 86,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

A lightweight TypeScript/JavaScript client SDK for downloading videos, images, and audio from Instagram, TikTok, YouTube, Capcut, Pinterest, Twitter, X, Google Drive, MediaFire, Douyin, SnackVideo, Xiaohongshu (and Profile), Cocofun, Spotify, Youtube Search, SounCloud, Threads, Kuaishou and Facebook.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

HTML
JavaScript
TypeScript

Release

README

btch-downloader

Version License GitHub Stars GitHub Forks GitHub Watchers Contributors Open Issues Closed Issues Open Pull Requests Closed Pull Requests TypeScript Downloads JSDelivr unpkg CDN Node.js Package CodeQL Advanced Socket Badge

Support Me

npm badge

A lightweight TypeScript/JavaScript client SDK for downloading videos, images, and audio from Instagram, TikTok, YouTube, Capcut, Pinterest, Twitter, X, Google Drive, MediaFire, Douyin, SnackVideo, Xiaohongshu (and Profile), Cocofun, Spotify, Youtube Search, SounCloud, Threads, Kuaishou and Facebook.

Project Prerequisites

To ensure this project runs smoothly, make sure you have the following tools installed.

Prerequisite Version
Node.js v20+
Package Manager pnpm 10.18.3+, Yarn 4.10.3+, or Bun 1.3.0+

Alternatively, you can include btch-downloader by getting it from npm, downloading it from GitHub releases or by including it via unpkg or another JavaScript CDN, like jsDelivr.

<!-- unpkg : use the latest version of btch-downloader -->
<script src="https://unpkg.com/btch-downloader/dist/browser/index.min.js"></script>

<!-- unpkg : use a specific version of btch-downloader (change the version numbers as necessary) -->
<script src="https://unpkg.com/[email protected]/dist/browser/index.min.js"></script>

<!-- jsDelivr : use the latest version of btch-downloader -->
<script src="https://cdn.jsdelivr.net/npm/btch-downloader/dist/browser/index.min.js"></script>

<!-- jsDelivr : use a specific version of btch-downloader (change the version numbers as necessary) -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/browser/index.min.js"></script>

📘 Click here to see how to implement this downloader using CDN (HTML Example)
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Playground Test CDN btch-downloader</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background: #f9f9fb;
      color: #222;
      max-width: 900px;
      margin: 40px auto;
      padding: 25px;
    }
    h1 {
      color: #0078ff;
      text-align: center;
    }
    input {
      width: 60%;
      padding: 10px;
      border: 1px solid #ccc;
      border-radius: 6px;
      font-size: 15px;
    }
    select {
      padding: 10px;
      border: 1px solid #ccc;
      border-radius: 6px;
      font-size: 15px;
      margin-right: 10px;
    }
    button {
      padding: 10px 20px;
      border: none;
      border-radius: 6px;
      background: #0078ff;
      color: white;
      cursor: pointer;
    }
    button:hover {
      background: #005ecc;
    }
    pre {
      text-align: left;
      background: #fff;
      border: 1px solid #ddd;
      border-radius: 6px;
      padding: 10px;
      overflow-x: auto;
      white-space: pre-wrap;
    }
    hr {
      margin: 30px 0;
    }
    ul {
      text-align: left;
      background: #fff;
      border-radius: 6px;
      padding: 15px;
      border: 1px solid #ddd;
    }
    li {
      margin-bottom: 6px;
    }
    a {
      color: #0078ff;
      text-decoration: none;
    }
    a:hover {
      text-decoration: underline;
    }
    .info {
      text-align: center;
      margin-top: 10px;
      font-size: 14px;
      color: #555;
    }
  </style>
</head>
<body>
  <h1>Playground</h1>
  <p align="center">A single-page downloader for all supported platforms.</p>

  <div align="center">
    <select id="platformSelect">
      <option value="auto">Auto Detect</option>
      <option value="instagram">Instagram</option>
      <option value="tiktok">TikTok</option>
      <option value="facebook">Facebook</option>
      <option value="twitter">Twitter</option>
      <option value="youtube">YouTube</option>
      <option value="mediafire">MediaFire</option>
      <option value="capcut">CapCut</option>
      <option value="gdrive">Google Drive</option>
      <option value="pinterest">Pinterest</option>
      <option value="douyin">Douyin</option>
      <option value="xiaohongshu">Xiaohongshu</option>
      <option value="xiaohongshuProfile">Xiaohongshu Profile</option>
      <option value="snackvideo">SnackVideo</option>
      <option value="cocofun">Cocofun</option>
      <option value="spotify">Spotify</option>
      <option value="yts">YTS</option>
      <option value="soundcloud">SoundCloud</option>
      <option value="threads">Threads</option>
      <option value="kuaishou">Kuaishou</option>
    </select>
    <input id="urlInput" placeholder="Paste any supported URL here..." />
    <button id="downloadBtn">Fetch</button>
  </div>

  <div class="info">
    Developer: <strong>@prm2.0</strong> — 
    <a href="https://github.com/hostinger-bot/btch-downloader/issues" target="_blank">Report Issues</a>
  </div>

  <h3>Result:</h3>
  <pre id="output">No data yet...</pre>

  <hr>
  <h3>Example URLs</h3>
  <ul>
    <li>Instagram: <a href="https://www.instagram.com/reel/DKPtUL_S9Nh/?igsh=MTE1dTVkb2E4NTFmcw==" target="_blank">https://www.instagram.com/reel/DKPtUL_S9Nh/?igsh=MTE1dTVkb2E4NTFmcw==</a></li>
    <li>TikTok: <a href="https://www.tiktok.com/@omagadsus/video/7025456384175017243" target="_blank">https://www.tiktok.com/@omagadsus/video/7025456384175017243</a></li>
    <li>Facebook: <a href="https://www.facebook.com/watch/?v=1393572814172251" target="_blank">https://www.facebook.com/watch/?v=1393572814172251</a></li>
    <li>Twitter: <a href="https://twitter.com/gofoodindonesia/status/1229369819511709697" target="_blank">https://twitter.com/gofoodindonesia/status/1229369819511709697</a></li>
    <li>YouTube: <a href="https://youtu.be/C8mJ8943X80" target="_blank">https://youtu.be/C8mJ8943X80</a></li>
    <li>MediaFire: <a href="https://www.mediafire.com/file/941xczxhn27qbby/GBWA_V12.25FF-By.SamMods-.apk/file" target="_blank">https://www.mediafire.com/file/941xczxhn27qbby/GBWA_V12.25FF-By.SamMods-.apk/file</a></li>
    <li>CapCut: <a href="https://www.capcut.com/template-detail/7299286607478181121" target="_blank">https://www.capcut.com/template-detail/7299286607478181121</a></li>
    <li>Google Drive: <a href="https://drive.google.com/file/d/1thDYWcS5p5FFhzTpTev7RUv0VFnNQyZ4/view" target="_blank">https://drive.google.com/file/d/1thDYWcS5p5FFhzTpTev7RUv0VFnNQyZ4/view</a></li>
    <li>Pinterest: <a href="https://pin.it/4CVodSq" target="_blank">https://pin.it/4CVodSq</a> or query (e.g., "Zhao Lusi")</li>
    <li>Douyin: <a href="https://v.douyin.com/ikq8axJ/" target="_blank">https://v.douyin.com/ikq8axJ/</a></li>
    <li>Xiaohongshu: <a href="http://xhslink.com/o/21DKXV988zp" target="_blank">http://xhslink.com/o/21DKXV988zp</a></li>
    <li>Xiaohongshu Profile: <a href="https://www.xiaohongshu.com/user/profile/

提示:代码过长已自动截断

Demo HTML

Try Demo

Installing

Package manager

Using npm:

npm install btch-downloader

Using yarn:

yarn add btch-downloader

Using pnpm:

pnpm add btch-downloader

Using bun:

bun add btch-downloader

Services

Service Link Status
Documentation Visit Online
Backend Visit Online
API Reference Visit Online

Usage

Instagram

ESM
import { igdl } from 'btch-downloader';

const url = 'https://www.instagram.com/reel/DKPtUL_S9Nh/?igsh=MTE1dTVkb2E4NTFmcw==';
igdl(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { igdl } = require('btch-downloader');

const url = 'https://www.instagram.com/reel/DKPtUL_S9Nh/?igsh=MTE1dTVkb2E4NTFmcw==';
igdl(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

TikTok

ESM
import { ttdl } from 'btch-downloader';

const url = 'https://www.tiktok.com/@omagadsus/video/7025456384175017243?is_from_webapp=1&sender_device=pc&web_id6982004129280116226';
ttdl(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { ttdl } = require('btch-downloader');

const url = 'https://www.tiktok.com/@omagadsus/video/7025456384175017243?is_from_webapp=1&sender_device=pc&web_id6982004129280116226';
ttdl(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

Facebook

ESM
import { fbdown } from 'btch-downloader';

const url = 'https://www.facebook.com/watch/?v=1393572814172251';
fbdown(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { fbdown } = require('btch-downloader');

const url = 'https://www.facebook.com/watch/?v=1393572814172251';
fbdown(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

Twitter

ESM
import { twitter } from 'btch-downloader';

const url = 'https://twitter.com/gofoodindonesia/status/1229369819511709697';
twitter(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { twitter } = require('btch-downloader');

const url = 'https://twitter.com/gofoodindonesia/status/1229369819511709697';
twitter(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

YouTube

ESM
import { youtube } from 'btch-downloader';

const url = 'https://youtube.com/watch?v=C8mJ8943X80';
youtube(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { youtube } = require('btch-downloader');

const url = 'https://youtube.com/watch?v=C8mJ8943X80';
youtube(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

MediaFire (no longer maintained / 不再维护)

ESM
import { mediafire } from 'btch-downloader';

const url = 'https://www.mediafire.com/file/941xczxhn27qbby/GBWA_V12.25FF-By.SamMods-.apk/file';
mediafire(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { mediafire } = require('btch-downloader');

const url = 'https://www.mediafire.com/file/941xczxhn27qbby/GBWA_V12.25FF-By.SamMods-.apk/file';
mediafire(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

Capcut

ESM
import { capcut } from 'btch-downloader';

const url = 'https://www.capcut.com/template-detail/7299286607478181121?template_id=7299286607478181121&share_token=80302b19-8026-4101-81df-2fd9a9cecb9c&enter_from=template_detail®ion=ID&language=in&platform=copy_link&is_copy_link=1';
capcut(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { capcut } = require('btch-downloader');

const url = 'https://www.capcut.com/template-detail/7299286607478181121?template_id=7299286607478181121&share_token=80302b19-8026-4101-81df-2fd9a9cecb9c&enter_from=template_detail®ion=ID&language=in&platform=copy_link&is_copy_link=1';
capcut(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

Google Drive

ESM
import { gdrive } from 'btch-downloader';

const url = 'https://drive.google.com/file/d/1thDYWcS5p5FFhzTpTev7RUv0VFnNQyZ4/view?usp=drivesdk';
gdrive(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { gdrive } = require('btch-downloader');

const url = 'https://drive.google.com/file/d/1thDYWcS5p5FFhzTpTev7RUv0VFnNQyZ4/view?usp=drivesdk';
gdrive(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

Pinterest

ESM
import { pinterest } from 'btch-downloader';

const url = 'https://pin.it/4CVodSq';
pinterest(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

// Using a search query
pinterest('Zhao Lusi')
  .then(data => console.log(data))
  .catch(err => console.error(err)); // JSON
CJS
const { pinterest } = require('btch-downloader');

const url = 'https://pin.it/4CVodSq';
pinterest(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

// Using a search query
pinterest('Zhao Lusi')
  .then(data => console.log(data))
  .catch(err => console.error(err)); // JSON

AIO (no longer maintained / 不再维护)

ESM
import { aio } from 'btch-downloader';

const url = 'https://vt.tiktok.com/ZSkGPK9Kj/';
aio(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { aio } = require('btch-downloader');

const url = 'https://vt.tiktok.com/ZSkGPK9Kj/';
aio(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

Douyin (抖音)

ESM
import { douyin } from 'btch-downloader';

const url = 'https://v.douyin.com/ikq8axJ/';
douyin(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { douyin } = require('btch-downloader');

const url = 'https://v.douyin.com/ikq8axJ/';
douyin(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

Xiaohongshu (小红书)

ESM
import { xiaohongshu } from 'btch-downloader';

const url = 'http://xhslink.com/o/21DKXV988zp';
xiaohongshu(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { xiaohongshu } = require('btch-downloader');

const url = 'http://xhslink.com/o/21DKXV988zp';
xiaohongshu(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

Xiaohongshu Profile (小红书)

ESM
import { xiaohongshuProfile } from 'btch-downloader';

const url = 'https://www.xiaohongshu.com/user/profile/67873204000000000803d9a5';
xiaohongshuProfile(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { xiaohongshuProfile } = require('btch-downloader');

const url = 'https://www.xiaohongshu.com/user/profile/67873204000000000803d9a5';
xiaohongshuProfile(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

Snackvideo

ESM
import { snackvideo } from 'btch-downloader';

const url = 'https://s.snackvideo.com/p/j9jKr9dR';
snackvideo(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { snackvideo } = require('btch-downloader');

const url = 'https://s.snackvideo.com/p/j9jKr9dR';
snackvideo(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

Cocofun

ESM
import { cocofun } from 'btch-downloader';

const url = 'https://www.icocofun.com/share/post/379250110809?lang=id&pkg=id&share_to=copy_link&m=81638cf44ba27b2ffa708f3410a4e6c2&d=63cd2733d8d258facd28d44fde5198d4cea826e89af7efc4238ada620140eea3&nt=1';
cocofun(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { cocofun } = require('btch-downloader');

const url = 'https://www.icocofun.com/share/post/379250110809?lang=id&pkg=id&share_to=copy_link&m=81638cf44ba27b2ffa708f3410a4e6c2&d=63cd2733d8d258facd28d44fde5198d4cea826e89af7efc4238ada620140eea3&nt=1';
cocofun(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

Spotify

ESM
import { spotify } from 'btch-downloader';

const url = 'https://open.spotify.com/track/3zakx7RAwdkUQlOoQ7SJRt';
spotify(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { spotify } = require('btch-downloader');

const url = 'https://open.spotify.com/track/3zakx7RAwdkUQlOoQ7SJRt';
spotify(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
ESM
import { yts } from 'btch-downloader';

const query = 'Somewhere Only We Know';
yts(query).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { yts } = require('btch-downloader');

const query = 'Somewhere Only We Know';
yts(query).then(data => console.log(data)).catch(err => console.error(err)); // JSON

SoundCloud

ESM
import { soundcloud } from 'btch-downloader';

const url = 'https://soundcloud.com/issabella-marchelina/sisa-rasa-mahalini-official-audio?utm_source=clipboard&utm_medium=text&utm_campaign=social_sharing';
soundcloud(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { soundcloud } = require('btch-downloader');

const url = 'https://soundcloud.com/issabella-marchelina/sisa-rasa-mahalini-official-audio?utm_source=clipboard&utm_medium=text&utm_campaign=social_sharing';
soundcloud(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

Threads

ESM
import { threads } from 'btch-downloader';

const url = 'https://www.threads.net/@cindyyuvia/post/C_Nqx3khgkI/?xmt=AQGzpsCvidh8IwIqOvq4Ov05Zd5raANiVdvCujM_pjBa1Q';
threads(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON
CJS
const { threads } = require('btch-downloader');

const url = 'https://www.threads.net/@cindyyuvia/post/C_Nqx3khgkI/?xmt=AQGzpsCvidh8IwIqOvq4Ov05Zd5raANiVdvCujM_pjBa1Q';
threads(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

Kuaishou (快手)

ESM
import { kuaishou } from 'btch-downloader';

const url = 'https://v.kuaishou.com/JT195ZHT';
kuaishou(url).then(data => console.log(data)).catch(err => console.error(err)); //JSON
CJS
const { kuaishou } = require('btch-downloader');

const url = 'https://v.kuaishou.com/JT195ZHT';
kuaishou(url).then(data => console.log(data)).catch(err => console.error(err)); //JSON

Important Notes

  1. This downloader can only be used to download media that is public or accessible to the public.
  2. This application is not affiliated with or endorsed by any application.
  3. Ensure you have permission or copyright to download media before using this application.

Contribution and Issue Reporting

If you encounter any issues or wish to contribute to the development of this application, please visit our GitHub repository.

License

btch-downloader is licensed under the MIT License. Please refer to the LICENSE file for more information.

评论

暂无评论