GithubHelp home page GithubHelp logo

tasuren / niconico-dl Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 3.0 94 KB

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

Home Page: https://tasuren.github.io/niconico-dl/

License: MIT License

Python 99.39% Shell 0.61%
python async niconico-video-downloader niconico

niconico-dl's Introduction

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をお忘れなく、詳細はリファレンスを見てください。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.