转发使用代理

This commit is contained in:
work
2026-04-09 08:27:16 +08:00
parent d4b704b63b
commit 97c877f27c

View File

@@ -1212,9 +1212,19 @@ def playwright_share(cookies, target_url, content):
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()