mirror of
https://github.com/soimort/you-get.git
synced 2025-01-24 22:15:03 +03:00
Merge pull request #1956 from rosynirvana/ximalaya
[Ximalaya] fix #1955
This commit is contained in:
commit
ded1d221b9
@ -15,7 +15,8 @@ stream_types = [
|
|||||||
|
|
||||||
def ximalaya_download_by_id(id, title = None, output_dir = '.', info_only = False, stream_id = None):
|
def ximalaya_download_by_id(id, title = None, output_dir = '.', info_only = False, stream_id = None):
|
||||||
BASE_URL = 'http://www.ximalaya.com/tracks/'
|
BASE_URL = 'http://www.ximalaya.com/tracks/'
|
||||||
json_data = json.loads(get_content(BASE_URL + id + '.json'))
|
json_url = BASE_URL + id + '.json'
|
||||||
|
json_data = json.loads(get_content(json_url, headers=fake_headers))
|
||||||
if 'res' in json_data:
|
if 'res' in json_data:
|
||||||
if json_data['res'] == False:
|
if json_data['res'] == False:
|
||||||
raise ValueError('Server reported id %s is invalid' % id)
|
raise ValueError('Server reported id %s is invalid' % id)
|
||||||
|
Loading…
Reference in New Issue
Block a user