Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request: Search and CSV Batch Download Features
Overview
This PR adds iTunes search functionality and CSV batch download capabilities to the CLI, enabling users to discover and download music without direct URLs.
Features
1. iTunes Search Mode (
--search)--json) for programmatic use--download)Usage:
Features:
2. CSV Batch Processing (
--input-csv)titleandartistcolumnsCSV Format:
Usage:
Features:
Technical Implementation
Architecture
ItunesSearchclass: Wraps iTunes API with URL construction and retry logicCSVProcessorclass: Handles CSV reading, searching, matching, and batch downloadsKey Components
ItunesSearch (
gamdl/cli/song_search.py):ItunesApiwith enhanced functionalityentity="song"CSVProcessor (
gamdl/cli/csv_processor.py):Configuration Constants
CSV_BATCH_SIZE: Number of songs to process per batch (default: 10)CSV_BATCH_DELAY_SECONDS: Delay between batches (default: 2)CSV_RATE_LIMIT_RETRY_SECONDS: Wait time on rate limit (default: 30)CSV_MAX_RETRIES: Maximum retry attempts (default: 3)Code Quality Improvements
Benefits
Example Workflows
Search and download:
gamdl --search "The Beatles" --limit 20 --downloadBatch download from CSV:
Search with JSON output:
Testing Considerations
This PR significantly enhances the CLI's capabilities by adding search and batch download features while maintaining code quality and following existing project patterns.