ニコニコ動画をダウンロードして、後日ゆっくりと鑑賞したいと思い調べていたら、ubuntuに nicovideo-dl というコマンドを発見。便利です。
Synaptic からチェックしてダウンロード。
nicovideo-dlのオプション:
-h, --help print this help text and exit
-v, --version print program version and exit
-u USERNAME, --username=USERNAME
account username(アカウント)
-p PASSWORD, --password=PASSWORD
account password(パスワード)
-o FILE, --output=FILE
output video file name
-q, --quiet activates quiet mode
-s, --simulate do not download video
-t, --title use title in file name(タイトルをファイル名にする)
-l, --literal use literal title in file name
-n, --netrc use .netrc authentication data
-g, --get-url print final video URL only
-2, --title-too used with -g, print title too
python で実行するには下記のようにして、urlを指定して実行すれば書いてきに動作してくれる。(エコノミーの判定方法がわかれば、もう少しよくなるんだがなぁ)
import os
def nicodl(url):
cmd = "nicovideo-dl "
cmd += "-u アカウント "
cmd += "-p パスワード "
cmd += "-t "
cmd += url
os.system(cmd)
0 件のコメント:
コメントを投稿