From c235f21a0c98f791413798d6a9797ff71f2e5446 Mon Sep 17 00:00:00 2001 From: work Date: Fri, 6 Feb 2026 23:25:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A7=86=E9=A2=91=E5=8F=91?= =?UTF-8?q?=E5=B8=96=E7=9A=84=E9=93=BE=E6=8E=A5=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spider/task.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/spider/task.py b/spider/task.py index e358f63..f198f92 100644 --- a/spider/task.py +++ b/spider/task.py @@ -425,10 +425,12 @@ def retry_get_new_video(page, cookies, post_count): # 点击 element.click() - - page.reload(timeout=180000) - time.sleep(random.randint(3, 5)) - return page.url + time.sleep(random.randint(3, 5)) + page.reload(timeout=180000) + time.sleep(random.randint(3, 5)) + return page.url + else: + raise OperationFailed(f"未找到视频") except Exception as e: raise OperationFailed(f"点击视频时出错: {e}") @@ -1174,8 +1176,9 @@ def playwright_share(cookies, target_url, content): if __name__ == '__main__': - cookies = {"c_user": "61587089832795", "datr": "aN5-aZxlIs_oAlMTY-3CMwOc", "oo": "v13:1769922152", - "xs": "15:n1l7-jQRvQ2mnA:2:1769922167:-1:-1"} + cookies = {"c_user": "61586691112744", "datr": "x7RlaTfklMAipmTap0H-7nIJ", + "fr": "0AB4Vv4Fl2leQGqcZ.AWf1yFAlbD8_IkjaAswZ0rZ8KLaM2ELh0vshWJCkjppACGrDpAo.BpZbTH..AAA.0.0.BpZbTH.AWejCYSR2Y79SHGGylQG2W9Z13Q", + "xs": "46:KikpyN0DGapBAw:2:1768273104:-1:-1"} # print(playwright_set_user_profile(cookies, "61584735094876", "Inaaya", "Inaaya", # "facebook/user_upload/0196f098-851c-7810-b2aa-0833a0a7b09d/8c428558-2d90-4f45-baa3-a25f8a654b5c.png")) # cookies = '{"locale": "en_US", "datr": "ZnGnaBBx0yN7pov19-8_A6Gr", "sb": "ZnGnaDQicDSsVuevkudqio1J", "m_pixel_ratio": "1", "wd": "1920x1080", "test_cookie": "CheckForPermission", "c_user": "61579364283503", "xs": "34%3AdWeZoaWzFrtdVQ%3A2%3A1755804022%3A-1%3A-1", "oo": "v1%7C3%3A1755804031"}' @@ -1188,7 +1191,7 @@ if __name__ == '__main__': # like(cookies, 'ZmVlZGJhY2s6MTIyMTA5NjE0NjU0NzkzNzc5') # comment(cookies, 'ZmVlZGJhY2s6MTIyMTA5NjE0NjU0NzkzNzc5', 'game la', 'xzpq.mp4') # playwright_like(cookies, 'https://www.facebook.com/watch/?v=1007800324567828') - print(playwright_post(cookies, '1111')) + print(playwright_post(cookies, '1111', image_key="1.mp4")) # playwright_post(cookies, '2025-3-26~like', "") # playwright_comment( # cookies,