Before you begin
Make sure you’ve completed the installation guide and have:- Cloned the repository to
~/scripts - Installed core dependencies (bash, curl, jq, ffmpeg)
- Made scripts executable with
chmod +x
This guide focuses on GDrive Ingest, the flagship script for uploading files to Google Drive.
Set up Google Drive API
Before using GDrive Ingest, you need to configure Google Drive API credentials.Get Google Drive credentials
You’ll need three pieces of information:
- CLIENT_ID - OAuth 2.0 client ID from Google Cloud Console
- CLIENT_SECRET - OAuth 2.0 client secret
- REFRESH_TOKEN - Long-lived token for accessing your Drive
Your first upload
Let’s upload a file to Google Drive using the interactive interface.Basic usage
Run the script with a URL to a file you want to download and upload:Interactive folder browser
The script will launch an interactive folder browser:↑/↓- Move up and down through folders→- Enter the selected folder←- Go back to parent folderEnter- Select the current folder as destinationq- Quit the browser
The folder browser shows your actual Google Drive folder structure in real-time.
Watch the progress
Once you select a destination, the script will:- Download the file with a live progress bar
- Extract metadata (for audio files)
- Organize into the appropriate folder structure
- Upload to Google Drive with progress tracking
- Clean up temporary files
Skip the interactive browser
If you already know which folder you want to upload to, skip the interactive browser:Upload multiple files
You can upload multiple files in one command:Multiple URLs as arguments
Comma-separated URLs
From a JSON file
Create a JSON file with your URLs:urls.json
Smart music organization
For audio files, GDrive Ingest automatically:- Extracts artist, album, and year from metadata
- Organizes into
Artist/Album (Year)/folder structure - Extracts and uploads cover art as
cover.jpg - Cleans metadata to remove website tags
- Detects and skips duplicate files
Non-music files are organized by type: Images, Videos, Documents, or Others.
Download from Telegram (optional)
If you’ve set up Telegram support, you can download files from Telegram channels:- Enter your phone number (with country code)
- Enter the verification code sent to Telegram
- (Optional) Enter 2FA password if enabled
Debug mode
Test the script without actually downloading or uploading:Common use cases
Upload a single song
Backup multiple files directly
Organize an album from a ZIP file
- Download and extract the ZIP
- Detect audio files inside
- Organize each track by artist/album
- Upload with cover art
Download Telegram music channel
Clean up temporary files
GDrive Ingest creates temporary files in/tmp/gdrive_* during operation. These are automatically cleaned up after each upload.
If you need to manually clean up:
- All
/tmp/gdrive_*directories - Session files in
~/.config/gdrive-ingest/ - Leftover lock files
Get help
View all available options and examples:Other system tools
Try other scripts in the collection:Power Guard
Monitor and manage CPU-intensive processes:Create your own script
Use the template to build custom automation:- Argument parsing
- Color-coded output functions
- Error handling
- Help documentation
- Debug mode support
Troubleshooting
”Missing credentials in .env file”
You haven’t set up your Google Drive API credentials yet. See step 1 of this guide.”TELEGRAM_API_ID required”
You’re trying to download from Telegram without setting up credentials. Either:- Add Telegram credentials to
.env(see installation guide) - Don’t use Telegram URLs
”database is locked” (Telegram)
A previous Telegram session didn’t close properly. Remove the lock file:Upload fails silently
Check if the file was downloaded:“ffprobe: command not found”
You haven’t installed ffmpeg. See the installation guide for instructions.Next steps
Now that you’re familiar with the basics, explore more features:Google Drive setup
Detailed guide for obtaining Google Drive API credentials
Telegram setup
Configure Telegram support for downloading from channels
Advanced features
Learn about duplicate detection, metadata cleaning, and more
System tools
Explore other automation scripts in the collection