@@ -292,7 +292,7 @@ async def get_new_releases(self) -> list[SimplifiedAlbum]:
292292 @catch_json_decode_error
293293 async def get_artist (self , artist_id : str ) -> Artist :
294294 """Get artist."""
295- identifier = artist_id .split (":" )[- 1 ]
295+ identifier = artist_id .rsplit (":" , maxsplit = 1 )[- 1 ]
296296 response = await self ._get (f"v1/artists/{ identifier } " )
297297 return Artist .from_json (response )
298298
@@ -314,14 +314,14 @@ async def get_artists(self, artist_ids: list[str]) -> list[Artist]:
314314 async def get_artist_albums (self , artist_id : str ) -> list [SimplifiedAlbum ]:
315315 """Get artist albums."""
316316 params : dict [str , Any ] = {"limit" : 48 }
317- identifier = artist_id .split (":" )[- 1 ]
317+ identifier = artist_id .rsplit (":" , maxsplit = 1 )[- 1 ]
318318 response = await self ._get (f"v1/artists/{ identifier } /albums" , params = params )
319319 return NewReleasesResponseInner .from_json (response ).items
320320
321321 @catch_json_decode_error
322322 async def get_artist_top_tracks (self , artist_id : str ) -> list [Track ]:
323323 """Get artist top tracks."""
324- identifier = artist_id .split (":" )[- 1 ]
324+ identifier = artist_id .rsplit (":" , maxsplit = 1 )[- 1 ]
325325 response = await self ._get (f"v1/artists/{ identifier } /top-tracks" )
326326 return ArtistTopTracksResponse .from_json (response ).tracks
327327
@@ -413,7 +413,7 @@ async def get_category(self, category_id: str) -> Category:
413413 @catch_json_decode_error
414414 async def get_chapter (self , chapter_id : str ) -> Chapter :
415415 """Get chapter."""
416- identifier = chapter_id .split (":" )[- 1 ]
416+ identifier = chapter_id .rsplit (":" , maxsplit = 1 )[- 1 ]
417417 response = await self ._get (f"v1/chapters/{ identifier } " )
418418 return Chapter .from_json (response )
419419
@@ -434,7 +434,7 @@ async def get_chapters(self, chapter_ids: list[str]) -> list[Chapter]:
434434 @catch_json_decode_error
435435 async def get_episode (self , episode_id : str ) -> Episode :
436436 """Get episode."""
437- identifier = episode_id .split (":" )[- 1 ]
437+ identifier = episode_id .rsplit (":" , maxsplit = 1 )[- 1 ]
438438 response = await self ._get (f"v1/episodes/{ identifier } " )
439439 return Episode .from_json (response )
440440
@@ -638,7 +638,7 @@ async def add_to_queue(self, uri: str, device_id: str | None = None) -> None:
638638 @catch_json_decode_error
639639 async def get_playlist (self , playlist_id : str ) -> Playlist :
640640 """Get playlist."""
641- identifier = playlist_id .split (":" )[- 1 ]
641+ identifier = playlist_id .rsplit (":" , maxsplit = 1 )[- 1 ]
642642 response = await self ._get (
643643 f"v1/playlists/{ identifier } " , params = {"additional_types" : "track,episode" }
644644 )
@@ -810,7 +810,7 @@ async def search(
810810 @catch_json_decode_error
811811 async def get_show (self , show_id : str ) -> Show :
812812 """Get show."""
813- identifier = show_id .split (":" )[- 1 ]
813+ identifier = show_id .rsplit (":" , maxsplit = 1 )[- 1 ]
814814 response = await self ._get (f"v1/shows/{ identifier } " )
815815 return Show .from_json (response )
816816
@@ -819,7 +819,7 @@ async def get_show(self, show_id: str) -> Show:
819819 @catch_json_decode_error
820820 async def get_show_episodes (self , show_id : str ) -> list [SimplifiedEpisode ]:
821821 """Get show episodes."""
822- identifier = show_id .split (":" )[- 1 ]
822+ identifier = show_id .rsplit (":" , maxsplit = 1 )[- 1 ]
823823 params : dict [str , Any ] = {"limit" : 48 }
824824 response = await self ._get (f"v1/shows/{ identifier } /episodes" , params = params )
825825 return ShowEpisodesResponse .from_json (response ).items
0 commit comments