Today xiaobian with you to use Python to climb netease cloud music, minutes will be on the site of music down to the local.
Follow xiaobian run code bozos will netease cloud lyrics grab down is no longer the words, when the capture of lyrics in the function into the singer ID and song name two parameters, in fact, the song is the same truth, also need to pass in these two parameters, but netease cloud song URL can not be found in general. But don’t panic, there are xiaobian in a minute to clean up your troubles.
Netease Cloud songs generally have an external chain, specially used for downloading music and audio. Take Zhao Lei’s song “Chengdu” as an example, the external chain URL of “Chengdu” is:
http://music.163.com/song/media/outer/url?id=436514312.mp3, of which 436514312 the figure was “chengdu” the song of the ID. This means that if we pass the song ID into the external URL, we can find the download address of the song, and then download it through the Python standard library.
Without further ado, go directly to the code:
How to use Python web crawler to crawl netease Cloud Music songs
After the program is designed, run the program and enter the singer’s ID. Take Zhao Lei as an example, his ID is 6731. After entering this ID value, the program will automatically download zhao Lei’s album songs and their corresponding lyrics to the local, as shown in the following effect picture:
How to use Python web crawler to crawl netease Cloud Music songs
After the program is run, the lyrics and songs are all down to the local, as shown below:
How to use Python web crawler to crawl netease Cloud Music songs
Elegant songs like “Chengdu” can then be heard locally, as shown below:
How to use Python web crawler to crawl netease Cloud Music songs
If you want to listen to songs in the future, just run this crawler, enter the ID of your favorite artist, wait a moment, and you can listen to the songs you want ~ 100,000 songs, as many as you like
Finally xiaobian wishes everyone good health, smooth work ~~ welcome to reprint oh
Today this program complete code screenshot can refer to the xiaobi shared based on Python netease cloud music lyrics climb article, combined with today’s code, can be achieved ~~~