Skip to content

Commit

Permalink
increased playlist limit and filtering stream for audio only
Browse files Browse the repository at this point in the history
  • Loading branch information
KoljaWindeler committed Nov 26, 2020
1 parent 6802c93 commit 6b91364
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions custom_components/ytube_music_player/media_player.py
Expand Up @@ -311,7 +311,7 @@ def _get_speakers(self, now=None):
def _update_playlists(self, now=None):
""" Sync playlists from Google Music library """
self._playlist_to_index = {}
self._playlists = self._api.get_library_playlists()
self._playlists = self._api.get_library_playlists(limit = 99)
idx = -1
for playlist in self._playlists:
idx = idx + 1
Expand Down Expand Up @@ -426,8 +426,7 @@ def _get_track(self, entity_id=None, old_state=None, new_state=None, retry=3):
self._track_artist_cover = None
""" Get the stream URL and play on media_player """
try:
_url = YouTube('https://www.youtube.com/watch?v='+_track['videoId']).streams.last().url
# last is always audio only?
_url = YouTube('https://www.youtube.com/watch?v='+_track['videoId']).streams.filter(only_audio=True).order_by('abr').last().url
#_LOGGER.error(self._api.get_song(_track['videoId']))
#_LOGGER.error("vs")
except Exception as err:
Expand Down

0 comments on commit 6b91364

Please sign in to comment.