PushBullet-YTDL is a lightweight pure bash service for for YouTube-dl and Pushbullet. PushBullet-YTDL uses Youtube-DL Material by Tzahi12345 as the API endpoint to send YouTube-dl requests to and leverages the public Pushbullet API to listen for download requests.
- Register a device to a given Pushbullet account.
- Listen for pushes to the device registered.
- Extract the URL to the desired download.
- Send a download request to Youtube-DL Material via its internal API.
- Delete a push after it has been successfully downloaded.
To use simply share a video from the source app (e.g. YouTube app) on your phone to the PushBullet device running PushBullet-YTDL.
Note: Obviously Pushbullet is required to be installed on your device, and the source app too...
- Create a Pushbullet account if one does not already exist
- Generate an API key in the Pushbullet web interface
- Run Youtube-DL Material by Tzahi12345 either on your host or in a Docker container
- Generate an API key in the Youtube-DL Material setting page
- Either:
- Set the required environment variables (see below) and run the
pyd.sh
script, OR - Pull the Docker container
docker pull ghcr.io/steveharsant/pushbullet_ytdl:latest
(recommended) - Run the Docker container with:
- Set the required environment variables (see below) and run the
docker run -d \
--name=pushbullet_ytdl \
-e PUSHBULLET_DEVICE_NICKNAME=<<PUSHBULLET DEVICE NAME>> \
-e PUSHBULLET_KEY=<<PUSHBULLET DEVICE API KEY>> \
-e YTDLM_KEY=<<Youtube-DL Material API KEY>> \
-e YTDLM_URL=<<URL to Youtube-DL Material. Requires http/https and port number>> \
--restart unless-stopped \
ghcr.io/steveharsant/pushbullet_ytdl:latest
Variable Name | Type | Required | Description |
---|---|---|---|
DEBUG | Boolean | False | Set to TRUE to enable debugging. |
PUSHBULLET_DEVICE_NICKNAME | String | True | Friendly name for the device running PushBullet-YTDL |
PUSHBULLET_KEY | String | True | API Key for Pushbullet |
SLEEP_TIME | Integer | False | Change sleep delay between calls (Push bullet free account only allows 500 API calls per month. Default is 60 seconds |
YTDLM_KEY | String | True | Youtube-DL Material's API Key |
YTDLM_URL | String | True | Youtube-DL Material's URL. Must include http /https and a port number. Do not put a trailing slash! |
To build the Docker container from a Dockerfile
use:
- Enter the root directory
cd /root/path/to/repository
- Build the container in the subdirectory from the root
docker build -t <<tag name>> -f .Dockerfiles/Dockerfile .
TO make development easier, it is possible to create a module named ``00-dev_config.shin the
modules` directory with environment variables used by PushBullet-YTDL. This file is in both the `.gitignore` and `.dockerignore` files so they won't ever be committed or packaged into the Docker container. Example file is:
#!/bin/bash
export PUSHBULLET_KEY=
export PUSHBULLET_DEVICE_NICKNAME=
export YTDLM_KEY=
export YTDLM_URL=
export DEBUG=
export SLEEP_TIME=
As this repository is built for Alpine Linux, the required shebang is #!/bin/bash
. Any other fails when executing.
- Add audio downloads
- Parallel download requests to Youtube-DL Material