import requests
headers = {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-language": "zh-CN,zh;q=0.9",
"cache-control": "no-cache",
"pragma": "no-cache",
"priority": "u=0, i",
"referer": "https://xn---jfgdizhi-at-gmail-com-pe92bk82e4g1pmbse.www-jfgsou-com.com/search.php?k=B5Vt3CkBgs3beFwmKholzg%3D%3D",
"sec-ch-ua": "\"Google Chrome\";v=\"129\", \"Not=A?Brand\";v=\"8\", \"Chromium\";v=\"129\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "same-origin",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
}
url = "aHR0cHM6Ly94bi0tLWpmZ2RpemhpLWF0LWdtYWlsLWNvbS1wZTkyYms4MmU0ZzFwbWJzZS53d3ctamZnc291LWNvbS5jb20vY29udGVudC8wYWY0YzQxMWFlMmZmMjJlZDdkMzE1OTgyYzg3YTgwYi5odG1s"
response = requests.get(url, headers=headers)
html=etree.HTML(response.text)
href=html.xpath('//a/@playdata')[-1]
print(href)
标签:py,m3u8,com,cache,spider,sec,requests,ua,fetch
From: https://www.cnblogs.com/xiaohai123/p/18684509