24 lines
701 B
Python
24 lines
701 B
Python
# 梨视频
|
|
'''
|
|
1.拿到contID
|
|
2.拿到videoStatus返回的json. -> srvURL
|
|
3.srcURL里面的内容修整
|
|
4.下载视频
|
|
'''
|
|
import requests
|
|
|
|
url = 'https://www.pearvideo.com/video_1718165'
|
|
contID = url.split("_")[1] # 通过_切割,http...是【0】,109...是【1】
|
|
|
|
videoStatusURL = f"https://www.pearvideo.com/videoStatus.jsp?contId={contID}&mrd=0.26596909307424266"
|
|
|
|
header = {
|
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.35',
|
|
# 防盗链: 溯源,当前请求的上一级是谁
|
|
'Referer': url
|
|
}
|
|
resp = requests.get(videoStatusURL, headers=header)
|
|
print(resp.text)
|
|
|
|
resp.close()
|