npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@warren-bank/node-hls-downloader-americastestkitchen

v1.0.1

Published

Command-line utility for downloading an offline copy of 'Americas Test Kitchen' HLS video streams.

Downloads

6

Readme

Americas Test Kitchen Downloader

Command-line utility for downloading an offline copy of Americas Test Kitchen HLS video streams.

Features:

  • accepts URLs that identify:
    • a single episode
  • accepts CLI options to identify:
    • a single episode
    • a single season
    • all episodes in every season
  • 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
      |  |  |  |- video.m3u8
      |  |  |  |- master.m3u8
      |  |  |- mp4/
      |  |  |  |- video.mp4
      |  |  |  |- video.{language}.vtt
      |  |  |  |- video.{language}.srt

Installation:

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

Usage:

atkdl <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 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 an episode URL.

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

"-a"
"--all"
    Process all episodes in all seasons.

"-s" <integer>
"--season" <integer>
    Process all episodes in the specified season.

"-e" <integer>
"--episode" <integer>
    Process one specific episode in the specified season.
    Requires: '--season'

Example:

  • download an episode (by URL):
      # Season 20, Ep 7 - The Very Best Paris-Brest
      atkdl -q -mc 5 -u 'https://www.americastestkitchen.com/episode/653-the-very-best-paris-brest'
  • download an episode (by CLI options):
      # Season 20, Ep 7 - The Very Best Paris-Brest
      atkdl -q -mc 5 -s 20 -e 7
  • download all episodes in one season:
      # Season 20
      atkdl -q -mc 5 -s 20
  • download all episodes in all seasons:
      atkdl -q -mc 5 -a
  • print a trace of the operations that would occur IF all episodes in one season were to be downloaded:
      # Season 20
      atkdl -dr -ll 1 -s 20
      atkdl -dr -ll 2 -s 20
      atkdl -dr -ll 3 -s 20
  • download all episodes in one season (advanced):
      # Season 20
      atkdl -dr -ll 1 -s 20 >'episode_urls.txt'
      atkdl -dr -ll 2 -s 20 >'convert_mp4s.sh'
    
      atkdl -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 Americas Test Kitchen 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
    • 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

Requirements:

Credits:

Legal: