import requests
from bs4 import BeautifulSoup
import urllib.request
import re
import os
headers = {
'Referer': 'http://music.163.com/',
'Host': 'music.163.com',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
}
url = 'https://music.163.com/discover/playlist/'
base_url = 'https://music.163.com'
save_path = 'D:\\Download\\music\\wangyiyun\\'
def get_song(music,saveurl):
try:
musicUrl = 'http://music.163.com/song/media/outer/url' + music[0][5:] + '.mp3'
name = music[1]
if(not os.path.exists(saveurl+"\\"+music[1] + '%s.mp3')):
urllib.request
Python 爬取网易云音乐
最新推荐文章于 2024-09-28 16:16:51 发布