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 🙏

© 2024 – Pkg Stats / Ryan Hefner

downbili

v0.2.9

Published

fock ibili 下载视频

Downloads

6

Readme

downBili

B 站 URL 下载视频

严重警告:不可以将获取的资源用于恶意用途

Get started

option

| 参数 | 描述 | | ---------- | --------------------------------------------------------------- | | url | 视频 URL | | level | 112 是 1080P+,80 是 1080P,64 是 720P+,32 是 480P,16 是 360P | | sessdata | 你的 sessdata | | name | 名称 | | type | 视频类型 | | fileName | 文件名称 | | folder | folder | | onComplete | 执行成功的回调 |

result

| 参数 | 描述 | | -------- | -------------- | | fPath | 视频路径 | | cwd | 当前文件的目录 | | name | 视频名称 |

使用案例

仅下载视频

默认下载到当前目录/media

import { downBili } from 'downBili';

// 输入对应URL
const option = {
  url: 'xxx',
  fileName: '指定文件名',
  onComplete: () => {
    console.log('下载成功!');
  },
};

const main = async () => {
  await downBili(option);
};

main();

有大会员 请传入 session 默认下载 1080P 视频

import { downBili } from 'downBili';

// 输入对应URL
const option = {
  url: 'xxx',
  sessdata: 'xxx',
};

const main = async () => {
  await downBili(option);
};

main();

使用 ffmpeg 转换成音频

基于 ffmepg 实现,请先下载ffmpeg

下载单个转音频

// downloadSingleToAudio下载
import { downloadSingleToAudio } from 'downBili';

// 要转换的B站视频url
const option = {
  url: 'xxx',
};

const main = async () => {
  await downloadSingleToAudio(option);
};

main();

下载多个转音频

// videoToAudioConverter下载
import { videoToAudioConverter } from 'downBili';

// 要转换的B站视频url
const option = [
  {
    url: 'xxx',
    fileName: '指定文件名',
  },
  {
    url: 'xxx',
    fileName: '指定文件名2',
  }
]

const main = async () => {
  await videoToAudioConverter(option);
};

main();

可选传入配置

const downloadiSngleToAudio: (FormatDefaultType) => Promise<void>;

interface FormatDefaultType {
  /**
   * 格式 默认wav
   */
  format?: string;
  /**
   * 报错后回调
   */
  errorCallback?: () => void;
  /**
   * 成功回调
   */
  successCallback?: () => void;
  /**
   * 导出文件名
   */
  fileName?: string;
  /**
   * 文件路径
   */
  filePath?: string;
  /**
   * 是否删除原视频 默认true
   */
  deleteSourceMedia?: boolean;
  /**
   * 视频url
   */
  url: string
}