SkillAgentSearch skills...

Niconico

📺 niconico API wrapper for NodeJS.

Install / Use

/learn @uetchy/Niconico
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

niconico

npm version npm: total downloads Build Status Coverage Status docs

niconico API library for Node.JS, armed with Promises.

Usage

npm install niconico
const { niconico, Nicovideo } = require('niconico')

const baseDir = './videos'

async function downloadVideo(videoID) {
  try {
    const session = await niconico.login(
      process.env.EMAIL,
      process.env.PASSWORD
    )
    const client = new Nicovideo(session)
    const filePath = await client.download(videoID, baseDir)

    console.log('Downloaded:', filePath)
  } catch (err) {
    console.log('Error:', err)
  }
}

downloadVideo('sm28222588')

API

API Documents

The APIs return Promises. You can chain them with then and catch.

niconico.login(email, password)

Returns a session cookie.

email

Type: string

password

Type: string

new Nicovideo([session])

Returns a nicovideo agent. If a session is given, the agent will be authenticated and act as a signed user.

session

a session cookie given by niconico.login.

nicovideo.download(videoID, outputDir)

Download a video to local dir.

videoID

Type: string

outputDir

Type: string

nicovideo.watch(videoID)

Fetch a /watch/ page and returns its metadata.

videoID

Type: string

nicovideo.thumbinfo(videoID)

Returns thumbinfo. This doesn't requires session.

videoID

Type: string

nicovideo.httpExport(url, outputPath)

Download the video from url to outputPath.

url

Type: string

outputPath

Type: string

nicovideo.stream(videoID)

Return stream.Readable to download the video.

videoID

Type: string

Contributing

See Contribution Guide for more information.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tr> <td align="center"><a href="https://uechi.io/"><img src="https://avatars0.githubusercontent.com/u/431808?v=4?s=100" width="100px;" alt=""/><br /><sub><b>uetchy</b></sub></a><br /><a href="https://github.com/uetchy/niconico/commits?author=uetchy" title="Code">💻</a></td> <td align="center"><a href="https://hiroppy.me/"><img src="https://avatars1.githubusercontent.com/u/3367801?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yuta Hiroto</b></sub></a><br /><a href="https://github.com/uetchy/niconico/commits?author=hiroppy" title="Code">💻</a></td> <td align="center"><a href="https://github.com/m77so"><img src="https://avatars0.githubusercontent.com/u/5989758?v=4?s=100" width="100px;" alt=""/><br /><sub><b>m77so</b></sub></a><br /><a href="https://github.com/uetchy/niconico/commits?author=m77so" title="Code">💻</a></td> </tr> </table> <!-- markdownlint-enable --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the all-contributors specification. Contributions of any kind welcome!

View on GitHub
GitHub Stars30
CategoryContent
Updated1y ago
Forks4

Languages

TypeScript

Security Score

80/100

Audited on Jul 1, 2024

No findings