diff --git a/librespot/ZeroconfServer.py b/librespot/ZeroconfServer.py index 98a154a..520bfdc 100644 --- a/librespot/ZeroconfServer.py +++ b/librespot/ZeroconfServer.py @@ -4,13 +4,16 @@ import concurrent.futures import random import socket -from zeroconf import ServiceBrowser, ServiceInfo, Zeroconf +from zeroconf import ServiceBrowser +from zeroconf import ServiceInfo +from zeroconf import Zeroconf from librespot.common import Utils from librespot.core import Session from librespot.crypto import DiffieHellman from librespot.proto import Connect -from librespot.standard import Closeable, Runnable +from librespot.standard import Closeable +from librespot.standard import Runnable class ZeroconfServer(Closeable): diff --git a/librespot/audio/AudioKeyManager.py b/librespot/audio/AudioKeyManager.py index 1046a2f..3ea4c5d 100644 --- a/librespot/audio/AudioKeyManager.py +++ b/librespot/audio/AudioKeyManager.py @@ -10,7 +10,8 @@ from librespot.common import Utils from librespot.core import Session from librespot.core.PacketsReceiver import PacketsReceiver from librespot.crypto import Packet -from librespot.standard import ByteArrayOutputStream, BytesInputStream +from librespot.standard import ByteArrayOutputStream +from librespot.standard import BytesInputStream class AudioKeyManager(PacketsReceiver): diff --git a/librespot/audio/PlayableContentFeeder.py b/librespot/audio/PlayableContentFeeder.py index 0c5f4a0..8d00a7b 100644 --- a/librespot/audio/PlayableContentFeeder.py +++ b/librespot/audio/PlayableContentFeeder.py @@ -3,13 +3,17 @@ from __future__ import annotations import logging import typing -from librespot.audio import GeneralAudioStream, HaltListener, NormalizationData +from librespot.audio import GeneralAudioStream +from librespot.audio import HaltListener +from librespot.audio import NormalizationData from librespot.audio.cdn import CdnFeedHelper from librespot.audio.format import AudioQualityPicker from librespot.common.Utils import Utils from librespot.core import Session -from librespot.metadata import PlayableId, TrackId -from librespot.proto import Metadata, StorageResolve +from librespot.metadata import PlayableId +from librespot.metadata import TrackId +from librespot.proto import Metadata +from librespot.proto import StorageResolve class PlayableContentFeeder: diff --git a/librespot/audio/cdn/CdnFeedHelper.py b/librespot/audio/cdn/CdnFeedHelper.py index dbfaf2c..b0eca33 100644 --- a/librespot/audio/cdn/CdnFeedHelper.py +++ b/librespot/audio/cdn/CdnFeedHelper.py @@ -5,11 +5,13 @@ import random import time import typing -from librespot.audio import (HaltListener, NormalizationData, - PlayableContentFeeder) +from librespot.audio import HaltListener +from librespot.audio import NormalizationData +from librespot.audio import PlayableContentFeeder from librespot.common import Utils from librespot.core import Session -from librespot.proto import Metadata, StorageResolve +from librespot.proto import Metadata +from librespot.proto import StorageResolve class CdnFeedHelper: diff --git a/librespot/audio/cdn/CdnManager.py b/librespot/audio/cdn/CdnManager.py index 8acc876..f25b4c8 100644 --- a/librespot/audio/cdn/CdnManager.py +++ b/librespot/audio/cdn/CdnManager.py @@ -8,9 +8,12 @@ import time import typing import urllib.parse -from librespot.audio import GeneralAudioStream, GeneralWritableStream, StreamId +from librespot.audio import GeneralAudioStream +from librespot.audio import GeneralWritableStream +from librespot.audio import StreamId from librespot.audio.AbsChunkedInputStream import AbsChunkedInputStream -from librespot.audio.decrypt import AesAudioDecrypt, NoopAudioDecrypt +from librespot.audio.decrypt import AesAudioDecrypt +from librespot.audio.decrypt import NoopAudioDecrypt from librespot.audio.format import SuperAudioFormat from librespot.audio.storage import ChannelManager from librespot.common import Utils diff --git a/librespot/audio/storage/ChannelManager.py b/librespot/audio/storage/ChannelManager.py index e2c0cd3..4ae57fd 100644 --- a/librespot/audio/storage/ChannelManager.py +++ b/librespot/audio/storage/ChannelManager.py @@ -8,10 +8,13 @@ import typing from librespot.audio.storage import AudioFile from librespot.common import Utils -from librespot.core import PacketsReceiver, Session +from librespot.core import PacketsReceiver +from librespot.core import Session from librespot.crypto import Packet -from librespot.standard import (BytesInputStream, BytesOutputStream, Closeable, - Runnable) +from librespot.standard import BytesInputStream +from librespot.standard import BytesOutputStream +from librespot.standard import Closeable +from librespot.standard import Runnable class ChannelManager(Closeable, PacketsReceiver.PacketsReceiver): diff --git a/librespot/core/Session.py b/librespot/core/Session.py index c3ed487..2f47c25 100644 --- a/librespot/core/Session.py +++ b/librespot/core/Session.py @@ -13,23 +13,35 @@ import typing import defusedxml.ElementTree import requests -from Crypto.Hash import HMAC, SHA1 +from Crypto.Hash import HMAC +from Crypto.Hash import SHA1 from Crypto.PublicKey import RSA from Crypto.Signature import PKCS1_v1_5 -from librespot.audio import AudioKeyManager, PlayableContentFeeder +from librespot.audio import AudioKeyManager +from librespot.audio import PlayableContentFeeder from librespot.audio.cdn import CdnManager from librespot.audio.storage import ChannelManager from librespot.cache import CacheManager from librespot.common.Utils import Utils -from librespot.core import (ApResolver, EventService, SearchManager, - TokenProvider) -from librespot.crypto import CipherPair, DiffieHellman, Packet -from librespot.dealer import ApiClient, DealerClient -from librespot.mercury import MercuryClient, SubListener -from librespot.proto import Authentication, Connect, Keyexchange +from librespot.core import ApResolver +from librespot.core import EventService +from librespot.core import SearchManager +from librespot.core import TokenProvider +from librespot.crypto import CipherPair +from librespot.crypto import DiffieHellman +from librespot.crypto import Packet +from librespot.dealer import ApiClient +from librespot.dealer import DealerClient +from librespot.mercury import MercuryClient +from librespot.mercury import SubListener +from librespot.proto import Authentication +from librespot.proto import Connect +from librespot.proto import Keyexchange from librespot.proto.ExplicitContentPubsub import UserAttributesUpdate -from librespot.standard import BytesInputStream, Closeable, Proxy +from librespot.standard import BytesInputStream +from librespot.standard import Closeable +from librespot.standard import Proxy from librespot.Version import Version diff --git a/librespot/core/TokenProvider.py b/librespot/core/TokenProvider.py index 3918ee6..dd80580 100644 --- a/librespot/core/TokenProvider.py +++ b/librespot/core/TokenProvider.py @@ -3,7 +3,8 @@ from __future__ import annotations import logging import typing -from librespot.core import Session, TimeProvider +from librespot.core import Session +from librespot.core import TimeProvider from librespot.mercury import MercuryRequests diff --git a/librespot/dealer/ApiClient.py b/librespot/dealer/ApiClient.py index 531314e..d0550cf 100644 --- a/librespot/dealer/ApiClient.py +++ b/librespot/dealer/ApiClient.py @@ -4,8 +4,13 @@ import typing import requests from librespot.core.ApResolver import ApResolver -from librespot.metadata import AlbumId, ArtistId, EpisodeId, ShowId, TrackId -from librespot.proto import Connect, Metadata +from librespot.metadata import AlbumId +from librespot.metadata import ArtistId +from librespot.metadata import EpisodeId +from librespot.metadata import ShowId +from librespot.metadata import TrackId +from librespot.proto import Connect +from librespot.proto import Metadata from librespot.standard import Closeable diff --git a/librespot/mercury/MercuryClient.py b/librespot/mercury/MercuryClient.py index 1d98dd6..14f8581 100644 --- a/librespot/mercury/MercuryClient.py +++ b/librespot/mercury/MercuryClient.py @@ -7,12 +7,17 @@ import threading import typing from librespot.common import Utils -from librespot.core import PacketsReceiver, Session +from librespot.core import PacketsReceiver +from librespot.core import Session from librespot.crypto import Packet -from librespot.mercury import (JsonMercuryRequest, RawMercuryRequest, - SubListener) -from librespot.proto import Mercury, Pubsub -from librespot.standard import BytesInputStream, BytesOutputStream, Closeable +from librespot.mercury import JsonMercuryRequest +from librespot.mercury import RawMercuryRequest +from librespot.mercury import SubListener +from librespot.proto import Mercury +from librespot.proto import Pubsub +from librespot.standard import BytesInputStream +from librespot.standard import BytesOutputStream +from librespot.standard import Closeable class MercuryClient(PacketsReceiver.PacketsReceiver, Closeable): diff --git a/librespot/metadata/__init__.py b/librespot/metadata/__init__.py index 9c31da4..53dcf1e 100644 --- a/librespot/metadata/__init__.py +++ b/librespot/metadata/__init__.py @@ -2,7 +2,8 @@ from __future__ import annotations import re -from librespot.common import Base62, Utils +from librespot.common import Base62 +from librespot.common import Utils from librespot.proto.ContextTrack import ContextTrack diff --git a/librespot/player/Player.py b/librespot/player/Player.py index 53cc392..d812c42 100644 --- a/librespot/player/Player.py +++ b/librespot/player/Player.py @@ -6,7 +6,8 @@ import time import typing from librespot.core.Session import Session -from librespot.player import PlayerConfiguration, StateWrapper +from librespot.player import PlayerConfiguration +from librespot.player import StateWrapper from librespot.player.metrics import PlaybackMetrics from librespot.player.mixing import AudioSink from librespot.player.playback.PlayerSession import PlayerSession diff --git a/librespot/player/StateWrapper.py b/librespot/player/StateWrapper.py index 2bc34b7..32ef488 100644 --- a/librespot/player/StateWrapper.py +++ b/librespot/player/StateWrapper.py @@ -4,11 +4,14 @@ import typing from librespot.core import Session from librespot.dealer import DealerClient -from librespot.player import Player, PlayerConfiguration +from librespot.player import Player +from librespot.player import PlayerConfiguration from librespot.player.state import DeviceStateHandler from librespot.proto import Connect -from librespot.proto.Player import (ContextPlayerOptions, PlayerState, - Restrictions, Suppressions) +from librespot.proto.Player import ContextPlayerOptions +from librespot.proto.Player import PlayerState +from librespot.proto.Player import Restrictions +from librespot.proto.Player import Suppressions class StateWrapper(DeviceStateHandler.Listener, DealerClient.MessageListener): diff --git a/librespot/player/state/DeviceStateHandler.py b/librespot/player/state/DeviceStateHandler.py index 8e9c7ec..a47ab66 100644 --- a/librespot/player/state/DeviceStateHandler.py +++ b/librespot/player/state/DeviceStateHandler.py @@ -11,7 +11,8 @@ import urllib.parse from librespot.common import Utils from librespot.core import Session from librespot.player import PlayerConfiguration -from librespot.proto import Connect, Player +from librespot.proto import Connect +from librespot.proto import Player class DeviceStateHandler: