|
@@ -89,6 +89,8 @@ class Dy_KS:
|
|
|
}
|
|
|
response = requests.request(url=url, method='GET', headers=headers, allow_redirects=False, timeout= 30)
|
|
|
location = response.headers.get('Location', None)
|
|
|
+ if location == "https://kuaishou.com/":
|
|
|
+ return "作品不存在", None, None
|
|
|
video_id = re.search(r'/(f|photo|short-video|long-video)/(.*)/?',
|
|
|
location.split('?')[0] if location else url).group(2)
|
|
|
url = "http://8.217.192.46:8889/crawler/kuai_shou/detail"
|
|
@@ -174,9 +176,9 @@ class Dy_KS:
|
|
|
msg = html.unescape(url)
|
|
|
pattern = re.search(r'https?://(?:[-\w.]|(?:%[\da-fA-F]{2}))+(/[-\w._~:/#[\]@!$&()*+,;=]*)', msg)
|
|
|
logger.info(f"[+] pattern == {pattern}")
|
|
|
- if pattern is None:
|
|
|
- logger.error(f"[+] {url} 提取 url失败")
|
|
|
- return "重新处理",None,None,None
|
|
|
+ # if pattern is None:
|
|
|
+ # logger.error(f"[+] {url} 提取 url失败")
|
|
|
+ # return "重新处理",None,None,None
|
|
|
url = pattern.group()
|
|
|
host = urlparse(url).netloc
|
|
|
logger.info(f"[+] url == {url} host=={host}")
|