mirror of
https://github.com/soimort/you-get.git
synced 2025-02-13 13:35:20 +03:00
update
This commit is contained in:
parent
e2d2745019
commit
81b9b23271
@ -12,7 +12,6 @@ import base64
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
import requests
|
|
||||||
from Crypto.Cipher import AES
|
from Crypto.Cipher import AES
|
||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
@ -43,8 +42,7 @@ def get_mp3_link(song_id):
|
|||||||
data = {'params': params, 'encSecKey': encSecKey}
|
data = {'params': params, 'encSecKey': encSecKey}
|
||||||
url = "http://music.163.com/weapi/song/enhance/player/url?csrf_token="
|
url = "http://music.163.com/weapi/song/enhance/player/url?csrf_token="
|
||||||
try:
|
try:
|
||||||
req = requests.post(url, headers=header, data=data, timeout=10).json()
|
req = loads(post_content(url, headers=header, post_data=data, decoded=True))
|
||||||
if req['code'] == 200:
|
|
||||||
return req['data'][0]['url']
|
return req['data'][0]['url']
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise
|
raise
|
||||||
@ -149,10 +147,7 @@ def netease_video_download(vinfo, output_dir='.', info_only=False):
|
|||||||
|
|
||||||
def netease_song_download(song, output_dir='.', info_only=False, playlist_prefix=""):
|
def netease_song_download(song, output_dir='.', info_only=False, playlist_prefix=""):
|
||||||
title = "%s%s. %s" % (playlist_prefix, song['position'], song['name'])
|
title = "%s%s. %s" % (playlist_prefix, song['position'], song['name'])
|
||||||
print(song)
|
|
||||||
print(song['id'])
|
|
||||||
url_best = get_mp3_link(song['id'])
|
url_best = get_mp3_link(song['id'])
|
||||||
print(url_best)
|
|
||||||
# songNet = 'p' + song['mp3Url'].split('/')[2][1:]
|
# songNet = 'p' + song['mp3Url'].split('/')[2][1:]
|
||||||
|
|
||||||
# if 'hMusic' in song and song['hMusic'] != None:
|
# if 'hMusic' in song and song['hMusic'] != None:
|
||||||
|
Loading…
Reference in New Issue
Block a user