Skip to main content

Downloading videos, comments and thumbnails and handling your Mylists on niconico (ニコニコ動画).

Project description

https://travis-ci.org/mo-san/niconico-tools.svg?branch=master https://codecov.io/gh/mo-san/niconico-tools/branch/master/graph/badge.svg https://coveralls.io/repos/github/mo-san/niconico-tools/badge.svg?branch=master Code Health https://badge.fury.io/py/nicotools.svg

Features

This is a command-line tool and python utility module to download videos, comments and thumbnail images on niconico (nicovideo.jp). And also with this you can handle your Mylists: add, delete, move and copy each items and create or remove new lists.

  • Thumbnails: larger and smaller ones.

  • Comments: in XML and JSON format.

  • Videos: in both types, i.e. of “smile” server (older one) and of “dmc.nico” server (newer one).

  • Concurrent download (4x faster by default).

Installation

pip install nicotools

Requirements

  • Python >= 3.4

  • requests

  • prettytable

  • bs4 (BeautifulSoup4)

  • aiohttp

  • tqdm

Usage

By running without any arguments, we will show you a help.

Usage as a CLI tool

For the first time you will asked your mail address and password. From the next time on HTTP Cookie will be saved in to your HOME directory, so mail and pass are not needed. Or you may specify your credentials every time you run this, as this:

nicotools download -v sm9 --mail <mail address> --pass <password>

Downloading

  • To download thumbnails of video ids of sm1, … sm5:

    nicotools downlaod --thumbnail --dest "./Downloads" sm1 sm2 sm3 sm4 sm5

  • To downalod thumbnails, comments and videos of those:

    nicotools download --comment --video --thumbnail --dest "./Downloads" sm1 sm2 sm3 sm4 sm5

  • Shorthand commands and how to specify video ids from text file (prepend plus sign):

    nicotools download -cvt -d "./Downloads" +ids.txt

  • XML comment (”–dest” is for destination directory):

    nicotools download -cvt --xml -dest "./Downloads" sm1

  • to list up whole contents in all LISTS (TAB separated format):

    nicotools mylist * --show --everything --out D:/Downloads/all.txt

Dealing with Mylists

  • to apped videos on MYLIST:

    nicotools mylist MYLIST --add sm1 sm2 sm3

  • another way to append: from a text file, in which video id in each lines are written:

    nicotools mylist MYLIST --add +C:/Users/Me/Desktop/ids.txt

  • specify the MYLIST by its ID (this is shown in the LIST’s URL):

    nicotools mylist 12345678 --id --add sm1 sm2 sm3

  • to dleete items from MYLIST:

    nicotools mylist MYLIST --delete sm1 sm2 sm3

  • to clear the MYLIST:

    nicotools mylist MYLIST --delete *

  • to clear the MYLIST without confirmation:

    nicotools mylist MYLIST --delete * --yes

  • to move some items in MYLIST to –to:

    nicotools mylist MYLIST --to foofoo --move sm1 sm2 sm3

  • to copy entire items in MYLIST to –to:

    nicotools mylist MYLIST --to barbar --move *

  • to copy some items in MYLIST to –to:

    nicotools mylist MYLIST --to baaboo --copy sm1 sm2 sm3

  • to copy entire items in MYLIST to –to:

    nicotools mylist MYLIST --to foobar --copy *

  • to list up all LIST’s names:

    nicotools mylist * --show

  • to list up whole contents in all LISTS (TAB separated format):

    nicotools mylist * --show --everything --out D:/Downloads/all.txt

  • to list up whole contents in all LISTS (TABLE format):

    nicotools mylist * --show --show --everything --out D:/Downloads/all.txt

  • to list up items in a single LIST:

    nicotools mylist MYLIST --export

  • to list up video ids of whole contents in all LISTS:

    nicotools mylist * --export --everything --out D:/Downloads/all.txt

  • to list up the metadata of LISTS:

    nicotools mylist * --export --out D:/Downloads/all.txt

  • to create new LIST with name of LISTNAME:

    nicotools mylist LISTNAME --create

  • to remove the LIST:

    nicotools mylist MYLIST --purge

  • to remove the LIST without cconfirmation:

    nicotools mylist MYLIST --purge --yes

Usage as a module

from nicotools.nicodown_async import VideoDmc, VideoSmile
from nicotools.nicodown_async import Comment, Thumbnail

mail = "<your mail address>"
password = "<your password>"
xml = True # Set to True if you want in XML format, default is JSON

# a list of video ids
video_ids = ["sm1", "sm2", "sm3"]
# directory path to save files in
DIR_PATH = "./downloads/"

Thumbnail().start(video_ids, DIR_PATH)

Comment(mail, password).start(video_ids, DIR_PATH, xml)

VideoSmile(mail, password).start(video_ids, DIR_PATH)

VideoDmc(mail, password).start(video_ids, DIR_PATH)

Change log

v1.0.0 Initial Version

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nicotools-1.0.2.tar.gz (52.9 kB view details)

Uploaded Source

Built Distribution

nicotools-1.0.2-py3.7.egg (130.9 kB view details)

Uploaded Source

File details

Details for the file nicotools-1.0.2.tar.gz.

File metadata

  • Download URL: nicotools-1.0.2.tar.gz
  • Upload date:
  • Size: 52.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for nicotools-1.0.2.tar.gz
Algorithm Hash digest
SHA256 d4e2c6e334d681fd79836cb41d3fb6993f294115fed4d34870357c47b06dda23
MD5 03c45516236f17ac5a2ff69af5e091e3
BLAKE2b-256 f6688927d77bd7e74ba65020df08cfe7f3968238f04bbf26ddbebf917201f022

See more details on using hashes here.

File details

Details for the file nicotools-1.0.2-py3.7.egg.

File metadata

  • Download URL: nicotools-1.0.2-py3.7.egg
  • Upload date:
  • Size: 130.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0b4

File hashes

Hashes for nicotools-1.0.2-py3.7.egg
Algorithm Hash digest
SHA256 0dde8d705f9ece84fc3a9a29b80c13223995a9e339907414ac2474b48792d883
MD5 f6d24d74cbcdafd043d4430551258c35
BLAKE2b-256 cbe038307219038b390cf6900e5fa7887d96ddb402141cc0865900e0124aff2e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page