|
@@ -91,8 +91,17 @@ class Dy_KS:
|
|
|
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)
|
|
|
+ # video_id = re.search(r'/(f|photo|short-video|long-video)/(.*)/?',
|
|
|
+ # location.split('?')[0] if location else url).group(2)
|
|
|
+ match = re.search(r'/(f|photo|short-video|long-video)/(.*)/?',
|
|
|
+ location.split('?')[0] if location else url)
|
|
|
+ if match:
|
|
|
+ video_id = match.group(2)
|
|
|
+ else:
|
|
|
+ parts = url.rstrip('/').split('/')
|
|
|
+ if parts:
|
|
|
+ video_id = parts[-1]
|
|
|
+ logger.info(f"[+]提取到的视频ID=={video_id}")
|
|
|
url = "http://8.217.192.46:8889/crawler/kuai_shou/detail"
|
|
|
if not video_id or not video_id.strip():
|
|
|
return None, None, None
|
|
@@ -186,7 +195,7 @@ class Dy_KS:
|
|
|
tag_transport_channel = "抖音"
|
|
|
logger.info(f"[+] {url}开始获取抖音视频链接")
|
|
|
url, original_title, video_id = cls.get_text_dy_video(url=url)
|
|
|
- elif host in ['v.kuaishou.com', 'www.kuaishou.com', 'v.m.chenzhongtech.com', 'creater.eozatvmq.com']:
|
|
|
+ elif host in ['v.kuaishou.com', 'www.kuaishou.com', 'v.m.chenzhongtech.com', 'creater.eozatvmq.com','live.kuaishou.com']:
|
|
|
tag_transport_channel = "快手"
|
|
|
logger.info(f"[+] {url}开始获取快手视频链接")
|
|
|
url, original_title, video_id = cls.get_text_ks_video(url=url)
|