Skip to content

Commit

Permalink
verbose logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu authored and Ubuntu committed May 3, 2024
1 parent 11e6c29 commit c32eb32
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions spotify_to_ytmusic/reddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def get_top_new(self, time="week"):
youtube_pos = []
count = 0
for url in urls:
print(url)
if "open.spotify.com" in url:
spotify.append(url)
count += 1
Expand Down
1 change: 1 addition & 0 deletions spotify_to_ytmusic/top.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def top(args):
if i in results["youtube_pos"]:
r = results["youtube"][results["youtube_pos"].index(i)]
match = re.search(r"(?:v=|\/)([0-9A-Za-z_-]{11}).*", r) # from pytube extract.video_id
print(f"youtube '{match.group(1)}'")
videoIds.append(match.group(1))
else:
videoIds.extend(search_results[track_counter : track_counter + track_counts[counter]])
Expand Down
4 changes: 4 additions & 0 deletions spotify_to_ytmusic/ytmusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ def __init__(self):
self.api = YTMusic(headers, settings["youtube"]["user_id"])

def create_playlist(self, name, info, privacy="PRIVATE", tracks=None):
print(info)
print(privacy)
print(tracks)
return self.api.create_playlist(name, info, privacy, video_ids=tracks)

def search_songs(self, tracks):
Expand All @@ -34,6 +37,7 @@ def search_songs(self, tracks):
notFound.append(query)
else:
targetSong = get_best_fit_song_id(result, song)
print(f"ytmusic '{query}' '{targetSong}'")
if targetSong is None:
notFound.append(query)
else:
Expand Down

0 comments on commit c32eb32

Please sign in to comment.