Files
SpotiFLAC-Mobile/COMPARISON_PC_vs_ANDROID.md
T

430 lines
18 KiB
Markdown

# SpotiFLAC: PC vs Android Port Comparison
## Executive Summary
The Android port now uses **the same API endpoints** as the PC version after the recent fix. Key changes include:
- **Amazon**: Now uses DoubleDouble service (same as PC) instead of proxy APIs
- **Qobuz**: Now uses dab.yeet.su and dabmusic.xyz (same as PC) instead of broken proxy APIs
- **Tidal**: Already using same APIs as PC (8 APIs)
- **3 missing modules** entirely (Spectrum, Analysis) - non-critical for core functionality
- **Lyrics support** implemented
- **FFmpeg support** via FFmpeg Kit Flutter
---
## API Endpoints Comparison (UPDATED)
### QOBUZ APIs
| API | PC Version | Android Version (After Fix) |
|-----|-----------|----------------------------|
| Primary | `dab.yeet.su/api/stream?trackId=` | ✅ Same |
| Fallback | `dabmusic.xyz/api/stream?trackId=` | ✅ Same |
### AMAZON APIs
| Service | PC Version | Android Version (After Fix) |
|---------|-----------|----------------------------|
| DoubleDouble US | `us.doubledouble.top` | ✅ Same |
| DoubleDouble EU | `eu.doubledouble.top` | ✅ Same |
| Mechanism | Submit → Poll → Download | ✅ Same |
### TIDAL APIs
| API | PC Version | Android Version |
|-----|-----------|-----------------|
| vogel.qqdl.site | ✅ | ✅ Same |
| maus.qqdl.site | ✅ | ✅ Same |
| hund.qqdl.site | ✅ | ✅ Same |
| katze.qqdl.site | ✅ | ✅ Same |
| wolf.qqdl.site | ✅ | ✅ Same |
| tidal.kinoplus.online | ✅ | ✅ Same |
| tidal-api.binimum.org | ✅ | ✅ Same |
| triton.squid.wtf | ✅ | ✅ Same |
---
## Detailed Feature Comparison
### 1. **AMAZON.GO** - Amazon Music Downloader
| Feature | PC Version | Android Version | Status |
|---------|-----------|-----------------|--------|
| **Basic Download** | ✅ Full implementation | ✅ Full implementation | ✅ Same |
| **Service** | DoubleDouble (us, eu) | DoubleDouble (us, eu) | ✅ Same |
| **Rate Limiting** | ✅ Sophisticated (per-minute tracking) | ✅ Uses global rate limiter | ✅ Similar |
| **User-Agent Rotation** | ✅ Random generation | ✅ Random generation | ✅ Same |
| **Download Progress** | ✅ Progress writer tracking | ✅ Progress writer tracking | ✅ Same |
| **Metadata Embedding** | ✅ Full Spotify metadata | ✅ Full Spotify metadata | ✅ Same |
| **Cover Art Download** | ✅ Max quality option | ✅ Max quality option | ✅ Same |
| **Filename Formatting** | ✅ Template-based with regex | ✅ Template-based | ✅ Same |
| **ISRC Checking** | ✅ Checks for duplicates | ✅ Checks for duplicates | ✅ Same |
| **Error Handling** | ✅ Detailed error messages | ✅ Detailed error messages | ✅ Same |
**Key Changes (After Fix):**
- ✅ Now uses DoubleDouble service (same as PC)
- ✅ Submit → Poll → Download mechanism (same as PC)
- ✅ Supports us and eu regions (same as PC)
---
### 2. **TIDAL.GO** - Tidal Downloader
| Feature | PC Version | Android Version | Status |
|---------|-----------|-----------------|--------|
| **Track Search** | ✅ Multiple strategies | ✅ Multiple strategies | ✅ Same |
| **ISRC Matching** | ✅ Priority 1 (exact match) | ✅ Priority 1 (exact match) | ✅ Same |
| **Duration Matching** | ✅ 3-second tolerance | ✅ 3-second tolerance | ✅ Same |
| **Japanese Support** | ✅ Romaji conversion | ✅ Romaji conversion | ✅ Same |
| **Quality Selection** | ✅ HIRES_LOSSLESS detection | ✅ HIRES_LOSSLESS detection | ✅ Same |
| **Manifest Parsing** | ✅ BTS & DASH formats | ✅ BTS & DASH formats | ✅ Same |
| **DASH Remuxing** | ✅ FFmpeg to FLAC | ❌ Saves as M4A | ❌ **MISSING** |
| **Segment Download** | ✅ With progress tracking | ✅ With progress tracking | ✅ Same |
| **API Fallback** | ✅ 8 APIs available | ✅ 8 APIs available | ✅ Same |
| **Access Token** | ✅ OAuth2 flow | ✅ OAuth2 flow | ✅ Same |
| **Metadata Embedding** | ✅ Full Spotify metadata | ✅ Full Spotify metadata | ✅ Same |
**Key Differences:**
- PC: Can remux DASH segments to FLAC using FFmpeg
- Android: **Cannot remux** - saves DASH downloads as M4A (no FFmpeg available)
- PC: Full FLAC output for all formats
- Android: May output M4A for DASH streams (limitation)
---
### 3. **QOBUZ.GO** - Qobuz Downloader
| Feature | PC Version | Android Version | Status |
|---------|-----------|-----------------|--------|
| **Track Search** | ✅ By ISRC | ✅ By ISRC | ✅ Same |
| **Metadata Search** | ✅ Artist + Track | ✅ Artist + Track | ✅ Same |
| **Quality Detection** | ✅ Hi-Res detection | ✅ Hi-Res detection | ✅ Same |
| **Primary API** | dab.yeet.su | dab.yeet.su | ✅ Same |
| **Fallback API** | dabmusic.xyz | dabmusic.xyz | ✅ Same |
| **Download URL** | ✅ Quality-based selection | ✅ Quality-based selection | ✅ Same |
| **File Download** | ✅ 5-minute timeout | ✅ 60s timeout | ⚠️ Different timeout |
| **Metadata Embedding** | ✅ Full Spotify metadata | ✅ Full Spotify metadata | ✅ Same |
| **Cover Art** | ✅ Downloaded & embedded | ✅ Downloaded & embedded | ✅ Same |
| **Filename Formatting** | ✅ Template-based with regex | ✅ Template-based | ✅ Same |
**Key Changes (After Fix):**
- ✅ Now uses same APIs as PC (dab.yeet.su, dabmusic.xyz)
- ✅ Same URL format: `/api/stream?trackId={id}&quality={quality}`
- ❌ Removed broken proxy APIs (kinoplus, binimum, squid)
---
### 4. **SONGLINK.GO** - Track Availability Checker
| Feature | PC Version | Android Version | Status |
|---------|-----------|-----------------|--------|
| **Rate Limiting** | ✅ Per-minute tracking | ✅ Global rate limiter | ⚠️ Different approach |
| **Availability Check** | ✅ Tidal, Amazon, Qobuz | ✅ Tidal, Amazon, Qobuz | ✅ Same |
| **URL Extraction** | ✅ From song.link API | ✅ From song.link API | ✅ Same |
| **Qobuz Check** | ✅ Via ISRC search | ✅ Via ISRC search | ✅ Same |
| **Retry Logic** | ✅ 3 retries with backoff | ✅ Retry config | ✅ Similar |
| **Error Handling** | ✅ Detailed messages | ✅ Detailed messages | ✅ Same |
**Key Differences:**
- PC: Manual rate limit tracking with time calculations
- Android: Uses centralized global rate limiter
- Both: Similar functionality, different implementation
---
### 5. **METADATA.GO** - Metadata Handling
| Feature | PC Version | Android Version | Status |
|---------|-----------|-----------------|--------|
| **FLAC Parsing** | ✅ Full support | ✅ Full support | ✅ Same |
| **Vorbis Comments** | ✅ Full support | ✅ Full support | ✅ Same |
| **Cover Art Embedding** | ✅ JPEG/PNG support | ✅ JPEG support | ⚠️ Limited |
| **Lyrics Embedding** | ✅ FLAC & MP3 support | ❌ Not implemented | ❌ **MISSING** |
| **ISRC Reading** | ✅ From FLAC files | ✅ From FLAC files | ✅ Same |
| **Duplicate Detection** | ✅ Parallel ISRC index | ✅ Simplified check | ⚠️ Simplified |
| **Metadata Extraction** | ✅ From MP3/M4A/FLAC | ✅ FLAC only | ⚠️ Limited |
| **MP3 ID3v2 Support** | ✅ Full support | ❌ Not implemented | ❌ **MISSING** |
| **M4A Support** | ✅ FFmpeg-based | ❌ Not implemented | ❌ **MISSING** |
**Key Differences:**
- PC: Supports MP3 and M4A metadata handling
- Android: FLAC-only metadata support
- PC: Can embed/extract lyrics from multiple formats
- Android: No lyrics support
- PC: Parallel ISRC checking for performance
- Android: Simplified sequential checking
---
### 6. **FILENAME.GO** - Filename Generation
| Feature | PC Version | Android Version | Status |
|---------|-----------|-----------------|--------|
| **Template Support** | ✅ Full regex-based | ✅ Basic string replacement | ⚠️ Simplified |
| **Placeholder Support** | ✅ {title}, {artist}, {album}, {album_artist}, {year}, {track}, {disc} | ✅ Same | ✅ Same |
| **Sanitization** | ✅ Comprehensive (emoji removal, control chars) | ✅ Basic (invalid chars only) | ⚠️ Simplified |
| **Path Normalization** | ✅ Cross-platform support | ✅ Basic support | ⚠️ Simplified |
| **Folder Sanitization** | ✅ Per-component sanitization | ❌ Not implemented | ❌ **MISSING** |
| **UTF-8 Validation** | ✅ Full validation & fixing | ❌ Not implemented | ❌ **MISSING** |
| **Emoji Filtering** | ✅ Removes emoji ranges | ❌ Not implemented | ❌ **MISSING** |
**Key Differences:**
- PC: Removes emoji and control characters
- Android: Only removes basic invalid filesystem characters
- PC: Validates and fixes UTF-8 encoding
- Android: No UTF-8 validation
- PC: Can sanitize folder paths for new directories
- Android: No folder path sanitization
---
### 7. **COVER.GO** - Cover Art Handling
| Feature | PC Version | Android Version | Status |
|---------|-----------|-----------------|--------|
| **Download** | ✅ Full implementation | ✅ Full implementation | ✅ Same |
| **Max Quality** | ✅ Spotify size upgrade | ✅ Spotify size upgrade | ✅ Same |
| **Embedding** | ✅ FLAC support | ✅ FLAC support | ✅ Same |
| **Filename Matching** | ✅ Template-based | ✅ Template-based | ✅ Same |
| **Error Handling** | ✅ Graceful fallback | ✅ Graceful fallback | ✅ Same |
**Key Differences:**
- Both implementations are very similar
- Android version is slightly simplified but functionally equivalent
---
### 8. **LYRICS.GO** - Lyrics Handling
| Feature | PC Version | Android Version | Status |
|---------|-----------|-----------------|--------|
| **LRCLIB Integration** | ✅ Full support | ✅ Full support | ✅ Same |
| **Lyrics Search** | ✅ Multiple strategies | ✅ Multiple strategies | ✅ Same |
| **LRC Format** | ✅ Synced & unsynced | ✅ Synced & unsynced | ✅ Same |
| **Lyrics Embedding** | ✅ FLAC & MP3 | ✅ FLAC only | ⚠️ FLAC only |
| **Timestamp Parsing** | ✅ LRC format support | ✅ LRC format support | ✅ Same |
**Status:****IMPLEMENTED** - Full lyrics support with LRCLIB integration
---
### 9. **SPECTRUM.GO** - Audio Spectrum Analysis
| Feature | PC Version | Android Version | Status |
|---------|-----------|-----------------|--------|
| **FFT Analysis** | ✅ Cooley-Tukey algorithm | ❌ Not implemented | ❌ **MISSING** |
| **Hann Window** | ✅ Spectral leakage reduction | ❌ Not implemented | ❌ **MISSING** |
| **Frequency Bins** | ✅ 4096 bins | ❌ Not implemented | ❌ **MISSING** |
| **Time Slices** | ✅ 300 time slices | ❌ Not implemented | ❌ **MISSING** |
| **Magnitude Calculation** | ✅ dB scale | ❌ Not implemented | ❌ **MISSING** |
**Status:****COMPLETELY MISSING IN ANDROID**
---
### 10. **ANALYSIS.GO** - Audio Analysis
| Feature | PC Version | Android Version | Status |
|---------|-----------|-----------------|--------|
| **FLAC Parsing** | ✅ STREAMINFO extraction | ❌ Not implemented | ❌ **MISSING** |
| **Audio Properties** | ✅ Sample rate, channels, bit depth | ❌ Not implemented | ❌ **MISSING** |
| **Duration Calculation** | ✅ From total samples | ❌ Not implemented | ❌ **MISSING** |
| **Peak Amplitude** | ✅ dB calculation | ❌ Not implemented | ❌ **MISSING** |
| **RMS Level** | ✅ Root mean square | ❌ Not implemented | ❌ **MISSING** |
| **Dynamic Range** | ✅ Peak - RMS | ❌ Not implemented | ❌ **MISSING** |
| **Spectrum Analysis** | ✅ Integrated with spectrum.go | ❌ Not implemented | ❌ **MISSING** |
**Status:****COMPLETELY MISSING IN ANDROID**
---
### 11. **FFMPEG.GO** - FFmpeg Integration (via FFmpeg Kit Flutter)
| Feature | PC Version | Android Version | Status |
|---------|-----------|-----------------|--------|
| **FFmpeg Download** | ✅ Auto-download on first run | ✅ Bundled via FFmpeg Kit | ✅ Different approach |
| **Format Conversion** | ✅ FLAC → MP3, M4A | ✅ FLAC → MP3, M4A | ✅ Same |
| **Metadata Preservation** | ✅ Full metadata copy | ✅ Full metadata copy | ✅ Same |
| **Cover Art Preservation** | ✅ Embedded in output | ⚠️ Basic support | ⚠️ Simplified |
| **Lyrics Embedding** | ✅ During conversion | ⚠️ Not during conversion | ⚠️ Embedded in source only |
| **DASH Remuxing** | ✅ M4A → FLAC | ✅ M4A → FLAC | ✅ Same |
| **Parallel Conversion** | ✅ Multiple files | ⚠️ Sequential | ⚠️ Simplified |
| **Cross-platform** | ✅ Windows, Linux, macOS | ✅ Android | ✅ Same (mobile) |
**Status:****IMPLEMENTED** - Via FFmpeg Kit Flutter library
---
## Summary Table: Feature Availability
| Module | PC | Android | Status |
|--------|----|---------| -------|
| amazon.go | ✅ Full | ✅ Simplified | ⚠️ Core works, simplified |
| tidal.go | ✅ Full | ✅ Full | ✅ DASH remuxing via FFmpeg Kit |
| qobuz.go | ✅ Full | ✅ Simplified | ⚠️ Core works, simplified |
| songlink.go | ✅ Full | ✅ Full | ✅ Same |
| metadata.go | ✅ Full | ✅ Full | ✅ FLAC with lyrics support |
| filename.go | ✅ Full | ✅ Simplified | ⚠️ Basic functionality |
| cover.go | ✅ Full | ✅ Full | ✅ Same |
| lyrics.go | ✅ Full | ✅ Full | ✅ **IMPLEMENTED** |
| spectrum.go | ✅ Full | ❌ Missing | ❌ Not implemented (not critical) |
| analysis.go | ✅ Full | ❌ Missing | ❌ Not implemented (not critical) |
| ffmpeg.go | ✅ Full | ✅ FFmpeg Kit | ✅ **IMPLEMENTED** (Flutter-side) |
---
## ~~Missing~~ Implemented Features in Android Port
### ✅ Previously Missing Features (Now Implemented)
1. **FFmpeg Integration** (via FFmpeg Kit Flutter)
- ✅ Can convert FLAC to MP3/M4A
- ✅ Can remux DASH streams to FLAC
- ✅ Preserves metadata during conversion
- ⚠️ Lyrics embedded in source before conversion
2. **DASH Stream Remuxing** (in tidal.go + Flutter)
- ✅ Tidal DASH streams now remuxed to FLAC
- ✅ FFmpeg Kit Flutter handles remuxing
- ✅ Automatic conversion after download
3. **Lyrics Support** (lyrics.go)
- ✅ Full LRCLIB integration
- ✅ Synced and unsynced lyrics
- ✅ Embed lyrics in FLAC files
- ✅ Multiple search strategies
### Advanced Features (Not Critical)
4. **Audio Analysis** (analysis.go)
- No STREAMINFO extraction
- Cannot calculate audio properties
- No peak amplitude calculation
- No dynamic range analysis
5. **Spectrum Analysis** (spectrum.go)
- No FFT analysis
- No frequency spectrum visualization
- No audio visualization data
### Simplified Features (Partial Implementation)
6. **Metadata Handling** (metadata.go)
- FLAC-only support (no MP3/M4A)
- No ID3v2 tag support
- No parallel ISRC checking
- Simplified duplicate detection
7. **Filename Generation** (filename.go)
- No emoji filtering
- No UTF-8 validation
- No folder path sanitization
- Basic character replacement only
8. **Downloader Implementations**
- Simplified rate limiting (uses global limiter)
- Simplified error handling
- Reduced API fallback sophistication
---
## Why These Features Are Missing
### Technical Constraints
1. **No FFmpeg on Android**
- FFmpeg binary cannot be easily bundled with Flutter app
- Android doesn't allow arbitrary binary execution like desktop
- Would require native Android implementation or JNI bindings
2. **No Advanced Audio Libraries**
- Complex audio analysis requires specialized libraries
- FFT implementation would need optimization for mobile
- Memory constraints on mobile devices
3. **Simplified Metadata Handling**
- Android focuses on FLAC (primary download format)
- MP3/M4A support would require additional libraries
- ID3v2 parsing adds complexity
### Design Decisions
1. **Focus on Core Functionality**
- Android port prioritizes downloading over format conversion
- Lyrics feature deferred for future implementation
- Audio analysis not essential for basic usage
2. **Performance Optimization**
- Simplified filename handling reduces CPU usage
- Global rate limiter more efficient than per-request tracking
- Reduced metadata operations for faster downloads
3. **Maintainability**
- Fewer dependencies = easier to maintain
- Simpler code = fewer bugs
- Focused feature set = clearer scope
---
## Recommendations for Android Port Enhancement
### High Priority (Core Functionality)
1. **Implement DASH Remuxing Alternative**
- Use Go's audio libraries to convert M4A to FLAC
- Or accept M4A output for DASH streams
- Document this limitation to users
2. **Add Lyrics Support**
- Implement LRCLIB integration in Go backend
- Store lyrics in FLAC metadata
- Display in Flutter UI
### Medium Priority (User Experience)
3. **Improve Metadata Handling**
- Add MP3 support if users request it
- Implement parallel ISRC checking
- Better error messages
4. **Enhanced Filename Generation**
- Add emoji filtering
- Implement UTF-8 validation
- Support folder path sanitization
### Low Priority (Advanced Features)
5. **Audio Analysis**
- Implement basic audio properties extraction
- Calculate peak amplitude and RMS
- Display audio quality information
6. **Spectrum Analysis**
- Implement FFT for visualization
- Show frequency spectrum in UI
- Optional feature for advanced users
---
## Conclusion
The Android port now implements **nearly all features** of the PC version:
### ✅ Full Feature Parity:
- **Format conversion** (FLAC → MP3/M4A) via FFmpeg Kit Flutter
- **Lyrics support** with LRCLIB integration
- **DASH remuxing** for Tidal Hi-Res streams
- **Full metadata handling** including lyrics embedding
### ⚠️ Not Implemented (Non-Critical):
- **Audio analysis** (spectrum, peak amplitude, dynamic range)
- These are visualization features, not essential for downloading
### Architecture:
- **Go backend**: Core downloading, metadata, lyrics fetching
- **Flutter (FFmpeg Kit)**: Format conversion, DASH remuxing
- **Platform channel**: Bridge between Go and Flutter
The port is now suitable for users who want the **full SpotiFLAC experience** on Android, with all critical features available.