点赞使用代理

This commit is contained in:
work
2026-04-08 14:31:08 +08:00
parent 37f71e3a16
commit 7bbaf8499d

View File

@@ -299,10 +299,19 @@ def playwright_like(cookies, target_url):
with lock: with lock:
with sync_playwright() as playwright: with sync_playwright() as playwright:
update_windows_distinguish() update_windows_distinguish()
username = 'moremore_51WM1'
password = 'TOv5y0nXCZH_JH+5'
country = 'US'
browser = playwright.chromium.launch( browser = playwright.chromium.launch(
headless=False, args=['--start-maximized'], executable_path=path headless=False, args=['--start-maximized'], executable_path=path,
proxy={
"server": "http://pr.oxylabs.io:7777", # 必填
"username": f"customer-{username}-cc-{country}",
"password": password
}
) )
context = browser.new_context(no_viewport=True) context = browser.new_context(no_viewport=True)
context.add_cookies(parse_cookies(cookies)) context.add_cookies(parse_cookies(cookies))
page = context.new_page() page = context.new_page()