Skip to content

Commit f3bad4c

Browse files
committed
Suppress Spotify API HTTP errors in console output
1 parent 22b6acf commit f3bad4c

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 1.1.0: 2026-01-08
2+
3+
* Suppress Spotify API HTTP errors from flooding console output
4+
15
### 1.0.10: 2026-01-07
26

37
* Auto-start spotifyd if not running on launch

omnishuffle/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""OmniShuffle - Unified music shuffler for Spotify, Pandora, and YouTube Music."""
22

3-
__version__ = "1.0.10"
3+
__version__ = "1.1.0"

omnishuffle/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ def run(self):
676676

677677
if key == 'q':
678678
self.running = False
679+
break
679680
elif key == 'n':
680681
self.play_next()
681682
elif key == 'p' or key == ' ':

omnishuffle/player.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,8 @@ def play(self, track: Track):
100100
self._loading = True
101101

102102
# Stop current playback before starting new track
103-
# Always try to pause Spotify (not just when _using_spotify_connect)
104103
if self._spotify_source:
105-
try:
106-
self._spotify_source.pause_playback()
107-
except Exception:
108-
pass
104+
self._spotify_source.pause_playback()
109105
try:
110106
self.mpv.command('stop')
111107
except Exception:
@@ -190,10 +186,7 @@ def stop(self):
190186
"""Stop playback."""
191187
self._using_spotify_connect = False
192188
if self._spotify_source:
193-
try:
194-
self._spotify_source.pause_playback() # No device_id = pause active device
195-
except Exception:
196-
pass
189+
self._spotify_source.pause_playback()
197190
try:
198191
self.mpv.stop()
199192
except Exception:
@@ -321,10 +314,7 @@ def shutdown(self):
321314
"""Clean shutdown."""
322315
# Stop Spotify Connect playback
323316
if self._spotify_source:
324-
try:
325-
self._spotify_source.pause_playback() # No device_id = pause active device
326-
except Exception:
327-
pass
317+
self._spotify_source.pause_playback()
328318
# Stop and terminate mpv
329319
try:
330320
self.mpv.command('stop')

omnishuffle/sources/spotify.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Spotify music source using spotipy and librespot for direct streaming."""
22

3+
import logging
34
import os
45
import subprocess
56
import tempfile
@@ -9,6 +10,10 @@
910
from omnishuffle.player import Track
1011
from omnishuffle.sources.base import MusicSource
1112

13+
# Suppress spotipy HTTP error logging
14+
logging.getLogger("spotipy.client").setLevel(logging.CRITICAL)
15+
logging.getLogger("urllib3").setLevel(logging.CRITICAL)
16+
1217
try:
1318
import spotipy
1419
from spotipy.oauth2 import SpotifyOAuth

0 commit comments

Comments
 (0)