import os
def download_song_with_youget(url):
song_id = url.split(‘id=’)[1]
command = f’you-get https://music.163.com/song?id={song_id}’
os.system(command)
print(f"歌曲下载完成(假设下载成功,如果未成功可能需要检查 you-get 是否正确安装及网页资源是否可访问)。")
webpage_url = “https://music.163.com/#/song?id=1895377452”
download_song_with_youget(webpage_url)
爬虫爬取歌曲的组件
pip install you-get