Quick Start
Edit configuration
Installing Dependencies
Core Dependencies (Required)
These are required for basic functionality:- Ubuntu/Debian
- macOS (Homebrew)
- Arch Linux
| Package | Purpose | Required |
|---|---|---|
bash 4.0+ | Script runtime | Yes |
curl | Downloads and API requests | Yes |
jq | JSON parsing | Yes |
file | File type detection | Yes |
md5sum | Duplicate detection | Yes |
unzip | ZIP extraction | Yes |
ffprobe | Music metadata extraction | For music features |
ffmpeg | Cover art extraction | For music features |
Optional Dependencies
Telegram Support (Optional)
Telegram Support (Optional)
Only needed if downloading from Telegram channels.Requirements:See Telegram Integration for complete setup.
- Python 3.7+
- Telethon library
Configuration File (.env)
Required Variables
Create a.env file with these credentials:
.env
Get these credentials by following the Google Drive API Setup guide.
Optional Variables
.env
File Locations
Configuration Files
| File | Purpose | Location |
|---|---|---|
.env | Your credentials | ~/workspace/source/cloud/gdrive-ingest/.env |
.env.example | Template | ~/workspace/source/cloud/gdrive-ingest/.env.example |
Temporary Files
All temp files are created in/tmp/ with unique process IDs:
/tmp/<filename>_$$- Downloaded files/tmp/extract_$$/- ZIP extraction/tmp/covers_$$/- Extracted cover art
Session Files
Telegram authentication (persistent):Testing Your Setup
Test 1: Basic Download
- Interactive folder selector appears
- File downloads with progress bar
- File uploads to selected folder
- Success message with Google Drive link
Test 2: Debug Mode
- Shows commands that would run
- No actual download/upload occurs
- Useful for troubleshooting
Debug mode is perfect for testing configuration without actually uploading files.
Test 3: Music File
- Extracts metadata (Artist, Album, Title)
- Creates folder structure:
Music/Artist/Album (Year)/ - Extracts and uploads cover art
- Uploads song to album folder
Test 4: Telegram (if configured)
- First run: prompts for phone + verification code
- Downloads with progress bar
- Organizes and uploads normally
Troubleshooting Setup Issues
Missing credentials in .env file
Missing credentials in .env file
Error:Solution:
- Create
.envfrom template:cp .env.example .env - Follow Google Drive API Setup
- Add credentials to
.env
Access token invalid or expired
Access token invalid or expired
Error:Solution:
- Check your
REFRESH_TOKENin.env - It should start with
1//04...or1//0g... - Regenerate if needed (see Google Drive API Setup)
curl: command not found
curl: command not found
Solution:
jq: command not found
jq: command not found
Solution:
ffprobe: command not found
ffprobe: command not found
Impact: Music files won’t be organized by artist/album.Solution:
TELEGRAM_API_ID not set
TELEGRAM_API_ID not set
Error:Solution:
- Only needed for Telegram downloads
- Get credentials from https://my.telegram.org
- Add to
.envfile (see Telegram Integration)
Security Best Practices
Safe to commit:.env.example(template without secrets)- All script files (
.sh) - Documentation (
.md)
Use a dedicated Google account
Consider creating a separate Google account just for this script instead of using your personal account.
Cleanup and Utilities
Cleanup Temp Files
If the script crashes or is interrupted, temp files may remain:/tmp/gdrive_* and ~/.config/gdrive-ingest/.
Telegram Setup Helper
Interactive setup for Telegram credentials:Next Steps
Google Drive API Setup
Get your OAuth credentials
Usage Examples
Learn how to use the script
Interactive Features
Master the interactive UI
Troubleshooting
Fix common issues