Move unplayplay imports to top-level

This commit is contained in:
Rafael Moraes
2026-03-28 09:05:49 -03:00
parent f0ea761f86
commit c43cff0787
2 changed files with 2 additions and 8 deletions
+1 -6
View File
@@ -2,6 +2,7 @@ import asyncio
import logging
from pywidevine.license_protocol_pb2 import WidevinePsshData
from unplayplay.consts import EMULATOR_SIZES, PLAYPLAY_TOKEN
from ..api.enums import SessionType
from ..api.proto.audio_files_extension_pb2 import AudioFilesExtensionResponse
@@ -22,12 +23,6 @@ from .exceptions import (
)
from .types import DecryptionKey, StreamInfo, StreamInfoAv
try:
from unplayplay.consts import EMULATOR_SIZES, PLAYPLAY_TOKEN
except ImportError:
EMULATOR_SIZES = None
PLAYPLAY_TOKEN = None
logger = logging.getLogger(__name__)
+1 -2
View File
@@ -3,6 +3,7 @@ import logging
from async_lru import alru_cache
from pywidevine import PSSH, Cdm, Device
from unplayplay.key_emu import KeyEmu
from ..api import SpotifyApi
from .constants import URL_INFO_RE
@@ -72,8 +73,6 @@ class SpotifyBaseInterface:
def _initialize_key_emu(self) -> None:
if self.spotify_dll_path:
from unplayplay.key_emu import KeyEmu
self.key_emu = KeyEmu(self.spotify_dll_path)
else:
self.key_emu = None