本文整理汇总了Python中track.Track.art_url方法的典型用法代码示例。如果您正苦于以下问题:Python Track.art_url方法的具体用法?Python Track.art_url怎么用?Python Track.art_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类track.Track
的用法示例。
在下文中一共展示了Track.art_url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_track
# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import art_url [as 别名]
def get_track(provider_id):
t = Track()
try:
######MediaNet######
# reqUrl = 'http://ie-api.mndigital.com?method=track.get&format=json&'\
# + urllib.urlencode({'mnetid': provider_id})\
# + '&ApiKey=%s' % MusicProvider._mnDigitalIntegrationAPIKey
reqUrl = "http://itunes.apple.com/lookup?" + urllib.urlencode({"id": provider_id})
# track_json = common.get_json(reqUrl)["Track"]
track_json = common.get_json(reqUrl)["results"][0]
t.provider_id = provider_id
t.length_seconds = 0
t.url = ""
# t.artist = track_json["Artist"]["Name"]
# t.title = track_json["Title"]
# t.length_friendly = track_json["Duration"]
# t.album = track_json["Album"]["Title"]
# t.art_url = track_json["Album"]["Images"]["Album150x150"]
t.artist = track_json["artistName"]
t.title = track_json["trackName"]
t.length_friendly = ""
t.album = track_json["collectionName"]
t.art_url = track_json["artworkUrl100"]
except Exception:
pass
return t