trnciii / tdl

Welcome to the kingdom of dreams and magic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a tiny wrapping for youtube-dl to download tver episodes.

install

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 .

from console

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>.

options

  • -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.

from python

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.

dependency

Note

  • accepts only one url/episodeID for a call.
  • fail to get videoRefID on some episodes.

About

Welcome to the kingdom of dreams and magic


Languages

Language:Python 100.0%