Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2acd6fcba1 | |||
| 85a5bb2321 | |||
| 70a955f531 | |||
| 71c8070ec0 | |||
| 177bc06b79 | |||
| 2aec9c0185 | |||
| a6a84cf869 | |||
| 3577574ad8 | |||
| 3696fc95a7 | |||
| effa462810 | |||
| 921faefecf | |||
| a4168450d1 | |||
| 7ba3efb75b | |||
| d18ba28864 | |||
| f8da9ecfd2 | |||
| 2588680846 | |||
| f3366f0554 |
@@ -1,6 +1,14 @@
|
|||||||
[](https://github.com/afkarxyz/SpotifyFLAC/releases)
|
[](https://github.com/afkarxyz/SpotiFLAC/releases)
|
||||||
|
|
||||||
**Spotify FLAC** allows you to download Spotify tracks in true FLAC format through services like Tidal, Amazon Music, Qobuz, and Deezer with the help of Lucida.
|

|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<b>SpotiFLAC</b> allows you to download Spotify tracks in true FLAC format through services like Tidal, Amazon Music and Qobuz with the help of Lucida.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
### [Download](https://github.com/afkarxyz/SpotiFLAC/releases/download/v1.6/SpotiFLAC.exe)
|
||||||
|
|
||||||
|
#
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> Requires **Google Chrome**
|
> Requires **Google Chrome**
|
||||||
@@ -8,20 +16,18 @@
|
|||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
Sometimes, the **download speed** from Lucida can be fast or slow; it varies unpredictably.
|
Sometimes, the **download speed** from Lucida can be fast or slow; it varies unpredictably.
|
||||||
|
|
||||||
#### [Download](https://github.com/afkarxyz/SpotifyFLAC/releases/download/v1.3/SpotifyFLAC.exe) Spotify FLAC
|
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> - When **Headless** is enabled, the browser runs in the background without a graphical interface, improving performance and allowing seamless automation.
|
> - When **Headless** is enabled, the browser runs in the background without a graphical interface, improving performance and allowing seamless automation.
|
||||||
> - When **Fallback** is enabled, it will use the backup server Lucida.su
|
> - When **Fallback** is enabled, it will use the backup server Lucida.su
|
||||||
> - **Filename: Title** means the filename format is `Title - Artist`, and vice versa.
|
> - **Filename: Title** means the filename format is `Title - Artist`, and vice versa.
|
||||||
> - I highly recommend **Tidal** or **Amazon Music** because `Qobuz` and `Deezer` occasionally experience issues.
|
> - I highly recommend **Tidal** or **Amazon Music** because `Qobuz` occasionally experience issues.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Lossless Audio Check
|
## Lossless Audio Check
|
||||||
|
|
||||||
@@ -29,4 +35,4 @@ Sometimes, the **download speed** from Lucida can be fast or slow; it varies unp
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### [Download](https://github.com/afkarxyz/SpotifyFLAC/releases/download/v0/FLAC-Checker.zip) FLAC Checker
|
### [Download](https://github.com/afkarxyz/SpotiFLAC/releases/download/v0/FLAC-Checker.zip) FLAC Checker
|
||||||
|
|||||||
+127
-14
@@ -2,15 +2,16 @@ import sys
|
|||||||
import asyncio
|
import asyncio
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
import requests
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from PyQt6.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout,
|
from PyQt6.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout,
|
||||||
QHBoxLayout, QLabel, QLineEdit, QPushButton,
|
QHBoxLayout, QLabel, QLineEdit, QPushButton,
|
||||||
QProgressBar, QFileDialog, QCheckBox, QRadioButton,
|
QProgressBar, QFileDialog, QCheckBox, QRadioButton,
|
||||||
QGroupBox, QComboBox)
|
QGroupBox, QComboBox, QDialog, QDialogButtonBox)
|
||||||
from PyQt6.QtCore import QThread, pyqtSignal, Qt, QSettings, QSize
|
from PyQt6.QtCore import QThread, pyqtSignal, Qt, QSettings, QSize, QTimer, QUrl
|
||||||
from PyQt6.QtGui import QIcon, QPixmap, QCursor
|
from PyQt6.QtGui import QIcon, QPixmap, QCursor,QDesktopServices
|
||||||
from GetMetadata import get_metadata
|
from getMetadata import get_metadata
|
||||||
from LucidaDownloader import TrackDownloader
|
from getTracks import TrackDownloader
|
||||||
|
|
||||||
class ImageDownloader(QThread):
|
class ImageDownloader(QThread):
|
||||||
finished = pyqtSignal(bytes)
|
finished = pyqtSignal(bytes)
|
||||||
@@ -102,10 +103,22 @@ class DownloaderWorker(QThread):
|
|||||||
self.last_downloaded_size = 0
|
self.last_downloaded_size = 0
|
||||||
|
|
||||||
def format_size(self, size_bytes):
|
def format_size(self, size_bytes):
|
||||||
return f"{size_bytes / (1024 * 1024):.2f}MB"
|
units = ['B', 'KB', 'MB', 'GB']
|
||||||
|
index = 0
|
||||||
|
while size_bytes >= 1024 and index < len(units) - 1:
|
||||||
|
size_bytes /= 1024
|
||||||
|
index += 1
|
||||||
|
return f"{size_bytes:.2f}{units[index]}"
|
||||||
|
|
||||||
def format_speed(self, speed_bytes):
|
def format_speed(self, speed_bytes):
|
||||||
return f"{speed_bytes * 8 / (1024 * 1024):.2f}Mbps"
|
speed_bits = speed_bytes * 8
|
||||||
|
|
||||||
|
if speed_bits >= 1024 * 1024:
|
||||||
|
speed_mbps = speed_bits / (1024 * 1024)
|
||||||
|
return f"{speed_mbps:.2f}Mbps"
|
||||||
|
else:
|
||||||
|
speed_kbps = speed_bits / 1024
|
||||||
|
return f"{speed_kbps:.2f}Kbps"
|
||||||
|
|
||||||
def progress_callback(self, downloaded_size, total_size):
|
def progress_callback(self, downloaded_size, total_size):
|
||||||
current_time = time.time()
|
current_time = time.time()
|
||||||
@@ -150,8 +163,7 @@ class ServiceComboBox(QComboBox):
|
|||||||
services = [
|
services = [
|
||||||
{'id': 'tidal', 'name': 'Tidal', 'icon': 'tidal.png'},
|
{'id': 'tidal', 'name': 'Tidal', 'icon': 'tidal.png'},
|
||||||
{'id': 'amazon', 'name': 'Amazon Music', 'icon': 'amazon.png'},
|
{'id': 'amazon', 'name': 'Amazon Music', 'icon': 'amazon.png'},
|
||||||
{'id': 'qobuz', 'name': 'Qobuz', 'icon': 'qobuz.png'},
|
{'id': 'qobuz', 'name': 'Qobuz', 'icon': 'qobuz.png'}
|
||||||
{'id': 'deezer', 'name': 'Deezer', 'icon': 'deezer.png'}
|
|
||||||
]
|
]
|
||||||
|
|
||||||
for service in services:
|
for service in services:
|
||||||
@@ -167,11 +179,48 @@ class ServiceComboBox(QComboBox):
|
|||||||
pixmap.fill(Qt.GlobalColor.transparent)
|
pixmap.fill(Qt.GlobalColor.transparent)
|
||||||
pixmap.save(path)
|
pixmap.save(path)
|
||||||
|
|
||||||
class SpotifyFlacGUI(QMainWindow):
|
class UpdateDialog(QDialog):
|
||||||
|
def __init__(self, current_version, new_version, parent=None):
|
||||||
|
super().__init__(parent)
|
||||||
|
self.setWindowTitle("Update Available")
|
||||||
|
self.setFixedWidth(400)
|
||||||
|
self.setModal(True)
|
||||||
|
|
||||||
|
layout = QVBoxLayout()
|
||||||
|
|
||||||
|
message = QLabel(f"A new version of SpotiFLAC is available!\n\n"
|
||||||
|
f"Current version: v{current_version}\n"
|
||||||
|
f"New version: v{new_version}")
|
||||||
|
message.setWordWrap(True)
|
||||||
|
layout.addWidget(message)
|
||||||
|
|
||||||
|
self.disable_check = QCheckBox("Turn off update checking")
|
||||||
|
self.disable_check.setCursor(Qt.CursorShape.PointingHandCursor)
|
||||||
|
layout.addWidget(self.disable_check)
|
||||||
|
|
||||||
|
button_box = QDialogButtonBox()
|
||||||
|
self.update_button = QPushButton("Update")
|
||||||
|
self.update_button.setCursor(Qt.CursorShape.PointingHandCursor)
|
||||||
|
self.cancel_button = QPushButton("Cancel")
|
||||||
|
self.cancel_button.setCursor(Qt.CursorShape.PointingHandCursor)
|
||||||
|
|
||||||
|
button_box.addButton(self.update_button, QDialogButtonBox.ButtonRole.AcceptRole)
|
||||||
|
button_box.addButton(self.cancel_button, QDialogButtonBox.ButtonRole.RejectRole)
|
||||||
|
|
||||||
|
layout.addWidget(button_box)
|
||||||
|
|
||||||
|
self.setLayout(layout)
|
||||||
|
|
||||||
|
self.update_button.clicked.connect(self.accept)
|
||||||
|
self.cancel_button.clicked.connect(self.reject)
|
||||||
|
|
||||||
|
class SpotiFlacGUI(QMainWindow):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.settings = QSettings('SpotifyFlac', 'Settings')
|
self.current_version = "1.6"
|
||||||
self.setWindowTitle("Spotify FLAC")
|
self.settings = QSettings('SpotiFlac', 'Settings')
|
||||||
|
self.setWindowTitle("SpotiFLAC")
|
||||||
|
self.check_for_updates = self.settings.value('check_for_updates', True, type=bool)
|
||||||
|
|
||||||
icon_path = os.path.join(os.path.dirname(__file__), "icon.svg")
|
icon_path = os.path.join(os.path.dirname(__file__), "icon.svg")
|
||||||
if os.path.exists(icon_path):
|
if os.path.exists(icon_path):
|
||||||
@@ -190,6 +239,34 @@ class SpotifyFlacGUI(QMainWindow):
|
|||||||
self.load_settings()
|
self.load_settings()
|
||||||
self.setup_settings_persistence()
|
self.setup_settings_persistence()
|
||||||
|
|
||||||
|
last_url = self.settings.value('last_url', '')
|
||||||
|
self.url_input.setText(last_url)
|
||||||
|
self.url_input.textChanged.connect(self.save_url)
|
||||||
|
|
||||||
|
if self.check_for_updates:
|
||||||
|
QTimer.singleShot(0, self.check_updates)
|
||||||
|
|
||||||
|
def check_updates(self):
|
||||||
|
try:
|
||||||
|
response = requests.get("https://raw.githubusercontent.com/afkarxyz/SpotiFLAC/refs/heads/main/version.json")
|
||||||
|
if response.status_code == 200:
|
||||||
|
data = response.json()
|
||||||
|
new_version = data.get("version")
|
||||||
|
|
||||||
|
if new_version and new_version != self.current_version:
|
||||||
|
dialog = UpdateDialog(self.current_version, new_version, self)
|
||||||
|
result = dialog.exec()
|
||||||
|
|
||||||
|
if dialog.disable_check.isChecked():
|
||||||
|
self.settings.setValue('check_for_updates', False)
|
||||||
|
self.check_for_updates = False
|
||||||
|
|
||||||
|
if result == QDialog.DialogCode.Accepted:
|
||||||
|
QDesktopServices.openUrl(QUrl("https://github.com/afkarxyz/SpotiFLAC/releases"))
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error checking for updates: {e}")
|
||||||
|
|
||||||
def load_settings(self):
|
def load_settings(self):
|
||||||
headless = self.settings.value('headless', True, type=bool)
|
headless = self.settings.value('headless', True, type=bool)
|
||||||
fallback = self.settings.value('fallback', False, type=bool)
|
fallback = self.settings.value('fallback', False, type=bool)
|
||||||
@@ -388,9 +465,41 @@ class SpotifyFlacGUI(QMainWindow):
|
|||||||
self.progress_bar.hide()
|
self.progress_bar.hide()
|
||||||
self.main_layout.addWidget(self.progress_bar)
|
self.main_layout.addWidget(self.progress_bar)
|
||||||
|
|
||||||
|
bottom_layout = QHBoxLayout()
|
||||||
|
|
||||||
self.status_label = QLabel("")
|
self.status_label = QLabel("")
|
||||||
self.main_layout.addWidget(self.status_label)
|
bottom_layout.addWidget(self.status_label, stretch=1)
|
||||||
|
|
||||||
|
self.update_button = QPushButton()
|
||||||
|
icon_path = os.path.join(os.path.dirname(__file__), "update.svg")
|
||||||
|
if os.path.exists(icon_path):
|
||||||
|
self.update_button.setIcon(QIcon(icon_path))
|
||||||
|
self.update_button.setFixedSize(16, 16)
|
||||||
|
self.update_button.setStyleSheet("""
|
||||||
|
QPushButton {
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
QPushButton:hover {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
""")
|
||||||
|
self.update_button.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))
|
||||||
|
self.update_button.setToolTip("Check for Updates")
|
||||||
|
self.update_button.clicked.connect(self.open_update_page)
|
||||||
|
|
||||||
|
bottom_layout.addWidget(self.update_button)
|
||||||
|
|
||||||
|
self.main_layout.addLayout(bottom_layout)
|
||||||
|
|
||||||
|
def save_url(self, url):
|
||||||
|
self.settings.setValue('last_url', url)
|
||||||
|
self.validate_url(url)
|
||||||
|
|
||||||
|
def open_update_page(self):
|
||||||
|
import webbrowser
|
||||||
|
webbrowser.open('https://github.com/afkarxyz/SpotiFLAC/releases')
|
||||||
|
|
||||||
def validate_url(self, url):
|
def validate_url(self, url):
|
||||||
url = url.strip()
|
url = url.strip()
|
||||||
self.fetch_button.setEnabled(False)
|
self.fetch_button.setEnabled(False)
|
||||||
@@ -439,6 +548,7 @@ class SpotifyFlacGUI(QMainWindow):
|
|||||||
self.track_widget.show()
|
self.track_widget.show()
|
||||||
self.download_button.show()
|
self.download_button.show()
|
||||||
self.cancel_button.show()
|
self.cancel_button.show()
|
||||||
|
self.update_button.hide()
|
||||||
self.status_label.clear()
|
self.status_label.clear()
|
||||||
self.adjustWindowHeight()
|
self.adjustWindowHeight()
|
||||||
|
|
||||||
@@ -479,6 +589,7 @@ class SpotifyFlacGUI(QMainWindow):
|
|||||||
self.status_label.clear()
|
self.status_label.clear()
|
||||||
self.metadata = None
|
self.metadata = None
|
||||||
self.fetch_button.setEnabled(True)
|
self.fetch_button.setEnabled(True)
|
||||||
|
self.update_button.show()
|
||||||
self.setFixedHeight(180)
|
self.setFixedHeight(180)
|
||||||
|
|
||||||
def button_clicked(self):
|
def button_clicked(self):
|
||||||
@@ -488,6 +599,7 @@ class SpotifyFlacGUI(QMainWindow):
|
|||||||
self.start_download()
|
self.start_download()
|
||||||
|
|
||||||
def clear_form(self):
|
def clear_form(self):
|
||||||
|
self.settings.setValue('last_url', '')
|
||||||
self.url_input.clear()
|
self.url_input.clear()
|
||||||
self.progress_bar.hide()
|
self.progress_bar.hide()
|
||||||
self.progress_bar.setValue(0)
|
self.progress_bar.setValue(0)
|
||||||
@@ -499,6 +611,7 @@ class SpotifyFlacGUI(QMainWindow):
|
|||||||
self.track_widget.hide()
|
self.track_widget.hide()
|
||||||
self.input_widget.show()
|
self.input_widget.show()
|
||||||
self.metadata = None
|
self.metadata = None
|
||||||
|
self.update_button.show()
|
||||||
self.setFixedHeight(180)
|
self.setFixedHeight(180)
|
||||||
|
|
||||||
def start_download(self):
|
def start_download(self):
|
||||||
@@ -558,7 +671,7 @@ class SpotifyFlacGUI(QMainWindow):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
window = SpotifyFlacGUI()
|
window = SpotiFlacGUI()
|
||||||
window.show()
|
window.show()
|
||||||
sys.exit(app.exec())
|
sys.exit(app.exec())
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"version": "1.6"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user