a tiny wrapping for youtube-dl to download tver episodes.
pip install git+https://github.com/trnciii/tdl
or install a local clone in editable mode
git clone https://github.com/trnciii/tdl
cd tdl
pip install -e .
tver-dl <url or episode id> <options>
Video and program info are saved in current directory.
Episode id is a string that starts with 'ep-' and found in a url as https://tver.jp/episodes/<episode id>
.
-h --help
shows help.-o --output
sets output name inheriting youtube-dl output template.--caption
saves caption.vtt file.--dump
saves responses for all internal requests.--no-dl
prevents downloading the video file.
The below code downloads in the same way as console script.
import tver_dl
tver_dl.main([list of arguments])
In tver_dl.main
function, the direct link to the video is composed and passed to youtube-dl
.
Actually, tver_dl.get_program(episodeID, dump=False)
is doing it as well as collecting some useful information.
import tver_dl
program = tver_dl.get_program('episode id')
print(program['video url']) # video url to be passed to youtube-dl
print(program['series']) # series title
print(program['subtitle']) # title of the episode
print(program['service']) # the name of the service, or broadcast provider
print(program['caption']) # if the episode is captioned
...
See what tver_dl.tver_dl:get_program
returns for more items.
tver_dl.tver_dl:main
is also a demo of how to use them.
- accepts only one url/episodeID for a call.
- fail to get
videoRefID
on some episodes.