autosnatch
Script to download either the latest episode, or a specific episode, of certain Beacon shows.
- Currently only supports Critical Role and Critical Cooldown.
- Intended for use on a remote server, but can absolutely be used locally.
What it does
- Downloads an episode of a supported Beacon.tv show using
beacon-snatch. - Grabs the thumnbail for the episode.
- Downloads + merges the subtitles and video into one file.
Why not just use beacon-snatch?
- While it is the framework that holds up this bodge-job of a script,
beacon-snatchworks best when downloading a specific episode. autosnatch can grab the latest episode, which allows it to be used easier in scenarios where you'd want to automatebeacon-snatchto line up with Beacon.tv show release schedules. beacon-snatchdoes not download the thumbnail. If you plan on archiving episodes on a local media server (i.e. Jellyfin/Plex et al), this nay be important to you.- Most importantly,
beacon-snatchdoes grab the URL for the subtitles stream, but it does not document a way to download it as part of a normalbeacon-snatchoperation. As someone who is functionally hard of hearing, having autosnatch download the subs stream automatically is very important.- They don't need to be merged, but it makes the episode more portable + easier to manage for me.
Vague setup steps
I'm not gonna document this properly. This is a personal project. I might document it later though.
# 1. Install xvfb (for headless operation)
# See https://github.com/ponty/PyVirtualDisplay for more info
sudo apt-get install xvfb
# 2. Download autosnatch
git clone https://git.gaycat.cloud/jess/autosnatch.git
cd autosnatch
# 3. Set up Python virtualenv (ugh)
python -m virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
# 4. Create a new config file
cp config.EXAMPLE.toml config.toml
nano config.toml # Linux
notepad config.toml # Windows
# 5. Run autosnatch (see examples below)
python -m scripts.dl $series $episodenumber
Usage examples
Download the latest episode of Critical Role: Campaign 4
python -m scripts.dl campaign-4 latest
Download episode no. 12 of Critical Cooldown
python -m scripts.dl critical-cooldown 12
Example job to put in your crontab
1 14 * * 5 /home/exampleuser/autosnatch/scripts/remote-dl.sh
Configuration
In config.toml:
# The minimum error level to show in the terminal:
# DEBUG, INFO, WARNING, ERROR, CRITICAL
LOG_LEVEL = "INFO"
# Soon to be deprecated lmao
SHOW_NAME = false
# Where to store the cache of episode lists
CACHE_DIR = "cache"
# The oldest the cache files can be before autosnatch generates a new one
# during the next run
CACHE_MAX_AGE = 48 # in hours
# The folder where the video, subs, and thumbnail will be downloaded
DL_ROOT = "downloads"
# autosnatch merges the MP4 video and the subtitles into a new MKV video file.
#Set to 'false' to prevent them from being deleted during the merge.
DELETE_MP4_SRT_AFTER_DOWNLOAD = true
# Your Beacon.tv account credentials. Must be a paid account.
BEACON_EMAIL = "beacontrialemail@gmail.com"
BEACON_PASSWORD = "Micaeah444?"
A word on scripts/*.sh
These scripts are examples of scripts you could run on remote and local machines (i.e. seedboxes, home servers) to fully automate the downloading of Beacon.tv episodes, and they are not required to use autosnatch at all. I simply generalised the scripts I use in my home infrastructure and chucked them in here as inspiration (plus the annmoying ways in which cron needs ssh/rsync commands written in order to function).
A word on headless server operation
This project uses pyvirtualdisplay, which allows us to open an invisible browser window on an invisible display buffer, for machines that do not have a real display. Ensure you skim over its GitHub above for additional set-up steps or issues documented.
A word on Windows compatibility
It's probably not. lmao. Test it and lmk, I guess.