fixing import errors
This commit is contained in:
@@ -52,8 +52,8 @@ class AudioKeyManager(PacketsReceiver):
|
|||||||
return self.get_audio_key(gid, file_id, False)
|
return self.get_audio_key(gid, file_id, False)
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
"Failed fetching audio key! gid: {}, fileId: {}".format(
|
"Failed fetching audio key! gid: {}, fileId: {}".format(
|
||||||
Utils.Utils.bytes_to_hex(gid),
|
Utils.bytes_to_hex(gid),
|
||||||
Utils.Utils.bytes_to_hex(file_id)))
|
Utils.bytes_to_hex(file_id)))
|
||||||
|
|
||||||
return key
|
return key
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class CdnFeedHelper:
|
|||||||
|
|
||||||
url = resp.url
|
url = resp.url
|
||||||
CdnFeedHelper._LOGGER.debug("Fetched external url for {}: {}".format(
|
CdnFeedHelper._LOGGER.debug("Fetched external url for {}: {}".format(
|
||||||
Utils.Utils.bytes_to_hex(episode.gid), url))
|
Utils.bytes_to_hex(episode.gid), url))
|
||||||
|
|
||||||
streamer = session.cdn().stream_external_episode(
|
streamer = session.cdn().stream_external_episode(
|
||||||
episode, url, halt_listener)
|
episode, url, halt_listener)
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class ChannelManager(Closeable, PacketsReceiver.PacketsReceiver):
|
|||||||
else:
|
else:
|
||||||
self._LOGGER.warning(
|
self._LOGGER.warning(
|
||||||
"Couldn't handle packet, cmd: {}, payload: {}".format(
|
"Couldn't handle packet, cmd: {}, payload: {}".format(
|
||||||
packet.cmd, Utils.Utils.bytes_to_hex(packet.payload)))
|
packet.cmd, Utils.bytes_to_hex(packet.payload)))
|
||||||
|
|
||||||
def close(self) -> None:
|
def close(self) -> None:
|
||||||
self._executorService.shutdown()
|
self._executorService.shutdown()
|
||||||
|
|||||||
@@ -166,14 +166,14 @@ class EpisodeId(SpotifyId, PlayableId):
|
|||||||
if matcher is not None:
|
if matcher is not None:
|
||||||
episode_id = matcher.group(1)
|
episode_id = matcher.group(1)
|
||||||
return EpisodeId(
|
return EpisodeId(
|
||||||
Utils.Utils.bytes_to_hex(
|
Utils.bytes_to_hex(
|
||||||
PlayableId.BASE62.decode(episode_id, 16)))
|
PlayableId.BASE62.decode(episode_id, 16)))
|
||||||
TypeError("Not a Spotify episode ID: {}".format(uri))
|
TypeError("Not a Spotify episode ID: {}".format(uri))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_base62(base62: str) -> EpisodeId:
|
def from_base62(base62: str) -> EpisodeId:
|
||||||
return EpisodeId(
|
return EpisodeId(
|
||||||
Utils.Utils.bytes_to_hex(PlayableId.BASE62.decode(base62, 16)))
|
Utils.bytes_to_hex(PlayableId.BASE62.decode(base62, 16)))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_hex(hex_str: str) -> EpisodeId:
|
def from_hex(hex_str: str) -> EpisodeId:
|
||||||
@@ -184,13 +184,13 @@ class EpisodeId(SpotifyId, PlayableId):
|
|||||||
|
|
||||||
def to_spotify_uri(self) -> str:
|
def to_spotify_uri(self) -> str:
|
||||||
return "Spotify:episode:{}".format(
|
return "Spotify:episode:{}".format(
|
||||||
PlayableId.BASE62.encode(Utils.Utils.hex_to_bytes(self._hexId)))
|
PlayableId.BASE62.encode(Utils.hex_to_bytes(self._hexId)))
|
||||||
|
|
||||||
def hex_id(self) -> str:
|
def hex_id(self) -> str:
|
||||||
return self._hexId
|
return self._hexId
|
||||||
|
|
||||||
def get_gid(self) -> bytes:
|
def get_gid(self) -> bytes:
|
||||||
return Utils.Utils.hex_to_bytes(self._hexId)
|
return Utils.hex_to_bytes(self._hexId)
|
||||||
|
|
||||||
|
|
||||||
class ShowId(SpotifyId):
|
class ShowId(SpotifyId):
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
from librespot.player.codecs.VorbisOnlyAudioQuality import \
|
from librespot.player.codecs.VorbisOnlyAudioQuality import VorbisOnlyAudioQuality
|
||||||
VorbisOnlyAudioQuality
|
|
||||||
|
|||||||
Reference in New Issue
Block a user