1.0.2 • Published 12 months ago

@warren-bank/node-hls-downloader-roosterteeth v1.0.2

Weekly downloads
1
License
GPL-2.0
Repository
github
Last release
12 months ago

Rooster Teeth Downloader

Command-line utility for downloading an offline copy of Rooster Teeth HLS video streams.

Features:

  • accepts URLs that identify:
    • a single episode contained in a series
    • an entire series
      • includes all episodes in every seasons
  • downloads:
    • the highest available quality for each video stream
    • vtt subtitles for all available languages
    • will continue upon restart after an abrupt interruption
  • resulting file structure:
      |- {title_series}/
      |  |- {title_episode}/
      |  |  |- hls/
      |  |  |  |- video/
      |  |  |  |  |- *.ts
      |  |  |  |- audio/
      |  |  |  |  |- {language}/
      |  |  |  |  |  |- *.ts
      |  |  |  |  |- {language}.m3u8
      |  |  |  |- subtitles/
      |  |  |  |  |- {language}/
      |  |  |  |  |  |- *.vtt
      |  |  |  |  |- {language}.m3u8
      |  |  |  |- video.m3u8
      |  |  |  |- master.m3u8
      |  |  |- mp4/
      |  |  |  |- video.mp4
      |  |  |  |- video.{language}.srt

Installation:

npm install --global @warren-bank/node-hls-downloader-roosterteeth

Usage:

rtdl <options>

options:
========
"-h"
"--help"
    Print a help message describing all command-line options.

"-v"
"--version"
    Display the version.

"-q"
"--quiet"
    Do not print a verbose log of operations.

"-ll" <integer>
"--log-level" <integer>
    Specify the log verbosity level.
      0 = no output (same as --quiet)
      1 = include only episode Rooster Teeth URLs
      2 = include only episode ffmpeg commands
      3 = include all operational metadata (default)

"-dr"
"--dry-run"
    Do not write to the file system.

"-nm"
"--no-mp4"
    Do not use "ffmpeg" to bundle the downloaded video stream into an .mp4 file container.

"-mc" <integer>
"--max-concurrency" <integer>
"--threads" <integer>
    Specify the maximum number of URLs to download in parallel.
    The default is 1, which processes the download queue sequentially.

"-P" <dirpath>
"--directory-prefix" <dirpath>
    Specifies the directory where the resulting file structure will be saved to.
    The default is "." (the current directory).

"-u" <URL>
"--url" <URL>
    Specify a Rooster Teeth URL. (episode or series)

"-i <filepath>"
"--input-file <filepath>"
    Read Rooster Teeth URLs from a local text file. Format is one URL per line.

Example:

  • download an episode (subtitles not available):
      rtdl -q -mc 5 -u 'https://roosterteeth.com/watch/red-vs-blue-psa-2019-cultural-appreciation'
  • download an episode (subtitles are available):
      rtdl -q -mc 5 -u 'https://roosterteeth.com/watch/gary-and-his-demons-season-1-still-the-one'
  • download a series:
      rtdl -mc 5 -u 'https://roosterteeth.com/series/rwby'
  • print a trace of the operations that would occur IF a series were to be downloaded:
      rtdl -dr -ll 1 -u 'https://roosterteeth.com/series/rwby'
      rtdl -dr -ll 2 -u 'https://roosterteeth.com/series/rwby'
      rtdl -dr -ll 3 -u 'https://roosterteeth.com/series/rwby'
  • download a series (advanced):

      rtdl -dr -ll 1 -u 'https://roosterteeth.com/series/rwby' >'episode_urls.txt'
      rtdl -dr -ll 2 -u 'https://roosterteeth.com/series/rwby' >'convert_mp4s.sh'
    
      rtdl -nm -mc 5 -i 'episode_urls.txt' >'log.txt' 2>&1
    
      ./convert_mp4s.sh
Suggestions:
  1. download with options: --no-mp4 --log-level 3
    • redirect stdout to a log file
    • when download completes, check the log file for any error messages
    • if any .ts chunks encountered a download problem
      • identify the url of the Rooster Teeth page that was being processed when this error occurred
      • redownload that page (using the same --directory-prefix)
        • all previously downloaded data not be modified or deleted
        • only missing data will be retrieved
  2. repeat the above process until the log file shows no download errors
  3. finally, convert the HLS stream to mp4
    • to only convert the video and audio streams to mp4
      • the ffmpeg command to perform this conversion is included in the log file
      • when converting the episodes in a series, a list of all ffmpeg commands can be generated with the options: --dry-run --log-level 2
    • to convert the video and audio streams to mp4, and convert all vtt subtitle streams to srt
      • redownload (using the same --directory-prefix) without the option: --no-mp4
        • all previously downloaded data not be modified or deleted

Requirements:

Legal: