Open
Conversation
merge parent updates
* Add iTunes search API integration and CSV batch processing support - Introduced ITUNES_SEARCH_API_URL constant for iTunes search API. - Implemented search method in ItunesApi class to fetch song data. - Enhanced CLI with options for search mode, concurrent downloads, and CSV input. - Added CSV batch processing logic to read song titles and artists, search via iTunes API, and download results. - Implemented progress display for concurrent downloads and integrated progress hooks in downloader classes. * move constants to the right file * Refactor downloader classes to remove progress hook parameter - Removed the progress hook parameter from download methods in various downloader classes. - Updated the corresponding method calls to ensure compatibility with the new signature. - Simplified the download process by eliminating unnecessary progress tracking logic. * Refactor CSV processing logic in CLI - Moved CSV reading and processing logic to a more appropriate location within the main function. - Updated comments to clarify the flow of processing CSV rows in batches. - Ensured that the CSV rows are read and prepared for processing before initiating the download sequence. * Refactor CLI to utilize ItunesSearch and CSVProcessor - Replaced direct API calls with ItunesSearch for improved search handling. - Introduced CSVProcessor to streamline CSV reading and processing logic. - Updated comments for clarity on the CSV processing flow. - Removed redundant code related to manual CSV handling and song URL construction. --------- Co-authored-by: Pedro
paixaop
commented
Jan 5, 2026
| if playlist_tags: | ||
| tags_dict.update(playlist_tags.__dict__) | ||
| else: | ||
| tags_dict.update(PlaylistTags( |
Author
There was a problem hiding this comment.
was getting an error when the URL pointed directly to a song, ie, the playlist metadata was None
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.