Skip to content

Commit

Permalink
Update to ytmusicapi 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed May 3, 2020
1 parent f557056 commit cb5ce66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions YouTube.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,20 @@ def add_playlist_items(self, playlistId, videoIds):
self.api.add_playlist_items(playlistId, videoIds)

def get_playlist_id(self, name):
pl = self.api.get_playlists()
pl = self.api.get_library_playlists()
try:
playlist = next(x for x in pl if x['title'].find(name) != -1)['playlistId']
return playlist
except:
raise Exception("Playlist title not found in playlists")

def remove_songs(self, playlistId):
items = self.api.get_playlist_items(playlistId)
items = self.api.get_playlist(playlistId)['tracks']
if len(items) > 0:
self.api.remove_playlist_items(playlistId, items)

def remove_playlists(self, pattern):
playlists = self.api.get_playlists()
playlists = self.api.get_library_playlists()
p = re.compile("{0}".format(pattern))
matches = [pl for pl in playlists if p.match(pl['title'])]
print("The following playlists will be removed:")
Expand Down
2 changes: 1 addition & 1 deletion requirements
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gmusicapi
ytmusicapi
ytmusicapi>=0.7
spotipy

0 comments on commit cb5ce66

Please sign in to comment.