2016-06-13 72 views
2

我需要獲得給定.torrent的播種機和leechers的數量。 比方說this one(這是目前一個非常流行的洪流,它肯定有萬噸播種機和leechers)Scratch multitracker torrent php

我Bdecoded torrent文件,並得到了宣佈:

$announces = array("udp://tracker.opentrackr.org:1337/announce", 
"udp://tracker.coppersurfer.tk:6969/announce", 
"udp://tracker.openbittorrent.com:80/announce", 
"udp://glotorrents.pw:6969/announce", 
"udp://tracker.leechers-paradise.org:6969/announce", 
"udp://zer0day.ch:1337/announce", 
"udp://9.rarbg.me:2710/announce", 
"udp://tracker.trackerfix.com:80/announce", 
"udp://eddie4.nl:6969/announce", 
"udp://9.rarbg.to:2710/announce"); 

以及hash_info = 「0ddf5052c1c580a129598186e05c494f45727881」;

然後我更換「UDP」以「http」和「宣佈」與「刮」,併發送與洪流散列這樣的捲曲GET請求:

foreach($announces as $announce){ 
$scrape_url = str_ireplace(array('udp://', '/announce'), array('http://', '/scrape'), $announce).pack('H*',"0ddf5052c1c580a129598186e05c494f45727881"); 
echo file_get_contents($scrape_url)."<hr>"; 
} 

但是唯一我得到的是「連接拒絕「,」操作超時「和」HTTP請求失敗!HTTP/1.1 404 Not Found「。我究竟做錯了什麼?捲曲給出了相同的結果順便說一句。

+0

可能是因爲UDP == HTTP? – Gogol

+1

謝謝,實際上有幫助! –

回答