차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판이전 판다음 판 | 이전 판 | ||
tech:torrent [2014/08/30 10:39] – [토렌트 정보 긁기] fe80:4852:64df:b1dd:fe73:ca34:7c28:eae5 | tech:torrent [2018/10/17 22:07] (현재) – [공개 트래커] V_L | ||
---|---|---|---|
줄 1: | 줄 1: | ||
+ | {{tag> torrent p2p 토렌트 유토렌트 utorrent}} | ||
======토렌트 (Torrent)====== | ======토렌트 (Torrent)====== | ||
줄 26: | 줄 27: | ||
=====국내===== | =====국내===== | ||
^ 이름 | ^ 이름 | ||
- | | [[http:// | + | | https:// |
- | | [[http:// | + | | [[http:// |
- | | [[http:// | + | | [[http:// |
- | | [[http:// | + | | [[http:// |
- | | [[http:// | + | | [[http:// |
+ | | [[http:// | ||
국내 토렌트 사이트 보기 : 한글 토렌트(torrent) 검색기 " | 국내 토렌트 사이트 보기 : 한글 토렌트(torrent) 검색기 " | ||
줄 39: | 줄 41: | ||
- | + | [[106]] 참고 | |
- | ^ 이름 | + | |
- | | [[http:// | + | |
- | | [[https:// | + | |
- | | [[http:// | + | |
- | | [[http:// | + | |
- | | [[http:// | + | |
- | | [[http:// | + | |
- | |[[http:// | + | |
- | |[[http:// | + | |
- | | [[http:// | + | |
- | |[[http:// | + | |
- | |[[http:// | + | |
- | |[[http:// | + | |
- | |[[http:// | + | |
- | |[[http:// | + | |
- | |[[http:// | + | |
- | |[[http:// | + | |
- | |[[http:// | + | |
- | |[[http:// | + | |
줄 64: | 줄 47: | ||
등록이 필요 없는 공개 트래커를 찾고 있다면, 아래의 주소중 한 곳을 사용하라: | 등록이 필요 없는 공개 트래커를 찾고 있다면, 아래의 주소중 한 곳을 사용하라: | ||
- | * http://open.tracker.thepiratebay.org/announce | + | < |
- | * http://www.torrent-downloads.to:2710/announce | + | udp://tracker.coppersurfer.tk:6969/announce |
- | * http://denis.stalker.h3q.com:6969/announce | + | udp://tracker.pirateparty.gr:6969/announce |
- | * http://www.sumotracker.com/announce | + | udp://tracker.coppersurfer.tk:6969 |
- | * http://pirates.sumotracker.com/announce | + | udp://9.rarbg.me:2710/announce |
- | * [[udp://open.demonii.com:1337]] | + | udp://public.popcorn-tracker.org:6969/announce |
- | * [[udp:// | + | udp://tracker.opentrackr.org:1337/announce |
- | * http:// | + | </file> |
줄 168: | 줄 152: | ||
<?php | <?php | ||
// 기본적으로 UTF-8 형식임. | // 기본적으로 UTF-8 형식임. | ||
+ | // 출처: http:// | ||
// Protect our namespace using a class | // Protect our namespace using a class | ||
class BDecode { | class BDecode { | ||
- | function numberdecode($wholefile, | + | |
- | // Funky handling of negative numbers and zero | + | // Funky handling of negative numbers and zero |
- | $negative = false; | + | $negative = false; |
- | if ($wholefile[$offset] == ' | + | if ($wholefile[$offset] == ' |
- | $negative = true; | + | $negative = true; |
- | $offset++; | + | $offset++; |
- | } | + | } |
- | if ($wholefile[$offset] == ' | + | if ($wholefile[$offset] == ' |
- | $offset++; | + | $offset++; |
- | if ($negative) | + | if ($negative) |
- | return array(false); | + | return array(false); |
- | if ($wholefile[$offset] == ':' | + | if ($wholefile[$offset] == ':' |
- | return array(0, ++$offset); | + | return array(0, ++$offset); |
- | return array(false); | + | return array(false); |
- | } | + | } |
- | $ret[0] = 0; | + | $ret[0] = 0; |
- | for(;;) { | + | for(;;) { |
- | if ($wholefile[$offset] >= ' | + | if ($wholefile[$offset] >= ' |
- | $ret[0] *= 10; | + | $ret[0] *= 10; |
- | //Added 2005.02.21 - VisiGod | + | //Added 2005.02.21 - VisiGod |
- | //Changing the type of variable from integer to double to prevent a numeric overflow | + | |
- | settype($ret[0],' | + | settype($ret[0],' |
- | //Added 2005.02.21 - VisiGod | + | //Added 2005.02.21 - VisiGod |
- | $ret[0] += ord($wholefile[$offset]) - ord(' | + | $ret[0] += ord($wholefile[$offset]) - ord(' |
- | $offset++; | + | $offset++; |
- | } else if ($wholefile[$offset] == ' | + | } else if ($wholefile[$offset] == ' |
- | // Tolerate : or e because this is a multiuse function | + | // Tolerate : or e because this is a multiuse function |
- | $ret[1] = $offset+1; | + | $ret[1] = $offset+1; |
- | if ($negative) { | + | if ($negative) { |
- | if ($ret[0] == 0) | + | if ($ret[0] == 0) |
- | return array(false); | + | return array(false); |
- | $ret[0] = - $ret[0]; | + | $ret[0] = - $ret[0]; |
- | } | + | } |
- | return $ret; | + | return $ret; |
- | } else return array(false); | + | } else return array(false); |
- | } | + | } |
- | } | + | } |
- | function decodeEntry($wholefile, | + | |
- | if ($wholefile[$offset] == ' | + | if ($wholefile[$offset] == ' |
- | return $this-> | + | return $this-> |
- | if ($wholefile[$offset] == ' | + | if ($wholefile[$offset] == ' |
- | return $this-> | + | return $this-> |
- | if ($wholefile[$offset] == ' | + | if ($wholefile[$offset] == ' |
- | return $this-> | + | return $this-> |
- | // String value: decode number, then grab substring | + | // String value: decode number, then grab substring |
- | $info = $this-> | + | |
- | if ($info[0] === false) | + | if ($info[0] === false) |
- | return array(false); | + | return array(false); |
- | $ret[0] = substr($wholefile, | + | $ret[0] = substr($wholefile, |
- | $ret[1] = $info[1]+strlen($ret[0]); | + | $ret[1] = $info[1]+strlen($ret[0]); |
- | return $ret; | + | return $ret; |
- | } | + | } |
- | function decodeList($wholefile, | + | |
- | if ($wholefile[$offset] != ' | + | if ($wholefile[$offset] != ' |
- | return array(false); | + | return array(false); |
- | $offset++; | + | $offset++; |
- | $ret = array(); | + | $ret = array(); |
- | for ($i=0;; | + | for ($i=0;; |
- | if ($wholefile[$offset] == ' | + | if ($wholefile[$offset] == ' |
- | break; | + | break; |
- | $value = $this-> | + | $value = $this-> |
- | if ($value[0] === false) | + | if ($value[0] === false) |
- | return array(false); | + | return array(false); |
- | $ret[$i] = $value[0]; | + | $ret[$i] = $value[0]; |
- | $offset = $value[1]; | + | $offset = $value[1]; |
- | } | + | } |
- | // The empty list is an empty array. Seems fine. | + | // The empty list is an empty array. Seems fine. |
- | return array(0=> | + | return array(0=> |
- | } | + | } |
- | // Tries to construct an array | + | |
- | function decodeDict($wholefile, | + | function decodeDict($wholefile, |
- | if ($wholefile[$offset] == ' | + | if ($wholefile[$offset] == ' |
- | return $this-> | + | return $this-> |
- | if ($wholefile[$offset] != ' | + | if ($wholefile[$offset] != ' |
- | return false; | + | return false; |
- | $ret=array(); | + | $ret=array(); |
- | $offset++; | + | $offset++; |
- | for (;;) { | + | for (;;) { |
- | if ($wholefile[$offset] == ' | + | if ($wholefile[$offset] == ' |
- | $offset++; | + | $offset++; |
- | break; | + | break; |
- | } | + | } |
- | $left = $this-> | + | $left = $this-> |
- | if (!$left[0]) | + | if (!$left[0]) |
- | return false; | + | return false; |
- | $offset = $left[1]; | + | $offset = $left[1]; |
- | if ($wholefile[$offset] == ' | + | if ($wholefile[$offset] == ' |
- | // Recurse | + | // Recurse |
- | $value = $this-> | + | $value = $this-> |
- | if (!$value[0]) | + | if (!$value[0]) |
- | return false; | + | return false; |
- | $ret[addslashes($left[0])] = $value[0]; | + | $ret[addslashes($left[0])] = $value[0]; |
- | $offset= $value[1]; | + | $offset= $value[1]; |
- | continue; | + | continue; |
- | } | + | } |
- | if ($wholefile[$offset] == ' | + | if ($wholefile[$offset] == ' |
- | $value = $this-> | + | $value = $this-> |
- | if (!$value[0] && is_bool($value[0])) | + | if (!$value[0] && is_bool($value[0])) |
- | return false; | + | return false; |
- | $ret[addslashes($left[0])] = $value[0]; | + | $ret[addslashes($left[0])] = $value[0]; |
- | $offset = $value[1]; | + | $offset = $value[1]; |
- | continue; | + | continue; |
- | } | + | } |
- | $value = $this-> | + | $value = $this-> |
- | if ($value[0] === false) | + | if ($value[0] === false) |
- | return false; | + | return false; |
- | $ret[addslashes($left[0])] = $value[0]; | + | $ret[addslashes($left[0])] = $value[0]; |
- | $offset = $value[1]; | + | $offset = $value[1]; |
- | } | + | } |
- | return array(0=> | + | return array(0=> |
- | } | + | } |
} // End of class declaration. | } // End of class declaration. | ||
// Use this function. eg: BDecode(" | // Use this function. eg: BDecode(" | ||
function BDecode($wholefile) { | function BDecode($wholefile) { | ||
- | $decoder = new BDecode; | + | |
- | $return = $decoder-> | + | $return = $decoder-> |
- | return $return[0]; | + | return $return[0]; |
} | } | ||
줄 298: | 줄 282: | ||
// using a class | // using a class | ||
class BEncode { | class BEncode { | ||
- | // Dictionary keys must be sorted. foreach tends to iterate over the order | + | |
- | // the array was made, so we make a new one in sorted order. :) | + | // the array was made, so we make a new one in sorted order. :) |
- | function makeSorted($array) { | + | function makeSorted($array) { |
- | // Shouldn' | + | // Shouldn' |
- | if (empty($array)) | + | if (empty($array)) |
- | return $array; | + | return $array; |
- | $i = 0; | + | $i = 0; |
- | foreach($array as $key => $dummy) | + | foreach($array as $key => $dummy) |
- | $keys[$i++] = stripslashes($key); | + | $keys[$i++] = stripslashes($key); |
- | sort($keys); | + | sort($keys); |
- | for ($i=0; isset($keys[$i]); | + | for ($i=0; isset($keys[$i]); |
- | $return[addslashes($keys[$i])] = $array[addslashes($keys[$i])]; | + | $return[addslashes($keys[$i])] = $array[addslashes($keys[$i])]; |
- | return $return; | + | return $return; |
- | } | + | } |
- | // Encodes strings, integers and empty dictionaries. | + | |
- | // $unstrip is set to true when decoding dictionary keys | + | // $unstrip is set to true when decoding dictionary keys |
- | function encodeEntry($entry, | + | function encodeEntry($entry, |
- | if (is_bool($entry)) { | + | if (is_bool($entry)) { |
- | $fd .= ' | + | $fd .= ' |
- | return; | + | return; |
- | } | + | } |
- | if (is_int($entry) || is_float($entry)) { | + | if (is_int($entry) || is_float($entry)) { |
- | $fd .= ' | + | $fd .= ' |
- | return; | + | return; |
- | } | + | } |
- | if ($unstrip) | + | if ($unstrip) |
- | $myentry = stripslashes($entry); | + | $myentry = stripslashes($entry); |
- | else | + | else |
- | $myentry = $entry; | + | $myentry = $entry; |
- | $length = strlen($myentry); | + | $length = strlen($myentry); |
- | $fd .= $length.':' | + | $fd .= $length.':' |
- | } | + | } |
- | // Encodes lists | + | |
- | function encodeList($array, | + | function encodeList($array, |
- | $fd .= ' | + | $fd .= ' |
- | // The empty list is defined as array(); | + | // The empty list is defined as array(); |
- | if (empty($array)) { | + | if (empty($array)) { |
- | $fd .= ' | + | $fd .= ' |
- | return; | + | return; |
- | } | + | } |
- | for ($i = 0; isset($array[$i]); | + | for ($i = 0; isset($array[$i]); |
- | $this-> | + | $this-> |
- | $fd .= ' | + | $fd .= ' |
- | } | + | } |
- | // Passes lists and dictionaries accordingly, | + | |
- | // the strings and integers. | + | // the strings and integers. |
- | function decideEncode($unknown, | + | function decideEncode($unknown, |
- | if (is_array($unknown)) { | + | if (is_array($unknown)) { |
- | if (isset($unknown[0]) || empty($unknown)) | + | if (isset($unknown[0]) || empty($unknown)) |
- | return $this-> | + | return $this-> |
- | else | + | else |
- | return $this-> | + | return $this-> |
- | } | + | } |
- | $this-> | + | $this-> |
- | } | + | } |
- | // Encodes dictionaries | + | |
- | function encodeDict($array, | + | function encodeDict($array, |
- | $fd .= ' | + | $fd .= ' |
- | if (is_bool($array)) { | + | if (is_bool($array)) { |
- | $fd .= ' | + | $fd .= ' |
- | return; | + | return; |
- | } | + | } |
- | // NEED TO SORT! | + | // NEED TO SORT! |
- | $newarray = $this-> | + | $newarray = $this-> |
- | foreach($newarray as $left => $right) { | + | foreach($newarray as $left => $right) { |
- | $this-> | + | $this-> |
- | $this-> | + | $this-> |
- | } | + | } |
- | $fd .= ' | + | $fd .= ' |
- | } | + | } |
} // End of class declaration. | } // End of class declaration. | ||
// Use this function in your own code. | // Use this function in your own code. | ||
function BEncode($array) { | function BEncode($array) { | ||
- | $string = ''; | + | |
- | $encoder = new BEncode; | + | $encoder = new BEncode; |
- | $encoder-> | + | $encoder-> |
- | return $string; | + | return $string; |
} | } | ||
$url = trim($_GET[url]); | $url = trim($_GET[url]); | ||
if ($url) { | if ($url) { | ||
- | $alltorrent = trim(Yreadfile($url, | + | |
} else exit; | } else exit; | ||
if ($alltorrent == "" | if ($alltorrent == "" | ||
줄 396: | 줄 380: | ||
$announce_list_cnt = count($array[$announce_list]); | $announce_list_cnt = count($array[$announce_list]); | ||
for ($i=0;$i < $announce_list_cnt; | for ($i=0;$i < $announce_list_cnt; | ||
- | echo $array[$announce_list][$i][0]; | + | |
- | if ($i < $announce_list_cnt-1) | + | if ($i < $announce_list_cnt-1) |
- | echo ", "; | + | echo ", "; |
- | else | + | else |
- | echo "< | + | echo "< |
} | } | ||
줄 410: | 줄 394: | ||
$info_files_cnt = count($array[info][files]); | $info_files_cnt = count($array[info][files]); | ||
for ($i=0;$i < $info_files_cnt; | for ($i=0;$i < $info_files_cnt; | ||
- | $info_file_path_cnt = count($array[info][files][$i][path]); | + | |
- | $file_cnt++; | + | $file_cnt++; |
- | echo $file_cnt.": | + | echo $file_cnt.": |
- | for ($j=0;$j < $info_file_path_cnt; | + | for ($j=0;$j < $info_file_path_cnt; |
- | echo $array[info][files][$i][path][$j]; | + | echo $array[info][files][$i][path][$j]; |
- | if ($j < $info_file_path_cnt-1) echo "/"; | + | if ($j < $info_file_path_cnt-1) echo "/"; |
- | echo " (" | + | echo " (" |
- | } | + | } |
- | echo "< | + | echo "< |
} | } | ||
- | |||
/* | /* | ||
- | | + | |
*/ | */ | ||
- | //변수가 정의 되었으면 해당 값을 반환하고 정의 되어있지 않으면 지정된 기본값을 반환합니다. | + | //변수가 정의 되었으면 해당 값을 반환하고 정의 되어있지 않으면 지정된 기본값을 반환한다. |
function Yvar_check(& | function Yvar_check(& | ||
- | return (isset($var)) ? $var : $return; | + | |
} | } | ||
- | //변수가 정의되지 않았거나 값이 NULL값 이거나, 값이 0, false 일경우 지정된 기본값을 반환합니다. | + | //변수가 정의되지 않았거나 값이 NULL값 이거나, 값이 0, false 일경우 지정된 기본값을 반환한다. |
function Yvar_empty_check(& | function Yvar_empty_check(& | ||
- | return (!empty($var)) ? $var : $return; | + | |
} | } | ||
//http, GET 방식의 소켓연결 | //http, GET 방식의 소켓연결 | ||
function Ysockopen($url, | function Ysockopen($url, | ||
- | if (!empty($url) && preg_match(" | + | |
- | $array = parse_url($url); | + | |
- | $url_scheme = Yvar_check($array[' | + | $url_scheme = Yvar_check($array[' |
- | $url_server = Yvar_check($array[' | + | $url_server = Yvar_check($array[' |
- | $url_path = Yvar_check($array[' | + | $url_path = Yvar_check($array[' |
- | $url_query= Yvar_check($array[' | + | $url_query= Yvar_check($array[' |
- | $url_port = Yvar_empty_check($array[' | + | $url_port = Yvar_empty_check($array[' |
- | + | ||
- | $fp = @fsockopen($url_server, | + | |
- | if (empty($fp)) { | + | |
- | return '' | + | |
- | } | + | |
- | fputs($fp, | + | |
- | if (!empty($accept)) fputs($fp, " | + | |
- | if (!empty($contenttype)) fputs($fp, " | + | } |
- | fputs($fp, | + | |
- | if (!empty($referer)) fputs($fp, " | + | |
- | if (!empty($cachecontrol)) fputs($fp, " | + | |
- | if (!empty($pragma)) fputs($fp, " | + | |
- | if (!empty($connection)) fputs($fp, " | + | |
- | return $fp; | + | fputs($fp, "GET " . $url_path . "?" |
- | } else { | + | if (!empty($accept)) fputs($fp, " |
- | return ''; | + | if (!empty($contenttype)) fputs($fp, " |
- | } | + | fputs($fp, "Host: $url_server: |
+ | if (!empty($referer)) fputs($fp, " | ||
+ | if (!empty($cachecontrol)) fputs($fp, " | ||
+ | if (!empty($pragma)) fputs($fp, " | ||
+ | if (!empty($connection)) fputs($fp, " | ||
+ | |||
+ | | ||
+ | } else { | ||
+ | return ''; | ||
+ | } | ||
} | } | ||
function Ysockclose(& | function Ysockclose(& | ||
- | if (!empty($fp)) fclose($fp); | + | |
- | return true; | + | return true; |
} | } | ||
// | // | ||
function Yreadfile($url, | function Yreadfile($url, | ||
- | $fp = Ysockopen($url, | + | |
- | if (!empty($fp)) { | + | if (!empty($fp)) { |
- | $text = ''; | + | $text = ''; |
- | $check_header = false; | + | $check_header = false; |
- | while (!feof($fp)){ | + | while (!feof($fp)){ |
- | $temp = fgets($fp, 1024); | + | $temp = fgets($fp, 1024); |
- | if ($check_header == false){ | + | if ($check_header == false){ |
- | //실제 파일이 아닌 헤더 정보인지 체크 하여 추가하지 않는다. | + | //실제 파일이 아닌 헤더 정보인지 체크 하여 추가하지 않는다. |
- | if (preg_match("' | + | if (preg_match("' |
- | $check_header = true; | + | $check_header = true; |
- | continue; | + | continue; |
- | } | + | } |
- | } else{ | + | } else{ |
- | //헤더 정보가 아닌 경우에만 추가한다. | + | //헤더 정보가 아닌 경우에만 추가한다. |
- | $text .= $temp; | + | $text .= $temp; |
- | } | + | } |
- | } | + | } |
- | Ysockclose($fp); | + | Ysockclose($fp); |
- | return $text; | + | return $text; |
- | } else { | + | } else { |
- | return ''; | + | return ''; |
- | } | + | } |
} | } | ||
줄 501: | 줄 484: | ||
</ | </ | ||
- | {{tag> torrent p2p 토렌트 유토렌트 utorrent}} | + |