Skip to content

Commit

Permalink
Fix build data-dir and downgrade ytmusicapi
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekmj303 committed Jul 14, 2024
1 parent a9510d9 commit e5993f6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
nuitka-version: main
script-name: ytm2spt.py
enable-plugins: pyside6
user-package-configuration-file: ytmusicapi.nuitka-package.config.yaml

- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Levenshtein
requests
spotipy
thefuzz
ytmusicapi
ytmusicapi==1.7.3
PySide6
1 change: 1 addition & 0 deletions requirements.txt.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nuitka
11 changes: 7 additions & 4 deletions ytm2spt.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import os
import sys
import traceback
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget\
, QLabel, QLineEdit, QCheckBox, QSpinBox, QTextEdit, QPushButton\
, QVBoxLayout, QFormLayout, QHBoxLayout, QDialog, QButtonGroup\
Expand Down Expand Up @@ -304,14 +305,16 @@ def run_command(self):
create_new = self.create_new_checkbox.isChecked()
limit = self.limit_input.value() if self.limit_input.value() > 0 else None

os.environ["SPOTIPY_USER_ID"] = SETTINGS.value("SPOTIFY_USER_ID")
os.environ["SPOTIPY_CLIENT_ID"] = SETTINGS.value("SPOTIFY_CLIENT_ID")
os.environ["SPOTIPY_CLIENT_SECRET"] = SETTINGS.value("SPOTIFY_CLIENT_SECRET")
os.environ["SPOTIPY_REDIRECT_URI"] = SETTINGS.value("SPOTIFY_REDIRECT_URI")
os.environ["SPOTIFY_USER_ID"] = SETTINGS.value("SPOTIFY_USER_ID")
os.environ["SPOTIFY_CLIENT_ID"] = SETTINGS.value("SPOTIFY_CLIENT_ID")
os.environ["SPOTIFY_CLIENT_SECRET"] = SETTINGS.value("SPOTIFY_CLIENT_SECRET")
os.environ["SPOTIFY_REDIRECT_URI"] = SETTINGS.value("SPOTIFY_REDIRECT_URI")

try:
ytm2spt.main(youtube_arg, spotify_arg, spotify_playlist_name, youtube_oauth, dry_run, create_new, limit)
except Exception as e:
print(e)
print(traceback.format_exc())
self.cmd_textbox.setText("Error running command: " + str(e))
QMessageBox.warning(self, "Error", "Error: Failed to run ytm2spt")

Expand Down
4 changes: 4 additions & 0 deletions ytmusicapi.nuitka-package.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- module-name: 'ytmusicapi'
data-files:
dirs:
- 'locales'

0 comments on commit e5993f6

Please sign in to comment.