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

tv-show-tracker

v2.1.0

Published

Select which shows you want to track and new episodes will be automatically dowloaded as soon as they're available!

Downloads

9

Readme

TV SHOW TRACKER

Stop searching for torrents, simply select which shows you want to track and new episodes will be automatically dowloaded as soon as they're available!

Installation

Commands may change depending on your OS.

Globally install the package:

npm i -g tv-show-tracker

Program will be installed in your node/bin folder. Node folder can be found executing in a terminal:

which node

In this folder database, downloads and config files are stored.

Usage

Adding shows to track

To add a show to track execute in a terminal:

tv-show-tracker add

and you will be prompted for the show name.

Note that show name has to be the same as stored in database file.

Selected shos are stored the file config/local.json:

{
	...
	selectedShows: [
		'doctor who',
		'the magicians',
		'brooklyn nine-nine',
		...
	]
	...
}

Track shows

To track shows (search for and download new episodes), execute in a terminal:

tv-show-tracker track

// or simply

tv-show-tracker

The first time the program is run, TV Show schedule is crawled from an online web and available tv shows are populated in the database: database/db.json.

And that's it!

Watch downloaded shows

Shows are downloaded in data/downloads/ folder inside app folder. To watch completely downloaded episodes execute:

tv-show-tracker watch

And you will be prompted to select a show and an episode.

Backup data

You can backup database and downloads to another directory / external drive:

tv-show-tracker backup <destination directory>

This command is useful if you want to backup app's state: downloads and database.

It will not delete files present in destination but not in origin.

After executing the command, you can manually delete downloaded episodes that you have already watched without loosing any data.

Further configuration

File config/default.js has the default config and config keys descriptions.

You can create a local config file doing (in app installation folder):

echo '{}' > config/local.json

Note that if you've added a show with 'tv-show-tracker add', the file will be automatically created.

Although config options are described in config/default.js, there is more information in:

and below.

Lifecycle

  1. Update calendar

    Calendar is updated if config key updateCalendar is set to true and current month is not found in the database.

  2. Start cycle

    In each cylce two things are done simultaneously:

    1. Search for new torrents

      Aired episodes without a torrent are searched. Results are stored into the DB to be downloaded next cycle. Config key maxSearchAttempts sets the number of times an episode will be searched for a torrent before considering its dead. Set to 0 to infinite attempts.

    2. Download available magnets

      Episodes marked as not downloaded and have a torrent magnet start downloading (throttled with simultaneousDownloadLimit config key).

  3. Start new cycle

    If config key reset is set to true, and there are new episodes to search, new cycle is started. --> if not torrents are found, it will keep searching forever (or until maxSearchAttempts are reached for all torrents)

Limitations

This project is ment to automatically download latest episodes of tv shows, so them are expected to be alive (lots of peers). Downloading past episodes is slower and may cause the app to hang, since it waits for the torrents to download before starting new downloads (see lifecycle).

TO DO's

  • [ ] Tests:

    Ohh tests! I love testing. I really do!!

    Sadly, this project started as:

    Fuck! I missed the last season of The Magicians! And Modern Family! And The flash! And Dr Who! And ... , why Netflix doesn't have these shows?? (in Spain at least).

    This can never happen again...

    Anyway lets download them...

    Ugh! 35 magnets? Let's automate this

    So tests weren't implemented. I needed to watch new shows I didn't have time for tests!

v2.2

  • CLI
    • [ ] Add / remove seasons
    • [ ] Add magnet
  • [ ] Change output / debug
    • [x] Add output module, uses debug package behind the scenes
    • [ ] Migrate module?
  • [ ] Option of downloading complete seasons
    • [ ] Show info search --> episode details
  • [ ] Create separate DDBB for shows info (committed), and episodes
    • [ ] Move all db transactions to a module with exposed methods, v3?
      • [ ] Mark episode as watched
        • [x] detect vlc video finished
        • [x] differenciate beetween video finished and user closing vlc
        • [ ] inquire and set to db
        • [ ] clean code
      • [ ] remove shows / mark as disabled

Change log

v1

  • [x] Basic downloaded episode logger npm run checkDownloaded
  • [x] Calendar force update after X days --> when month is not in db
  • [x] Select shows more easily
  • [x] Storage system
    • [x] Parse file names
      • [x] change showtitle property of episodes to parse name with external module
      • [x] shows stored as lowercase
  • [x] Config file
    • [x] Search limit
    • [x] Restart lifecycle
  • [x] Figure out which torrent search provider is giving timeout and disable it to speed up process
  • [x] Restart lifecycle to keep searching for torrents while dowloading
  • [x] Documentation

v2

  • [x] Globally available / CLI
    • [x] Change file path reading using path library
    • [x] Add show add command
    • [x] Set track shows as default action if no command is given track command
    • [x] Launch vlc for selected episode - watch command
      • [x] Filter episodes that are marked as downloaded
    • [x] Set config key maxSearchAttempts to 0 to infinite search attempts
    • [x] Move cli files to bin folder
  • [x] Documentation

v2.1

  • [x] Remove unused packages
  • [x] Add backup command