はじめに ニコ生のタイムシフトをダウンロードしたかったんです。高画質のために深夜に見るのも辛いし。でも探しても全然ダウンローダーが無い。 なのでGoogleChromeのDevToolとか見ながら夜業して作りました。websocketとかの勉強になったかな? 悪用厳禁。ニコニコ動画でダウンロード可能な動画は投稿者により明示的に許可されたものに限ります。 早くコードを見せろという方用にGithubのリンクを貼っときます。 https://github.com/kairi003/nicolive-dl 参考文献 いきなり参考文献というのもどうかと思うのですが、@mueruさんの「ニコ生の配信を分析し、動画として保存するために頑張った話」を大変参考にさせていただきました。 今回私が書いたのはこれの発展ですね。GoogleChrome+Seleniumなしで動くように頑張りました。 あとは@tor
#!/usr/bin/python #-*- coding:utf8 -*- import os import re import yaml import socket import cookielib from mechanize import Browser from BeautifulSoup import BeautifulSoup yml = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'config.yaml') CONFIG = yaml.load(open(yml)) br = Browser() cj = cookielib.LWPCookieJar() br.set_cookiejar(cj) br.open('https://secure.nicovideo.jp/secure/login_form
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く