Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大神你好,FM的下载均报错 #1

Open
yangzhengpk opened this issue Jan 13, 2019 · 2 comments
Open

大神你好,FM的下载均报错 #1

yangzhengpk opened this issue Jan 13, 2019 · 2 comments

Comments

@yangzhengpk
Copy link

需要给宝宝下载一些喜马拉雅和荔枝FM上的故事,用了您的这个python脚本,网站歌曲测试没问题,但这两个fm网站下载均报错,即便是用了您实例的地址都不行。

@yangzhengpk
Copy link
Author

附上报错信息

Traceback (most recent call last):
File "I:/python/API_Music_Download-master/Spiders/main.py", line 103, in
main(url)
File "I:/python/API_Music_Download-master/Spiders/main.py", line 88, in main
print('此音乐下载地址为:' + get_music_ximalayafm(url))
File "I:\python\API_Music_Download-master\Spiders\API_music_ximalayaFM.py", line 22, in get_music_ximalayafm
mp3_url = html['data']['tracksForAudioPlay'][0]['src']
IndexError: list index out of range

@yangzhengpk
Copy link
Author

研究了下喜马拉雅FM的代码,发现可能是喜马拉雅在这三个月做了接口改版,悄悄在ID后面加了个空格,只要去除获取地址的空格即可拿到json数据。id = url.rsplit('/', 1)[1].strip()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant