Skip to content

Commit

Permalink
格式化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
0xHJK committed Aug 25, 2019
1 parent d7c2ae3 commit 7c686ef
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions music_dl/addons/qq.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ def download_cover(self):
def download(self):
# 计算vkey
guid = str(random.randrange(1000000000, 10000000000))
params = {"guid": guid,
"loginUin": "3051522991",
"format": "json",
"platform": "yqq",
"cid": "205361747",
"uin": "3051522991",
"songmid": self.mid,
"needNewCode": 0}
params = {
"guid": guid,
"loginUin": "3051522991",
"format": "json",
"platform": "yqq",
"cid": "205361747",
"uin": "3051522991",
"songmid": self.mid,
"needNewCode": 0,
}
rate_list = [
("A000", "ape", 800),
("F000", "flac", 800),
Expand All @@ -84,8 +86,8 @@ def download(self):
vkey = res_data.get("data", {}).get("items", [])[0].get("vkey", "")
if vkey:
url = (
"http://dl.stream.qqmusic.qq.com/%s?vkey=%s&guid=%s&uin=3051522991&fromtag=64"
% (params["filename"], vkey, guid)
"http://dl.stream.qqmusic.qq.com/%s?vkey=%s&guid=%s&uin=3051522991&fromtag=64"
% (params["filename"], vkey, guid)
)
self.song_url = url
if self.available:
Expand All @@ -94,6 +96,7 @@ def download(self):
break
super(QQSong, self).download()


def qq_search(keyword) -> list:
""" 搜索音乐 """
number = config.get("number") or 5
Expand Down

0 comments on commit 7c686ef

Please sign in to comment.