s = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(s);
<?php
function handle_url($url) {
$file = 'result.txt';
$long_url = urlencode($url);
$api_token = '0123456789';
$api_url = "https://mysite.com/api?api={$api_token}&url={$long_url}";
$result = file_get_contents($api_url);
if ($result) {
echo $result;
}
file_put_contents($file, $long_url . PHP_EOL, FILE_APPEND);
file_put_contents($file, $result . PHP_EOL, FILE_APPEND);
sleep(1);
}
$file = fopen('mylink.txt', 'r');
if ($file) {
while (($line = fgets($file)) !== false) {
handle_url($line);
}
fseek($file, 0);
}
?>
$appsession = Get-Content -Path .\appsession.txt
1..(Get-Content -Path .\url.txt | measure).Count | ForEach-Object {
$url = (Get-Content -Path .\url.txt)[$_-1];
$token = (Get-Content -Path .\token.txt)[$_-1]
$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
$session.Cookies.Add((New-Object System.Net.Cookie("AppSession", "$appsession", "/", "exe.io")))
$session.Cookies.Add((New-Object System.Net.Cookie("csrfToken", "c7d46cce802f956bde8762f34b65daa4fbcf6d6abdfe555b880fb10f9c114c8e4c23c2bd6934cb3", "/", "exe.io")))
Invoke-WebRequest -UseBasicParsing -Uri "$url" `
-Method POST `
-WebSession $session `
-Headers @{
"Accept-Encoding" = "gzip, deflate, br"
"Upgrade-Insecure-Requests" = "1"
"Sec-Fetch-Dest" = "document"
"Sec-Fetch-Mode" = "navigate"
"Sec-Fetch-Site" = "same-origin"
"Sec-Fetch-User" = "?1"
"TE" = "trailers"
} `
-Body "_method=POST&_csrfToken=c7d46cce802f956bde8762f34b65daa4fbcf6d6abdfe555b880fb10f9c114c8e4c23c2bd6934cb3&_Token%5Bfields%5D=$token&_Token%5Bunlocked%5D=adcopy_challenge%257Cadcopy_response%257Ccaptcha_code%257Ccaptcha_namespace%257Cg-recaptcha-response"
}