[Python] 纯文本查看 复制代码
import time
import requests
def testurl(xxx,yyy):
id1 = str(xxx)
id2 = str(yyy)
url = f"https://v6.kokojia.com/video/2022/04/06/{id1}/https_kokojia_{id2}.m3u8"
headers = {
"accept": "*/*",
"accept-language": "zh-CN,zh;q=0.9",
"cache-control": "no-cache",
"pragma": "no-cache",
"sec-ch-ua": '"Not.A/Brand";v="8", "Chromium";v="114"',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-site",
"referrer":"https://www.kokojia.com/python/video157269-6892.html"
}
response = requests.get(url, headers=headers)
return response.status_code
if __name__ == '__main__':
for xxx in range(154403,155403):
for yyy in range(99,1000,1):
print(xxx," ",yyy)
status = testurl(xxx,yyy)
if status==200:
print(xxx,yyy,status)
with open("text.txt","a+",encoding='utf-8')as f:
f.write(str(xxx)+" "+str(yyy)+" "+str(status)+" "+'\n')
break