mirror of
https://github.com/letian1650/N3RD.git
synced 2025-01-25 04:05:17 +08:00
22 lines
603 B
Python
22 lines
603 B
Python
import requests
|
|
import re
|
|
|
|
|
|
class kuaishou:
|
|
def __init__(self, url):
|
|
self.url = url
|
|
self.headers = {
|
|
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Mobile Safari/537.36",
|
|
"Referer": self.url
|
|
}
|
|
|
|
def start(self):
|
|
json_data = requests.get(self.url, headers=self.headers, allow_redirects=True).text
|
|
res = re.findall('type="video/mp4" src="(.*?)"', json_data)[0]
|
|
print(res)
|
|
return res
|
|
|
|
|
|
if __name__ == '__main__':
|
|
kuaishou().start()
|