昨天我試圖用 perl 和 itorrents api 撰寫一個示例腳本,我正在使用 perl IDE Padre。基本上,這個腳本將資料發送到服務器(itorrents)這里是 api 的鏈接:itorrents.org/automation 我復制并粘貼了網站給我的代碼,但它不作業!我用 windows cmd 安裝了這個 perl 模塊:
cpan App:cpanminus
cpanm MIME::Base64
cpanm MIME::Parser
cpanm MIME::Tools
cpanm Test::XML
cpanm SOAP::Lite
cpanm SOAP::WSDL
這是我的腳本(caching.pl):
#!/usr/bin/perl
use MIME::Base64 ();
use SOAP::Lite ();
open( FILE, 'my.torrent' ) or die "$!";
while( read( FILE, $buf, 60*57 ) ) { $tor .= MIME::Base64::encode( $buf ); }
close( FILE );
$infoHash = SOAP::Lite->service( 'http://itorrents.org/api/torrage.wsdl' )->cacheTorrent( $tor );
print $infoHash;
在此先感謝,我的語言不流利,抱歉。編輯:對不起,我忘記發布錯誤行:
Service description 'http://itorrents.org/api/torrage.wsdl' can't be loaded: 500 Can't connect to itorrents.org:443
uj5u.com熱心網友回復:
解決了 !我解決了它從http://itorrents.org/api/torrage.wsdl下載 torrage.wsdl 檔案并替換了這一行:
$infoHash = SOAP::Lite->service( 'http://itorrents.org/api/torrage.wsdl' )->cacheTorrent( $tor );
使用此行(將網站 URL 替換為下載的檔案 torrage.wsdl 路徑):
$infoHash = SOAP::Lite->service( 'C:\Users\sussq\Desktop\perl\torrage.wsdl' )->cacheTorrent( $tor );
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/420223.html
標籤:
上一篇:Perl和Catalyst:從模型訪問maketext
下一篇:使用fetch上傳多個檔案
