Skip to content

Commit

Permalink
Add: Link Resolver Added
Browse files Browse the repository at this point in the history
  • Loading branch information
faridrasidov committed Aug 9, 2024
1 parent 911b664 commit e25e206
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions soundcld/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,13 @@ def get_playlists_with_track(self, track_id: int):
link = f'/tracks/{track_id}/playlists_without_albums'
return self._get_album_playlists(link)

def get_resolve(self, link:str):
"""
Gets The Resource At Given URL
if Link Exists, Otherwise Return Nothing
"""
return self._get_resolve(link)

def get_search_all(
self,
text: str,
Expand Down
3 changes: 3 additions & 0 deletions soundcld/api_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ def _get_album_playlists(self, req: str) -> Iterator[BasicAlbumPlaylist]:
def _get_likes(self, req: str, **param) -> Iterator[Like]:
return CollectionGetReq[Like](self, req, Like)(**param)

def _get_resolve(self, resolve_link:str):
return GetReq[SearchItem](self, '/resolve', SearchItem)(url=resolve_link)

def _get_searches(self, req: str, **param) -> Iterator[SearchItem]:
param['user_id'] = self.data['user_id']
return CollectionGetReq[SearchItem](self, req, SearchItem)(**param)
Expand Down

0 comments on commit e25e206

Please sign in to comment.