Add comprehensive launch documentation and non-interactive setup option

Documentation updates:
- README.md: Added 'Launching the Application' section with all methods
- QUICKSTART.md: Added launch instructions with PATH setup
- LINUX_SETUP.md: Added detailed launching section to Quick Reference

New file:
- setup-noninteractive.py: Non-interactive setup for automated installs

Features documented:
- Method 1: Using launcher script (recommended)
- Method 2: Adding to PATH for global access
- Method 3: Using virtual environment directly
- Method 4: Quick test script
- Prerequisites: Starting lbrynet daemon

Remote install updated to handle interactive mode better.
This commit is contained in:
thePR0M3TH3AN committed 2026-03-15 19:09:55 -04:00
1 parent 0e10af9438
commit f5f3a2305d
5 files changed
+309 -21

No files matched your search

+73 -5
View File
@@ -637,11 +637,74 @@ rm ~/.local/bin/lbrynet
# Edit ~/.bashrc and remove the lbry-downloader PATH line
```
## Launching the Application
After installation, there are several ways to launch LBRY Downloader:
### Method 1: Launcher Script (Recommended)
The setup script creates launcher scripts in `~/Documents/LBRY-Downloader/bin/`:
```bash
# Navigate to install directory
cd ~/Documents/LBRY-Downloader
# Run the downloader
./bin/lbry-downloader --dry-run
# Or run without changing directory
~/Documents/LBRY-Downloader/bin/lbry-downloader --dry-run
```
### Method 2: Add to PATH
Add the bin directory to your PATH to run from anywhere:
```bash
# Add to PATH (one-time setup)
echo 'export PATH="$HOME/Documents/LBRY-Downloader/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Now run from any directory
lbry-downloader --dry-run
lbry-downloader
```
### Method 3: Using Virtual Environment
```bash
cd ~/Documents/LBRY-Downloader
source venv/bin/activate
python main.py --dry-run
```
### Method 4: Quick Test
```bash
cd ~/Documents/LBRY-Downloader
./bin/lbry-test # Automatically runs with --dry-run
```
### Prerequisites: Start the Daemon
**Important:** Always start the LBRY daemon before running the downloader:
```bash
# Check if daemon is running
lbrynet status
# Start if not running
lbrynet start
# Or if using systemd
sudo systemctl start lbrynet
```
## Quick Reference
```bash
# Automated Setup (one-time)
./setup.py
curl -fsSL https://raw.githubusercontent.com/PR0M3TH3AN/LBRY-Downloader/main/remote-install.sh -o install-lbry.sh && bash install-lbry.sh
# Manual Setup (one-time)
sudo apt install python3 python3-pip
@@ -649,12 +712,17 @@ pip3 install --user -r requirements.txt
python3 init.py
# Daily use
lbrynet start # Start daemon
python3 main.py --dry-run # Test first
python3 main.py # Run sync
lbrynet stop # Stop daemon (optional)
lbrynet start # Start daemon
~/Documents/LBRY-Downloader/bin/lbry-downloader --dry-run # Test first
~/Documents/LBRY-Downloader/bin/lbry-downloader # Run sync
lbrynet stop # Stop daemon (optional)
# Or if in PATH
lbry-downloader --dry-run
lbry-downloader
# Locations
Install: ~/Documents/LBRY-Downloader/
Config: ~/Documents/lbry-downloads/config.yaml
Downloads: ~/Documents/lbry-downloads/channels/
State: ~/Documents/lbry-downloads/state/
+48 -6
View File
@@ -33,17 +33,59 @@ channels:
enabled: true
```
## Running
## Launching
### Start the LBRY Daemon First
**Important:** The LBRY daemon must be running before using the downloader:
```bash
# Test what would be downloaded
# Start the daemon
lbrynet start
# Check if it's running
lbrynet status
```
### Launch LBRY Downloader
**Method 1: Using the Launcher (Recommended)**
```bash
cd ~/Documents/LBRY-Downloader
./bin/lbry-downloader --dry-run
```
**Method 2: Add to PATH and run from anywhere**
```bash
# One-time setup
echo 'export PATH="$HOME/Documents/LBRY-Downloader/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Now run from anywhere
lbry-downloader --dry-run
```
**Method 3: Using Virtual Environment**
```bash
cd ~/Documents/LBRY-Downloader
source venv/bin/activate
python main.py --dry-run
```
# Actually download
python main.py
### Common Commands
# Use custom config
python main.py --config ./custom-config.yaml
```bash
# Test what would be downloaded (dry run) - ALWAYS DO THIS FIRST
lbry-downloader --dry-run
# Actually download content
lbry-downloader
# Use custom config file
lbry-downloader --config ./my-config.yaml
# View help
lbry-downloader --help
```
## Understanding Output
+57
View File
@@ -139,6 +139,63 @@ This is useful for:
- **Large channels**: Gradually sync channels with thousands of videos
- **Bandwidth**: Control how much data is downloaded per run
## Launching the Application
After installation, you can launch LBRY Downloader in several ways:
### Method 1: Using the Launcher Script (Recommended)
```bash
# Run from install directory
cd ~/Documents/LBRY-Downloader
./bin/lbry-downloader
# Or if you added it to your PATH (see below)
lbry-downloader
```
### Method 2: Using the Virtual Environment
```bash
cd ~/Documents/LBRY-Downloader
source venv/bin/activate
python main.py
```
### Method 3: Quick Test Script
```bash
cd ~/Documents/LBRY-Downloader
./bin/lbry-test # Automatically runs with --dry-run
```
### Add to PATH (Run from Anywhere)
Add this to your `~/.bashrc` or `~/.zshrc`:
```bash
export PATH="$HOME/Documents/LBRY-Downloader/bin:$PATH"
```
Then reload your shell:
```bash
source ~/.bashrc # or source ~/.zshrc
```
Now you can run `lbry-downloader` from any directory!
### Prerequisites Before Running
**Important:** Make sure the LBRY daemon is running first:
```bash
# Start the daemon
lbrynet start
# Check if it's running
lbrynet status
```
## Usage
```bash
+3 -10
View File
@@ -70,16 +70,9 @@ fi
print_status "Python $PYTHON_VERSION found"
# Check if running in interactive mode
if [ ! -t 0 ]; then
print_error "This script requires interactive mode"
echo ""
echo "Please run using:"
echo " curl -fsSL https://raw.githubusercontent.com/PR0M3TH3AN/LBRY-Downloader/main/remote-install.sh -o install-lbry.sh && bash install-lbry.sh"
echo ""
echo "Or clone manually:"
echo " git clone https://github.com/PR0M3TH3AN/LBRY-Downloader.git"
echo " cd LBRY-Downloader && ./setup.py"
exit 1
INTERACTIVE=false
if [ -t 0 ]; then
INTERACTIVE=true
fi
# Check if already installed
+128
View File
@@ -0,0 +1,128 @@
#!/usr/bin/env python3
"""
LBRY Downloader - Non-Interactive Setup Script
For automated/testing installs. Uses environment variables or defaults.
"""
import os
import sys
import subprocess
from pathlib import Path
# Get values from environment or use defaults
INSTALL_DIR = os.environ.get(
"LBRY_INSTALL_DIR", str(Path.home() / "Documents" / "LBRY-Downloader")
)
DOWNLOAD_DIR = os.environ.get(
"LBRY_DOWNLOAD_DIR", str(Path.home() / "Documents" / "lbry-downloads")
)
DOWNLOAD_LIMIT = int(os.environ.get("LBRY_DOWNLOAD_LIMIT", "10"))
def run_command(cmd, check=True):
result = subprocess.run(
cmd, shell=True, check=check, capture_output=True, text=True
)
return result
print("=" * 60)
print(" LBRY Downloader - Non-Interactive Setup")
print("=" * 60)
print()
print(f"Install directory: {INSTALL_DIR}")
print(f"Download directory: {DOWNLOAD_DIR}")
print(f"Download limit: {DOWNLOAD_LIMIT}")
print()
# Create directories
Path(INSTALL_DIR).mkdir(parents=True, exist_ok=True)
Path(DOWNLOAD_DIR).mkdir(parents=True, exist_ok=True)
(Path(DOWNLOAD_DIR) / "state").mkdir(exist_ok=True)
(Path(DOWNLOAD_DIR) / "channels").mkdir(exist_ok=True)
# Setup virtual environment
venv_path = Path(INSTALL_DIR) / "venv"
if not venv_path.exists():
print("Creating virtual environment...")
subprocess.run([sys.executable, "-m", "venv", str(venv_path)], check=True)
print("✓ Virtual environment created")
# Install dependencies
print("Installing dependencies...")
pip_path = venv_path / "bin" / "pip"
subprocess.run([str(pip_path), "install", "-q", "-r", "requirements.txt"], check=True)
print("✓ Dependencies installed")
# Copy files if needed
current_dir = Path(__file__).parent.resolve()
if current_dir != Path(INSTALL_DIR):
print("Copying files...")
import shutil
for pattern in ["*.py", "*.md", "*.txt", "*.toml", "*.example", "Makefile"]:
for file in current_dir.glob(pattern):
if file.name != "setup-noninteractive.py":
shutil.copy2(file, INSTALL_DIR)
tests_src = current_dir / "tests"
tests_dst = Path(INSTALL_DIR) / "tests"
if tests_src.exists() and not tests_dst.exists():
shutil.copytree(tests_src, tests_dst)
print("✓ Files copied")
# Create config
config_content = f"""# LBRY Downloader Configuration
lbrynet:
api_url: "http://127.0.0.1:5279"
timeout_seconds: 60
general:
base_dir: "{DOWNLOAD_DIR}"
state_file: "{DOWNLOAD_DIR}/state/database.json"
max_workers: 2
log_level: "INFO"
dry_run: false
verify_existing_files: true
write_checksums: true
filename_mode: "original"
include_reposts: false
channel_page_size: 50
keep_missing_claim_records: true
download_limit: {DOWNLOAD_LIMIT}
channels:
# Add your channels here:
# - input: "https://odysee.com/@ChannelName:1"
# enabled: true
"""
config_path = Path(DOWNLOAD_DIR) / "config.yaml"
config_path.write_text(config_content)
print(f"✓ Config created: {config_path}")
# Create launcher
bin_dir = Path(INSTALL_DIR) / "bin"
bin_dir.mkdir(exist_ok=True)
launcher = bin_dir / "lbry-downloader"
launcher.write_text(f"""#!/bin/bash
cd "{INSTALL_DIR}"
source venv/bin/activate
python main.py "$@"
""")
launcher.chmod(0o755)
print(f"✓ Launcher created: {launcher}")
print()
print("=" * 60)
print("✓ Setup complete!")
print("=" * 60)
print()
print(f"Config file: {config_path}")
print(f"To run: {launcher}")
print()
print("Edit the config to add channels, then run:")
print(f" {launcher} --dry-run")