爬电影
获取的是电影的种子,将这个链接发给迅雷,可以直接下载
import json
import re
import requests
def parse_page(html):
patters = re.compile('var downurls="福.*?mp4$(.*?)/#"', re.S)
patter = re.findall(patters, html)
print(patter)
# 取页面HTML
def get_one_page(url):
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b13pre) Gecko/20110307 Firefox/4.0b13pre"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
text = response.content.decode('utf-8')
return text
return None
def main():
url = "https://www.mkv99.com/vod-detail-id-12479.html"
html = get_one_page(url)
movie = parse_page(html)
if __name__ == '__main__':
main()