Note
Want a very simple, basic version of it? Try trimsec.c.
trimsec helps you plan your content consumption. It includes utility functions such as duration-trimming (AKA calculating how much time you'd have in hand after you've watched a video with a multiplier), playlist and video-trimming (same stuff but for YouTube), and other commands. It is still a work-in-progress project, and more commands are already planned!
It is oriented towards terminal-headed academic nerds (pun intended) who can't seem to get a grasp of their syllabus until the last night before the exam, when they already have hundreds of videos to cover. Theoretically impossible to cover - trimsec makes it easier.
Note
This section is only needed if you're going to be passing in YouTube playlists/videos as arguments.
Steps:
- Get your API key for the YouTube Data API (v3) from the Google Cloud Console.
- Create a new
.trimsecrcfile at your$HOME(on Windows:C:\Users\<USERNAME>) directory with this structure:api_key = "YOUR_API_KEY_HERE"
- Or, set it as
TRIMSEC_YOUTUBE_KEYin your environment.- A good choice is to use direnv and create a
.envrcfile in your$HOME, then rundirenv allowin your home directory from the terminal to set it as an isolated environment variable, although beware that the variable won't be available in any other directories.
- A good choice is to use direnv and create a
To calculate saved time, you run the trim command as follows:
ts trim <duration> <speed>
# Example:
ts trim 1h 2xThis command outputs the time you saved by watching an hour-long video at 2x the speed. This works for any integer or floating-point combination on either the duration or the multiplier:
ts trim 1h30m 1.5x
ts trim 1.5h30m 1.5x # equivalent to 2 hoursCombine multiple durations like this:
ts trim 1h30m+2h50m 1.25xInstead of using the trim command, you'll be using the yt (or y) command:
ts yt -l https://www.youtube.com/watch?v=D4iiKkjGJmU -m 1.25xYou can also throw in a YouTube playlist in (almost) any format you want, and it'd show the total time saved based on the multiplier:
ts yt -l "https://www.youtube.com/watch?v=rdXw7Ps9vxc&list=PLHXZ9OQGMqxersk8fUxiUMSIx0DBqsKZS" -m 1.8xAs you can see, the link strings are getting quite big. To solve this, a clipboard-fetcher comes included.
# reads from clipboard
ts yt -m 1.8x --clipFor traversing only a certain amount of items in a playlist (starting from the 1st item), use this:
ts yt --max-items 7 -l "SOME_PLAYLIST_URL" -m 1.8xThis feature can be used to check whether a certain YouTube video/playlist fits in the day, or a given duration. You basically run:
ts fitcheck [OPTIONS]A number of use-cases could be listed as follows:
# link grabbed from clipboard; budget is today
ts fitcheck --clip
# same as above, but shorter
ts fc --clip
# link pasted manually; budget is today
ts fc --link "https://youtube.com/..."
# shortened param names; budget is 2 hours and 4 minutes
ts fc -l "https://youtube.com/..." -b 2h4m
# youtube playlist + item cap
ts fc -l "https://youtube.com/playlist?..." --max-items 5
# disable clipboard functionalities intentionally
ts fc --link "https://youtube.com/..." --no-clipAs you can see by now, most of the parameters and flags are the same as the trim command, so it is worthwhile to check both documentations and compare-contrast between what to use and what to not.
Note
More such commands will be added with the following releases, as these are proportional to ideas coming in.
- For listing the contents in a YouTube playlist:
ts list -l "https://youtube.com/..."
ts ls --clip # shorter; grabs from clipboard
ts ls --max-items 5 # only traverses 5 itemsbrew tap hitblast/tap && brew trust hitblast/tap
brew install trimseccargo install trimsecmise use -g cargo:trimsecGet platform-based binaries here: https://github.com/hitblast/trimsec/releases
git clone https://github.com/hitblast/trimsec.git
cd trimsec && cargo build --releaseThis project is licensed under the MIT License.

