This project is vibe-coded, which means:
- It works on my machine (and hopefully yours)
- The code is more art than science
- Documentation may be vibes-based
- Updates may break things in unexpected ways
- You're welcome to contribute, but expect vibes
If you're looking for enterprise-grade, production-ready code, this might not be the project for you. If you're cool with vibes, welcome aboard! 🎵
A Rust-based Nostr bot that downloads and converts YouTube videos to MP3 format. The bot listens for direct messages containing YouTube URLs from authorized users and automatically downloads and converts them in parallel.
Nix provides a complete, reproducible development environment with all dependencies. This is the recommended way to install Rovr as it ensures consistent behavior across different systems.
- Install Nix using the Determinate Systems installer:
# On Linux/macOS
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# On Windows (WSL2)
wsl --install
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install- Clone the repository and enter the development environment:
git clone https://github.com/EthnTuttle/rovr.git
cd rovr
nix-shell- Build and run:
cargo build
cargo runIf you prefer not to use Nix, you can use the provided install script. This is simpler but may require manual dependency management.
- Clone the repository:
git clone https://github.com/EthnTuttle/rovr.git
cd rovr- Run the installation script:
chmod +x install.sh
./install.shThe script will check for dependencies, set up the environment, and create a default config file.
To run Rovr as a system service on Linux:
- Set up Python virtual environment and install yt-dlp:
python3 -m venv venv
source venv/bin/activate
pip install yt-dlp- Build the release version:
cargo build --release- Install the systemd service:
chmod +x install-service.sh
sudo ./install-service.shThe script will:
- Install the binary to
/usr/local/bin - Set up the systemd service
- Ask if you want to start the service
- Ask if you want to enable the service on boot
The bot requires yt-dlp to be available in a known location. We handle this in two places:
- In the systemd service file (
rovr.service):
[Service]
User=ethan # Change this to your username
WorkingDirectory=/home/ethan/code/rovr # Change to your project directory
Environment="PATH=/home/ethan/code/rovr/venv/bin:/usr/local/bin:/usr/bin:/bin"- In the Rust code (
src/main.rs):
let yt_dlp_path = PathBuf::from("/home/ethan/code/rovr/venv/bin/yt-dlp");This setup ensures that:
- The service runs in your project directory where the virtual environment is located
- The PATH includes the virtual environment's bin directory first
- The code knows exactly where to find yt-dlp
- Dependencies are isolated and version-controlled in your project's virtual environment
Make sure to update both paths to match your system's directory structure and username.
Common systemd commands:
- Start service:
sudo systemctl start rovr - Stop service:
sudo systemctl stop rovr - Restart service:
sudo systemctl restart rovr - Enable on boot:
sudo systemctl enable rovr - Disable on boot:
sudo systemctl disable rovr - View logs:
sudo journalctl -u rovr -f - Check status:
sudo systemctl status rovr
To uninstall the system service:
- Run the uninstall script:
chmod +x uninstall-service.sh
sudo ./uninstall-service.shThe script will:
- Stop and disable the service
- Remove the binary from
/usr/local/bin - Remove the systemd service file
- Ask if you want to remove the data directory
The application is configured using the config.toml file:
[bot]
name = "YouTube Downloader Bot" # Bot's display name
allowed_pubkeys = [ # List of Nostr public keys allowed to use the bot
"npub1...",
"npub2..."
]
nip05 = "[email protected]" # NIP-05 identifier (optional)
[relays]
urls = [ # List of Nostr relays to connect to
"wss://relay.damus.io",
"wss://nostr.wine",
"wss://relay.nostr.band"
]
[downloads]
format = "mp3" # Output audio format (mp3, aac, etc.)
quality = "0" # Audio quality (0 = best)The bot checks the config.toml file every 5 seconds for changes to the allowed_pubkeys list. This allows you to add or remove authorized users without restarting the bot.
- Start the bot:
cargo run-
The bot will display its public key (npub) and a QR code. Save this information.
-
Send a direct message to the bot on Nostr with a YouTube URL. The bot will:
- Verify your pubkey is in the allowed list
- Download the video
- Convert it to MP3 format
- Save it to the downloads directory
- Send you a confirmation message
-
Find your downloaded files in:
- Linux:
~/.local/share/rovr/downloads/ - macOS:
~/Library/Application Support/rovr/downloads/ - Windows:
%APPDATA%\rovr\downloads\
- Linux:
- Secure direct messaging using NIP-04 encryption
- Dynamic authorized user list (updates every 5 seconds)
- Automatic YouTube URL detection
- High-quality MP3 conversion
- Concurrent downloads (multiple videos processed simultaneously)
- Multiple relay support
- Persistent key storage
- QR code generation for easy bot identification
- Cross-platform support
This project is licensed under the MIT License - see the LICENSE file for details.