Skip to main content

A python client to interact with nicovideo.jp

Project description

nicoclient

codecov PyPI

A python client to interact with nicovideo.jp.

Installation

pip install nicoclient

Features

Get metadata

metadata = nicoclient.get_metadata('sm34734479')
print(json.dumps(metadata, indent=2, ensure_ascii=False))
{
  "id": "sm34734479",
  "views": 3033,
  "likes": 163,
  "thumbnail_url": "http://tn.smilevideo.jp/smile?i=34734479.81262",
  "title": "出来るだけ感情的に「ヘイトクライム」を歌いました。",
  "uploader_id": "33765098",
  "tags": [
    "歌ってみた",
    "ヘイトクライム(さまぐら)",
    "さまぐら",
    "檀上大空",
    "みけ(歌い手)",
    "ててて",
    "ボカロオリジナルを歌ってみた"
  ],
  "description": "最後まで聴いてもらえると嬉しいです。素晴らしい原曲  sm33841308MIX みけ mylist/58924781 https://twitter.com/rnike_san 歌 ててて mylist/41403147 https://twitter.com/tetete2525"
}

Get trending videos

videos = nicoclient.get_trending_videos()
for video in videos:
    print(f"'{video['id']}' has {video['views']} views and {video['likes']} likes")
'sm34658459' has 40057 views and 1293 likes
'sm34248511' has 278194 views and 14274 likes
'sm34676260' has 96529 views and 6554 likes
...

Get videos in a playlist

videos = nicoclient.get_videos_by_playlist_id('58924781')
for video in videos:
    print(f"'{video['id']}' has {video['views']} views and {video['likes']} likes")
'sm29118726' has 1104 views and 28 likes
'sm29299741' has 837 views and 19 likes
'sm29816849' has 1476 views and 32 likes
...

Get related videos

Use case 1

If the video is a Vocaloid Original, then the function returns Utattemita videos.

related_videos = nicoclient.get_related_videos('sm32076378')
print('\n'.join([v['title'] for v in related_videos]))
"ドラマツルギー 歌ってみた【りぶ】",
"ドラマツルギー 歌ってみた【そらる】",
"【ウォルピス社】ドラマツルギーを歌ってみました【提供】",
"【浦島坂田船歌ってみたツアー】ドラマツルギー【うらたぬき】",
"【爽快に】ドラマツルギー 歌ってみた ver.Sou",
"『ドラマツルギー』を 歌ってみた。by天月",
...

Use case 2

If the video is NOT a Vocaloid Original, then the function returns other videos by the uploader.

related_videos = nicoclient.get_related_videos('sm32103696')
print('\n'.join([v['title'] for v in related_videos]))
"Marygold 歌ってみた【りぶ】",
"沙上の夢喰い少女 歌ってみた【りぶ】",
"BEAUTIFUL DREAMER 歌ってみた【りぶ】",
"夜と虹色 歌ってみた【りぶ】",
"Starduster 歌ってみた【りぶ】",
"ピエロ 歌ってみた【りぶ】",
...

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

nicoclient-0.0.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nicoclient-0.0.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file nicoclient-0.0.0.tar.gz.

File metadata

  • Download URL: nicoclient-0.0.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5

File hashes

Hashes for nicoclient-0.0.0.tar.gz
Algorithm Hash digest
SHA256 40528672d9ff824bfee7d43c254cc3d2eff33a686cc406b4d0026617b351ec34
MD5 0559b4ef55f79bff58dabcc73bd2d5be
BLAKE2b-256 28cd89434ee13134b0ac6cbc933bf75f6bd17f72a0af4ca9940277e84d50069b

See more details on using hashes here.

File details

Details for the file nicoclient-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: nicoclient-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5

File hashes

Hashes for nicoclient-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09ef0b0f06ac30777bb2d11b028e7fcf3606d0925b6e34c6fcf6cd61e7cef904
MD5 3f32af6773fc27eb1228cdb8c3689357
BLAKE2b-256 f3798f5c39890aee1d6808a1c892dc5c5bd788583fcecfea632d25c4c4e80ed3

See more details on using hashes here.

Supported by

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