Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

niconico

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

niconico

A nicovideo plug-in for NodeJS

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

niconico

npm version npm: total downloads Build Status Coverage Status

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

Contributing

Before create a pull-request, you need to test using npm test.

NICONICO_EMAIL=<email> NICONICO_PASSWORD=<password> npm test

Contributors ✨

Thanks goes to these wonderful people (emoji key):


uetchy

💻

Yuta Hiroto

💻

m77so

💻

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

Keywords

FAQs

Package last updated on 23 Jul 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc