Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
/ niconico-dl Public archive

ニコニコ動画の動画のダウンロードをするためのPython用モジュール。

License

Notifications You must be signed in to change notification settings

tasuren/niconico-dl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI PyPI - Downloads

niconico_dl

ニコニコ動画にある動画をダウンロードするためのPython用のライブラリです。

警告!
このniconico_dlは開発が停止して、アップデートもこれからありません。
代わりにこちらを使用してください。

リファレンス:https://tasuren.github.io/niconico-dl/
GitHub:https://github.com/tasuren/niconico-dl/

Install

pip install niconico_dl

Examples

Normal

url = "https://www.nicovideo.jp/watch/sm38533566"

with niconico_dl.NicoNicoVideo(url, log=True) as nico:
    data = nico.get_info()
    nico.download(data["video"]["title"] + ".mp4")

print("Downloaded!")

Async

async def start_async():
    url = "https://www.nicovideo.jp/watch/sm9664372"
    async with niconico_dl.NicoNicoVideoAsync(url, log=True) as nico:
        data = await nico.get_info()
        await nico.download(data["video"]["title"] + ".mp4")
    print("Downloaded!")


asyncio.run(start_async())

Command Line

使用方法:niconico_dl [URL]
ダウンロードした動画はoutput.mp4という名前で実行したディレクトリに保存されます。

Notes

もしDiscordのボイスチャットにニコニコ動画を流したい人はNicoNicoVideoAsync.downloadではなくNicoNicoVideoAsync.get_download_linkを使用して取得したダウンロードリンクで流すことを推奨します。
downloadは動画をダウンロードするため時間がかかります。 なのでget_download_linkでダウンロードリンクを取得してそれを使い直接流すのを推奨します。
注意:closeをお忘れなく、詳細はリファレンスを見てください。