npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@zibot/scdl

v0.0.5

Published

Soucloud download

Readme

@zibot/scdl

@zibot/scdl là một module JavaScript hỗ trợ tải, tìm kiếm, và quản lý dữ liệu từ SoundCloud thông qua API. Module này cung cấp các phương thức tiện lợi để xử lý track, playlist, và tải nội dung.

Cài đặt

Bạn có thể cài đặt module này bằng npm hoặc yarn:

npm install @zibot/scdl

hoặc

yarn add @zibot/scdl

Sử dụng

Khởi tạo

Đầu tiên, bạn cần khởi tạo lớp SoundCloud để sử dụng các chức năng của module:

const { SoundCloud } = require("@zibot/scdl");

(async () => {
	const scdl = new SoundCloud({ init: true }); // Tự động lấy client ID
	await scdl.init(); // Đảm bảo client ID được khởi tạo
})();

Các phương thức

searchTracks(options)

Tìm kiếm các track trên SoundCloud.

const tracks = await scdl.searchTracks({ query: "chill", limit: 5 });
console.log(tracks);

Tham số:

  • query (bắt buộc): Từ khóa để tìm kiếm.
  • limit (mặc định: 20): Số lượng track tối đa.
  • offset (mặc định: 0): Vị trí bắt đầu.

getTrack(url)

Lấy thông tin chi tiết về một track.

const track = await scdl.getTrack("https://soundcloud.com/user/song");
console.log(track);

Tham số:

  • url (bắt buộc): URL của track.

getPlaylist(url)

Lấy thông tin chi tiết về một playlist.

const playlist = await scdl.getPlaylist("https://soundcloud.com/user/playlist");
console.log(playlist);

Tham số:

  • url (bắt buộc): URL của playlist.

downloadTrack(url, options)

Tải một track từ SoundCloud.

const stream = await scdl.downloadTrack("https://soundcloud.com/user/song");
stream.pipe(fs.createWriteStream("track.mp3"));

Tham số:

  • url (bắt buộc): URL của track.
  • options (tùy chọn): Cấu hình tải xuống.

Lưu ý

  • Trước khi sử dụng các phương thức như searchTracks, getTrack, hoặc downloadTrack, cần đảm bảo rằng phương thức init() đã hoàn thành để lấy clientId.
  • Nếu clientId không được khởi tạo, các phương thức này sẽ ném lỗi.

Đóng góp

Nếu bạn muốn đóng góp cho dự án này, vui lòng tạo một pull request hoặc mở một issue trên GitHub.


Giấy phép

Dự án này được cấp phép theo giấy phép MIT. Xem file LICENSE để biết thêm chi tiết.