From 5b4b4761ed7e5ce898199fcd9b48a3b43cf884d4 Mon Sep 17 00:00:00 2001 From: sigma67 Date: Sat, 23 Nov 2024 19:47:14 +0100 Subject: [PATCH] revert changes to ytmusic.py --- spotify_to_ytmusic/ytmusic.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/spotify_to_ytmusic/ytmusic.py b/spotify_to_ytmusic/ytmusic.py index 7275dd7..906c78e 100644 --- a/spotify_to_ytmusic/ytmusic.py +++ b/spotify_to_ytmusic/ytmusic.py @@ -6,23 +6,18 @@ from spotify_to_ytmusic.utils.match import get_best_fit_song_id from spotify_to_ytmusic.settings import Settings -from spotify_to_ytmusic.setup import setup_youtube_browser path = os.path.dirname(os.path.realpath(__file__)) + os.sep class YTMusicTransfer: def __init__(self): - self.settings = Settings() - headers = self.settings["youtube"]["headers"] + settings = Settings() + headers = settings["youtube"]["headers"] assert headers.startswith("{"), "ytmusicapi headers not set or invalid" - self.api = YTMusic(headers, self.settings["youtube"]["user_id"]) + self.api = YTMusic(headers, settings["youtube"]["user_id"]) def create_playlist(self, name, info, privacy="PRIVATE", tracks=None): - if self.settings["youtube"]["auth_type"] == "browser": - setup_youtube_browser() - self.api = YTMusic(self.settings["youtube"]["headers"], self.settings["youtube"]["user_id"]) - return self.api.create_playlist(name, info, privacy, video_ids=tracks) def rate_song(self, id, rating):