0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ニコニコ生放送のタイムシフト放送をダウンロードする (Streamlink 2.3.0)

Posted at

2025年5月18日時点の情報です。
使用ツール: https://streamlink.github.io/

Streamlink をインストールする

公式サイトへアクセスし、Streamlink をインストールしてください。

Streamlink documentation - Installation

こちらの環境は Windows 11 Pro で、 WinGet (Windows Package Manager) がインストールされているので、winget コマンドでインストールしました。

winget install streamlink

Cookie 情報を取得する

ニコニコ生放送へのログイン情報は、ブラウザの Cookie に保存されています。
ニコニコ生放送のサイトを開き、ブラウザの開発者ツールから Cookie 情報を取得してください。

具体的には、下のサイトを参考に、https://live.nicovideo.jp/ の Cookie user_session の値を取得します。

user_sessionの例
user_session_1234567_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef

開発者ツールを使わずに、各ブラウザの Cookies.txt をダウンロードする拡張機能を使って確認する方法もあります。

ダウンロード実行

取得したいニコニコ生放送の URL と、先ほど取得した user_session の値を使って、次のコマンドを実行します。
動画ファイル foobar.mp4 として保存されます。

ダウンロードコマンド (長いので見切れているため注意)
streamlink "https://live.nicovideo.jp/watch/lv123456789" best --niconico-user-session user_session_1234567_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef --output foobar.mp4

あとがき (nicolive-dl 他の話題)

ニコニコ生放送のタイムシフト放送をダウンロードしたくなったのですが、最初に見つかった方法は nicolive-dl でした。
ただ、なぜか次のようなエラーが出てうまくダウンロードできなかったので、他の方法を探すことになりました。もしかしたら、ニコ生の仕様が変わったのかもしれません。

[https @ 000002189d9bda00] HTTP error 403 Forbidden
[in#0 @ 000002189d99e680] Error opening input: Server returned 403 Forbidden (access denied)
Error opening input file https://assetdelivery.dlive.nicovideo.jp/hls/vod/682846ce8f11a4e9d9b93e29/playlists/variants/da074bd0c0526ff2.m3u8.
Error opening input files: Server returned 403 Forbidden (access denied)

参考リンク:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?