The module, as the name suggested, mainly takes charge of downloading videos. It will read the -task
and -songInfo
JSON files created by the previous module (vvd-taskproducer
), and download the videos/audios and the thumbnails of the song to the output directory specified in the configuration.
The -task
JSON file will also be updated with the download resources of video/audio/thumbnail, and will be moved to the output directory as well.
If you haven't read the common document yet, please read it first: Common document
Besides the common prerequisites, you also need:
- A valid Video Downloader for each supported video service (see the next section for more details)
- MediaInfo CLI
Optional prerequisites:
- FFmpeg (Highly recommended for downloading high-quality videos/audios from Youtube)
- Aria2c (Highly recommended for downloading NicoNico videos)
Currently, VocaDB Video Downloader only supports:
Supported Video Service | Supported Video Downloader for this service |
---|---|
Niconico | youtube-dl or its fork, nndownload |
YouTube | youtube-dl or its fork |
Bilibili | youtube-dl or its fork |
SoundCloud | youtube-dl or its fork |
So pretty much by setting up one of the youtube-dl distributions, you are good to go.
I highly recommend yt-dlp instead of youtube-dl, with the binary of the yt-dlp's specific FFmpeg placed beside the yt-dlp binary.
If you are using youtube-dl or its fork to download videos from NicoNico, I highly recommend installing aria2c and configuring youtube-dl/yt-dlp to use aria2c as the external downloader for NicoNico videos. This sometimes can bypass the speed throttling problem from NicoNico.
All configurations can be found in application.yml
file.
Below is a copy of the content of the application.yml
file for your reference. However, make sure to check for any updates to the file yourself:
io: # all fields are required
# this must be pointing to the output directory of the previous module, the task producer module. In another word, the directory specified in the 'io.output-directory' field of the previous module
# can be an absolute path or a relative path from the application current running directory
input-directory:
# the output directory of this module, can be an absolute path or a relative path from the application current running directory
output-directory:
# the error directory of this module, used for reporting errors for debugging, can be an absolute path or a relative path from the application current running directory
error-directory:
config: # configuration
# all fields are optional
preference:
# The preference of your PV services
# a VocaDB record often have multiple PVs with different PV serivces (e.g. niconico, youtube, etc) associated with it
# when downloading PVs for a Vocaloid song, the downloader needs to know which PV service to download first
# the downloader will use this list as an order of which pv service to check first
# you can also disable one or more PV services by not listing them
# values here are comma separated, the value must be same as the pv service string in VocaDB APIs Swagger Page at https://vocadb.net/swagger/ui/index
# but currently we only support NicoNicoDouga, Youtube, Bilibili and SoundCloud
pv-preference: NicoNicoDouga, Youtube, Bilibili, SoundCloud
# maximum retry before calling it a failure
# this does not include the first try. For example, 2 means a maximum of 3 tries can be performed
max-retry-count: 2
# Some VocaDB records have reprinted PVs associated. These PVs are often reuploaded by someone else, and usually have worse quality than original PVs uploaded
# However, sometime the original PV can be unavailable, should we try reprinted PV?
try-reprinted-pv: true
# if PVs from one PV service, either original or reprinted, failed to be download,
# should we move to next available PV service listed in the pv-preference, default value is false
# currently it is false as default because we don't want the misconfiguration of the downloader setting to be traded as false positive and move to the next pv service while the first pv service is actually available or the downloader is still working well
try-next-pv-service-on-fail: false
# this setting only available if try-reprinted-pv is true
# should we only try reprinted PV after all original PVs across all pv services are failed?
# if this setting is true, the downloader will go over the pv-preference list twice.
# where in the first round, only original pvs are tried. then in second round, all reprinted pvs are tried
# setting this to false will make the downloader try original pvs and reprinted pvs in the same round
try-all-original-pvs-before-reprinted-pvs: true
# which PV service uses which downloader(s), separated by comma
# which field is required or optional depends on if the pv service is listed in config.preference.pv-preference field
# (note for dev): when new PV service is added, change it on DownloaderBaseConfig
enablement:
# currently support youtube-dl and nndownload
NicoNicoDouga:
# currently only support youtube-dl
Youtube:
# currently only support youtube-dl
Bilibili:
# currently only support youtube-dl
SoundCloud:
# which field is required or optional depends on if the pv service is listed in config.preference.pv-preference field also if the downloader is enabled in the config.enablement field
downloader:
NicoNicoDouga:
# settings of youtube-dl/ytp-dl for downloading niconico videos
# settings must make sure nothing blocks from downloading the video (e.g. don't put --version as the argument)
# do the same for all other downloaders.
youtube-dl:
# launch command of youtube-dl/ytp-dl, can be:
# 1. just the name of the executable, if the executable is in your PATH
# 2. the absolute/relative path of the executable
# 3. python3 path/to/youtube-dl/__main__.py
# specify the launch command using a list of strings, you can use any one of the YAML list syntax
launch-cmd:
# the arguments to be passed to the launch command
# for example, for downloading niconico videos, you can use --cookies path/to/cookies.txt --external-downloader aria2c --ffmpeg-location path/to/ffmpeg.exe
# however, do not put -o or --output here, this application will handle it for you
external-args:
# settings of nndownload, same way of configuring youtube-dl/ytp-dl
nndownload:
launch-cmd:
external-args:
# same way of configuring NicoNicoDouga
Youtube:
youtube-dl:
launch-cmd:
external-args:
# same way of configuring NicoNicoDouga
Bilibili:
youtube-dl:
launch-cmd:
external-args:
# same way of configuring NicoNicoDouga
SoundCloud:
youtube-dl:
launch-cmd:
external-args:
# all fields are requried
environment:
# path of the mediainfo cli tool
# be aware that we need the executable MediaInfo.exe file, not the .dll file
# or if the cli tool is already in your PATH, you can leave this as "mediainfo"
# for debian based distros, you can install mediainfo using "sudo apt-get install mediainfo"
mediainfo-launch-cmd:
# all fields are required
download:
# these two fields control the timeout of the downloading. If the download is not finished within the timeout, the download will be considered as failed.
# To disable timeout, set this timeout to a very long duration like 10 hours for example
timeout: 10
# the unit of the timeout value, can be any values listed in https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/TimeUnit.html. e.g. seconds, minutes, hours, days
unit: minutes