Exemplo n.º 1
0
 def __search_by_track_title(self, title):
     request_url = self.APPLE_API + "term=%s&country=%s&media=music&entity=%s" % (
         title,
         self._search_country,
         self.ENTITY_MUSIC_TRACK,
     )
     res_dict = http_get_json(request_url, session=self._session, try_time=3)
     if res_dict:
         return res_dict["results"]
     else:
         return []
Exemplo n.º 2
0
 def __search_by_album(self, album_name):
     # print(self._music.file_path)
     request_url = self.APPLE_API + "term=%s&country=%s&media=music&entity=%s" % (
         album_name,
         self._search_country,
         self.ENTITY_ALBUM,
     )
     res_dict = http_get_json(request_url, session=self._session, try_time=3)
     if res_dict:
         return res_dict["results"]
     else:
         return []