@@ -34,7 +34,9 @@ def __init__(self, config: Config, http_client: HTTPClient, options: Optional[Sc
3434 super ().__init__ (config , http_client , options )
3535
3636 def search (self , query : str , limit : Optional [int ]) -> Iterable [Metadata ]:
37- search_page = self .http_client .get (f"{ self .base_url } /search?q={ query } " )
37+ search_page = self .http_client .get (
38+ f"{ self .base_url } /search" , params = {"q" : query }
39+ )
3840
3941 soup = self .soup (search_page )
4042
@@ -51,17 +53,17 @@ def search(self, query: str, limit: Optional[int]) -> Iterable[Metadata]:
5153 if item ["href" ].count ("/" ) == 2 : # NOTE: only get music
5254 with yt_dlp .YoutubeDL (yt_options ) as f :
5355 info = f .extract_info (self .base_url + item ["href" ])
54-
56+
5557 yield SoundCloudMetadata (
5658 id = _ ,
5759 title = info .get ("title" ) + " ~ " + info .get ("uploader" ),
5860 type = MetadataType .SINGLE ,
61+ image_url = info .get ("thumbnails" )[- 1 ]["url" ],
5962 year = info .get ("upload_date" , "" )[:4 ],
6063 info = info ,
6164
6265 extra_func = lambda : ExtraMetadata (
6366 description = info .get ("description" ),
64- image_url = info .get ("thumbnails" )[- 1 ]["url" ],
6567 genres = info .get ("genres" )
6668 )
6769 )
0 commit comments