Files
html/api/blade-tasks/ds_cookie_selenium.json
2026-04-12 22:57:03 +02:00

10 lines
1.7 KiB
JSON

{
"type": "powershell",
"priority": "P0",
"action": "selenium_deepseek_cookie",
"description": "Use Selenium with existing Chrome profile to extract DeepSeek cookie",
"script": "try { Add-Type -AssemblyName System.Net.Http; $chromeArgs = \"--headless --disable-gpu --user-data-dir=$env:LOCALAPPDATA\Google\Chrome\User Data --profile-directory=Default --dump-dom https://chat.deepseek.com\"; $p = Start-Process -FilePath \"chrome.exe\" -ArgumentList \"--headless --disable-gpu --remote-debugging-port=9223 --user-data-dir=$($env:LOCALAPPDATA)\Google\Chrome\User Data\" -PassThru; Start-Sleep 5; $r = Invoke-WebRequest -Uri \"http://localhost:9223/json\" -UseBasicParsing; $pages = $r.Content | ConvertFrom-Json; $wsUrl = ($pages | Where-Object { $_.url -like *deepseek* }).webSocketDebuggerUrl; if (-not $wsUrl) { $nav = Invoke-WebRequest -Uri \"http://localhost:9223/json/new?https://chat.deepseek.com\" -UseBasicParsing -Method PUT; Start-Sleep 3; $r2 = Invoke-WebRequest -Uri \"http://localhost:9223/json\" -UseBasicParsing; $pages2 = $r2.Content | ConvertFrom-Json; $tgt = ($pages2 | Where-Object { $_.url -like *deepseek* })[0] }; $cookieUrl = \"http://localhost:9223/json/version\"; Start-Sleep 2; $cookies = Invoke-WebRequest -Uri \"http://localhost:9223/json\" -UseBasicParsing; $client = New-Object System.Net.Http.HttpClient; $body = New-Object System.Net.Http.StringContent({"action":"set_ds_token","token":"ds_session_from_blade"}, [System.Text.Encoding]::UTF8, application/json); $result = $client.PostAsync(https://weval-consulting.com/api/wevia-deepseek-proxy.php, $body).Result; Write-Output \"DONE: $($result.StatusCode)\"; Stop-Process $p } catch { Write-Output \"ERR: $_\" }",
"ts": "2026-04-12T01:02:00+00:00",
"timeout": 60
}