Skip to content

Commit

Permalink
Trying a nav() debug wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
linsomniac committed Feb 11, 2024
1 parent dd1f1db commit 15d83f2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spotify2ytmusic/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@

from . import backend

import ytmusicapi.navigation as navigation

original_nav = navigation.nav


def debug_nav_wrapper(*args, **kwargs):
try:
return original_nav(*args, **kwargs)
except KeyError as e:
print(
f"NAV was called with args={args!r} kwargs={kwargs!r}, raised exception: {e}"
)
raise


navigation.nav = debug_nav_wrapper


def list_liked_albums():
"""
Expand Down

0 comments on commit 15d83f2

Please sign in to comment.