Perl coders
Posted: Mon Aug 21, 2023 12:18 am
Do we have anyone in here that codes in perl?
Code: Select all
HTTP/1.1 405 Method Not Allowed
connection: keep-alive
content-length: 18
content-security-policy: default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline'; object-src 'none'; form-action 'self'; frame-ancestors 'self';
content-type: text/plain; charset=UTF-8
date: Tue, 12 Sep 2023 14:25:20 GMT
referrer-policy: same-origin
set-cookie: SID=FXrLrSbj/fUkQSslURGk8VsY+kWpEkQe; HttpOnly; path=/; SameSite=Strict
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
Method Not Allowed
You can always use ChatGPT. If you know basic programming, it can help you a lot with any language.
Code: Select all
sub qbt_auth {
my ($api , $do) = @_;
my $url = $host.=$port.=$api.=$do;
d "\t$url";
my @headers = $referrer;
my $response_body = "$0_response_body";
open( RESPONSE, "> $response_body" );
my $easy = Net::Curl::Easy->new();
$easy->setopt( CURLOPT_VERBOSE, 1 );#, CURLOPT_DEBUGFUNCTION );
$easy->setopt( CURLOPT_USERAGENT, "MyBrowser_$0" );
$easy->setopt( CURLOPT_URL, "$url" );
$easy->setopt( CURLOPT_COOKIEFILE, "$cookie" ); # enable cookie session
$easy->setopt( CURLOPT_COOKIEJAR, "$cookie" );
$easy->setopt( CURLOPT_WRITEDATA, *RESPONSE);
$easy->setopt( CURLOPT_HTTPHEADER, \@headers);
$easy->setopt( CURLOPT_HEADERDATA, *RESPONSE );
my $ret_code = $easy->perform();
# Looking at the results...
if ($ret_code == 0) {
say "\nTransfer went ok\n";
my $response_code = $easy->getinfo(CURLINFO_HTTP_CODE);
# judge result and next action based on $response_code
say "Received response: $response_body\n";
} else {
# Error code, type of error, error message
say "An error happened: $ret_code ".
$easy->strerror($ret_code)." ".$easy->errbuf."\n";
}
}
Code: Select all
curl -K curl_info
Code: Select all
-i
-A "Qbt_curl"
-b "curl_cookies.txt"
header "Referer: http://localhost:8080"
url "http://localhost:8080/api/v2/torrents/info"
libcurl info.c
Code: Select all
-i
-A "Qbt_curl"
-b "curl_cookies.txt"
header "Referer: http://127.0.0.1:8080"
header "Content-Type: multipart/form-data"
form "name=torrents"
form "[email protected]"
form "savepath=testing"
form "root_folder=false"
form "autoTMM=false"
form "paused=true"
form "firstLastPiecePrio=true"
url "http://127.0.0.1:8080/api/v2/torrents/add"
libcurl add_torrent.c