Youtube - Download and Cut
About
This app downloads youtube videos using youtube-dl and cuts them with ffmpeg given starting and ending times.
Currently it only supports Windows e Linux.
Usage
Download the latest release for Linux (.appImage) or Windows (.exe) at the releases page.
The first time you run this app (or if required binaries
are not found), the app will download youtube-dl and ffmpeg files according to your OS.
Currently they're being download from youtube-dl and ffmpeg-static latest releases.
After finishing, a folder inside your home folder named yt-dlandcut
will contain the files.
If you run into any problem, please let me know.
Options
- Youtube url*: normal or shortened url
- Starting and ending times*: in HH:MM:SS format
- Convert to mp3: if the cut should also be converted to audio
- Download again: to not skip download if file exists
- Open on finish: opens cut video/audio
- Custom file name: instead of video's title
Development
Make sure to have node
and yarn
installed.
Run yarn
to install dependencies and yarn start
to transpile and run the code.
By running yarn build
, electron-builder will build a package inside dist
folder according to your current operational system and following build
options on package.json
Deploy/Release
It looks like electron-builder
already does a lot when releasing a new version of an Electron app to github.
The first option to build and release this project's binaries is by running the package.json
script command yarn release
.
Electron Builder will know that it should also deploy after building because of this script command name release
and it will look for a GH_TOKEN
environment variable to publish to GitHub as a draft release with the package version.
You can set this environment variable by adding export GH_TOKEN=CHANGE_THIS
to ~/.zshrc
or ~/.bashrc
file and sourcing it with source ~./zshrc
after creating a token.
However, the recommend way is by using a Continuous Integration service, TravisCI in this case.
First, a collaborator have to draft a new release with the package.json
version. Then, after every push, TravisCI will run yarn build
, building the files and providing them as assets in the drafted Github's release.
For this to happen, it's required to have "build": { "publish": "github" }
in package.json
and GH_TOKEN
as environment variable inside TravisCI dashboard's build settings.
Then after a passing build, a collaborator can simply publish it.
The current .travis.yml
is similar to this sample.
It's also possible to deploy using provider: releases TravisCI deploy configuration.
Here are some examples: this and this.