glloyd0314 / livedl

live streaming video downloader

Home Page:https://himananiito.hatenablog.jp/entry/livedl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

livedl

A tool to record live streams from the new-HTML5-niconico and Twitcasting. It could also be used to record live streams from YouTube but yt-dlp is much more commonly used.

Build in Windows

Installation of git, go, gcc, ffmpeg and streamlink

scoop install git go tdm-gcc ffmpeg streamlink

Compile livedl

Enter the directory of livedl/src then build it

cd livedl/src

set-item env:GOARCH -value 386
set-item env:CGO_ENABLED -value 1
go build -o livedl.x86.exe livedl.go

Check the version of livedl

./livedl.x86.exe -h
livedl.x86 (20181215.35-windows-386)

Build in Linux, e.g. Ubuntu

Installation of git

sudo apt update
sudo apt install -y git

Installation of go

Follow the installation instructions for Linux on https://go.dev/doc/install.

Installation of compiler tools like gcc

sudo apt-get install build-essential

Get the source of livedl

git clone https://github.com/glloyd0314/livedl.git

Compile livedl

Enter the directory of livedl/src and build it

cd livedl/src
go build livedl.go

Check the version of livedl

./livedl -h
livedl (20181215.35-linux-amd64)

Installation of ffmpeg and streamlink

sudo apt install -y ffmpeg streamlink

Way to use it

First to login nico and record with

./livedl -nico-login 'example@example.com,password' lv321234567

From 2nd time, record directly with

./livedl lv321234567

Or with more parameters like

./livedl -nico-login "example@example.com,password" -nico-login-only=on -nico-format "rec/?UNAME?/?DAY8?_?TIME4?_?PID?_?TITLE?_?UNAME?(?UID?)_?CID?(?CNAME?)" -nico-fast-ts=on -nico-auto-convert=on -nico-skip-hb=on -nico-force-reservation=on lv321234567

More details

Check the website https://himananiito.hatenablog.jp/entry/livedl (Japanese).


livedl

新配信(HTML5)に対応したニコ生録画ツール。ニコ生以外のサイトにも対応予定

使い方

https://himananiito.hatenablog.jp/entry/livedl を参照

Windowsでのビルド(exeを作成するためにDockerを利用)

Step1

docker-compose が実行できるようにDocker Desktop for Windowsをインストールする。

Step2

ターミナルで

build\windows

に移動する。

Step3

docker-compose up --build

を実行するとプロジェクトのトップディレクトリに livedl.exe が作成される。

Linux(Ubuntu)でのビルド方法

cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.2 LTS (Xenial Xerus)"

Go実行環境のインストール (無い場合)

https://golang.org/doc/install
に従う

gitをインストール (無い場合)

sudo apt-get install git

gccなどのビルドツールをインストール (無い場合)

sudo apt-get install build-essential

livedlのソースを取得

git clone https://github.com/himananiito/livedl.git

livedlのコンパイル

ディレクトリを移動

cd livedl

(オプション)最新のコードをビルドする場合

git checkout master

ビルドする

go build src/livedl.go
./livedl -h
livedl (20180807.22-linux)

Windows(32bit及び64bit上での32bit向け)コンパイル方法

gccのインストール

gcc には必ず以下を使用すること。

http://tdm-gcc.tdragon.net/download

環境変数で(例)C:\TDM-GCC-64\binが他のgccより優先されるように設定すること。

必要なgoのモジュール

linuxの説明に倣ってインストールする。

コンパイル

PowerSellで、build-386.ps1 を実行する。または以下を実行する。

set-item env:GOARCH -value 386
set-item env:CGO_ENABLED -value 1
go build -o livedl.x86.exe src/livedl.go

32bit環境でx509: certificate signed by unknown authorityが出る

動けばいいのであればオプションで以下を指定する。

-http-skip-verify=on

コンテナで実行

livedlのソースを取得

git clone https://github.com/himananiito/livedl.git
cd livedl
git checkout master # Or another version that supports docker (contains Dockerfile)

イメージ作成

docker build -t livedl .

イメージの使い方

  • 出力フォルダを/livedlにマウント
docker run --rm -it -v "$(pwd):/livedl" livedl "https://live.nicovideo.jp/watch/..."

以上

About

live streaming video downloader

https://himananiito.hatenablog.jp/entry/livedl

License:MIT License


Languages

Language:Go 98.6%Language:Perl 0.6%Language:PowerShell 0.5%Language:Dockerfile 0.3%