Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: refactor method track_snippet_get #42

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions pymusixmatch/musixmatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def track_lyrics_get(self, track_id: str = "", commontrack_id: str = "") -> dict
)
return data

def track_snippet_get(self, track_id, _format="json"):
def track_snippet_get(self, track_id: str) -> dict:
"""Get the snippet for a given track.

A lyrics snippet is a very short representation of a song lyrics.
Expand All @@ -256,11 +256,10 @@ def track_snippet_get(self, track_id, _format="json"):

Parameters:

track_id - The musiXmatch track id.
format - Decide the output type json or xml (default json).
track_id (str): The musiXmatch track id.
"""
data = self._request(
self._get_url(f"track.snippet.get?track_id={track_id}&format={_format}"),
self._get_url(f"track.snippet.get?track_id={track_id}"),
)
return data

Expand Down
Loading