-
Notifications
You must be signed in to change notification settings - Fork 60
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
feature: Accept offset
in search_track
#48
Comments
Here's the patch: diff --git a/shazamio/api.py b/shazamio/api.py
index 0feaa0d..21653ad 100644
--- a/shazamio/api.py
+++ b/shazamio/api.py
@@ -274,7 +274,7 @@ class Shazam(Converter, Geo, Request):
headers=self.headers(),
)
- async def search_track(self, query: str, limit: int = 10) -> Dict[str, Any]:
+ async def search_track(self, query: str, limit: int = 10, start_from: int = 0) -> Dict[str, Any]:
"""
Search all tracks by prefix
:param query: Track full title or prefix title
@@ -287,6 +287,7 @@ class Shazam(Converter, Geo, Request):
ShazamUrl.SEARCH_MUSIC.format(
query,
limit,
+ start_from,
language=self.language,
),
headers=self.headers(),
diff --git a/shazamio/misc.py b/shazamio/misc.py
index b8e4742..d4fcb19 100644
--- a/shazamio/misc.py
+++ b/shazamio/misc.py
@@ -49,7 +49,7 @@ class ShazamUrl:
)
SEARCH_MUSIC = (
"https://www.shazam.com/services/search/v3/en/GB/web/search?query={}"
- "&numResults={}&offset=0&types=songs"
+ "&numResults={}&offset={}&types=songs"
)
LISTENING_COUNTER = "https://www.shazam.com/services/count/v2/web/track/{}"
|
Thanks for your input, I don't have much time right now and would be grateful if you could release a PR with this change! I will accept it. |
Merged
Hello! Added and renamed start_from to offset. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please consider adding
offset
parameter tosearch_track
The text was updated successfully, but these errors were encountered: