차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판이전 판다음 판 | 이전 판 | ||
| tech:torrent [2014/08/30 01:29] – [토렌트 (Torrent)] fe80:4852:64df:b1dd:fe73:ca34:7c28:eae5 | tech:torrent [2018/10/17 13: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> |
| 줄 162: | 줄 146: | ||
| } | } | ||
| }</ | }</ | ||
| + | |||
| + | ====토렌트 정보 긁기==== | ||
| + | |||
| + | <file php torrent.php> | ||
| + | <?php | ||
| + | // 기본적으로 UTF-8 형식임. | ||
| + | // 출처: http:// | ||
| + | // Protect our namespace using a class | ||
| + | class BDecode { | ||
| + | function numberdecode($wholefile, | ||
| + | // Funky handling of negative numbers and zero | ||
| + | $negative = false; | ||
| + | if ($wholefile[$offset] == ' | ||
| + | $negative = true; | ||
| + | $offset++; | ||
| + | } | ||
| + | if ($wholefile[$offset] == ' | ||
| + | $offset++; | ||
| + | if ($negative) | ||
| + | return array(false); | ||
| + | if ($wholefile[$offset] == ':' | ||
| + | return array(0, ++$offset); | ||
| + | return array(false); | ||
| + | } | ||
| + | $ret[0] = 0; | ||
| + | for(;;) { | ||
| + | if ($wholefile[$offset] >= ' | ||
| + | $ret[0] *= 10; | ||
| + | //Added 2005.02.21 - VisiGod | ||
| + | // | ||
| + | settype($ret[0],' | ||
| + | //Added 2005.02.21 - VisiGod | ||
| + | $ret[0] += ord($wholefile[$offset]) - ord(' | ||
| + | $offset++; | ||
| + | } else if ($wholefile[$offset] == ' | ||
| + | // Tolerate : or e because this is a multiuse function | ||
| + | $ret[1] = $offset+1; | ||
| + | if ($negative) { | ||
| + | if ($ret[0] == 0) | ||
| + | return array(false); | ||
| + | $ret[0] = - $ret[0]; | ||
| + | } | ||
| + | return $ret; | ||
| + | } else return array(false); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | function decodeEntry($wholefile, | ||
| + | if ($wholefile[$offset] == ' | ||
| + | return $this-> | ||
| + | if ($wholefile[$offset] == ' | ||
| + | return $this-> | ||
| + | if ($wholefile[$offset] == ' | ||
| + | return $this-> | ||
| + | // String value: decode number, then grab substring | ||
| + | |||
| + | $info = $this-> | ||
| + | if ($info[0] === false) | ||
| + | return array(false); | ||
| + | $ret[0] = substr($wholefile, | ||
| + | $ret[1] = $info[1]+strlen($ret[0]); | ||
| + | return $ret; | ||
| + | } | ||
| + | |||
| + | function decodeList($wholefile, | ||
| + | if ($wholefile[$offset] != ' | ||
| + | return array(false); | ||
| + | $offset++; | ||
| + | $ret = array(); | ||
| + | for ($i=0;; | ||
| + | if ($wholefile[$offset] == ' | ||
| + | break; | ||
| + | $value = $this-> | ||
| + | if ($value[0] === false) | ||
| + | return array(false); | ||
| + | $ret[$i] = $value[0]; | ||
| + | $offset = $value[1]; | ||
| + | } | ||
| + | // The empty list is an empty array. Seems fine. | ||
| + | return array(0=> | ||
| + | } | ||
| + | |||
| + | // Tries to construct an array | ||
| + | function decodeDict($wholefile, | ||
| + | if ($wholefile[$offset] == ' | ||
| + | return $this-> | ||
| + | if ($wholefile[$offset] != ' | ||
| + | return false; | ||
| + | $ret=array(); | ||
| + | $offset++; | ||
| + | for (;;) { | ||
| + | if ($wholefile[$offset] == ' | ||
| + | $offset++; | ||
| + | break; | ||
| + | } | ||
| + | $left = $this-> | ||
| + | if (!$left[0]) | ||
| + | return false; | ||
| + | $offset = $left[1]; | ||
| + | if ($wholefile[$offset] == ' | ||
| + | // Recurse | ||
| + | $value = $this-> | ||
| + | if (!$value[0]) | ||
| + | return false; | ||
| + | $ret[addslashes($left[0])] = $value[0]; | ||
| + | $offset= $value[1]; | ||
| + | continue; | ||
| + | } | ||
| + | if ($wholefile[$offset] == ' | ||
| + | $value = $this-> | ||
| + | if (!$value[0] && is_bool($value[0])) | ||
| + | return false; | ||
| + | $ret[addslashes($left[0])] = $value[0]; | ||
| + | $offset = $value[1]; | ||
| + | continue; | ||
| + | } | ||
| + | $value = $this-> | ||
| + | if ($value[0] === false) | ||
| + | return false; | ||
| + | $ret[addslashes($left[0])] = $value[0]; | ||
| + | $offset = $value[1]; | ||
| + | } | ||
| + | return array(0=> | ||
| + | } | ||
| + | } // End of class declaration. | ||
| + | |||
| + | // Use this function. eg: BDecode(" | ||
| + | function BDecode($wholefile) { | ||
| + | $decoder = new BDecode; | ||
| + | $return = $decoder-> | ||
| + | return $return[0]; | ||
| + | } | ||
| + | |||
| + | // We'll protect the namespace of our code | ||
| + | // using a class | ||
| + | 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. :) | ||
| + | function makeSorted($array) { | ||
| + | // Shouldn' | ||
| + | if (empty($array)) | ||
| + | return $array; | ||
| + | $i = 0; | ||
| + | foreach($array as $key => $dummy) | ||
| + | $keys[$i++] = stripslashes($key); | ||
| + | sort($keys); | ||
| + | for ($i=0; isset($keys[$i]); | ||
| + | $return[addslashes($keys[$i])] = $array[addslashes($keys[$i])]; | ||
| + | return $return; | ||
| + | } | ||
| + | |||
| + | // Encodes strings, integers and empty dictionaries. | ||
| + | // $unstrip is set to true when decoding dictionary keys | ||
| + | function encodeEntry($entry, | ||
| + | if (is_bool($entry)) { | ||
| + | $fd .= ' | ||
| + | return; | ||
| + | } | ||
| + | if (is_int($entry) || is_float($entry)) { | ||
| + | $fd .= ' | ||
| + | return; | ||
| + | } | ||
| + | if ($unstrip) | ||
| + | $myentry = stripslashes($entry); | ||
| + | else | ||
| + | $myentry = $entry; | ||
| + | $length = strlen($myentry); | ||
| + | $fd .= $length.':' | ||
| + | } | ||
| + | |||
| + | // Encodes lists | ||
| + | function encodeList($array, | ||
| + | $fd .= ' | ||
| + | // The empty list is defined as array(); | ||
| + | if (empty($array)) { | ||
| + | $fd .= ' | ||
| + | return; | ||
| + | } | ||
| + | for ($i = 0; isset($array[$i]); | ||
| + | $this-> | ||
| + | $fd .= ' | ||
| + | } | ||
| + | |||
| + | // Passes lists and dictionaries accordingly, | ||
| + | // the strings and integers. | ||
| + | function decideEncode($unknown, | ||
| + | if (is_array($unknown)) { | ||
| + | if (isset($unknown[0]) || empty($unknown)) | ||
| + | return $this-> | ||
| + | else | ||
| + | return $this-> | ||
| + | } | ||
| + | $this-> | ||
| + | } | ||
| + | |||
| + | // Encodes dictionaries | ||
| + | function encodeDict($array, | ||
| + | $fd .= ' | ||
| + | if (is_bool($array)) { | ||
| + | $fd .= ' | ||
| + | return; | ||
| + | } | ||
| + | // NEED TO SORT! | ||
| + | $newarray = $this-> | ||
| + | foreach($newarray as $left => $right) { | ||
| + | $this-> | ||
| + | $this-> | ||
| + | } | ||
| + | $fd .= ' | ||
| + | } | ||
| + | } // End of class declaration. | ||
| + | |||
| + | // Use this function in your own code. | ||
| + | function BEncode($array) { | ||
| + | $string = ''; | ||
| + | $encoder = new BEncode; | ||
| + | $encoder-> | ||
| + | return $string; | ||
| + | } | ||
| + | |||
| + | $url = trim($_GET[url]); | ||
| + | if ($url) { | ||
| + | $alltorrent = trim(Yreadfile($url, | ||
| + | } else exit; | ||
| + | if ($alltorrent == "" | ||
| + | $array = BDecode($alltorrent); | ||
| + | |||
| + | $hash=sha1(BEncode($array[" | ||
| + | echo "< | ||
| + | echo "< | ||
| + | echo "< | ||
| + | $announce_list = " | ||
| + | $announce_list_cnt = count($array[$announce_list]); | ||
| + | for ($i=0;$i < $announce_list_cnt; | ||
| + | echo $array[$announce_list][$i][0]; | ||
| + | if ($i < $announce_list_cnt-1) | ||
| + | echo ", "; | ||
| + | else | ||
| + | echo "< | ||
| + | } | ||
| + | |||
| + | echo "< | ||
| + | $creation_date = " | ||
| + | echo "< | ||
| + | echo "< | ||
| + | $file_cnt = 0; | ||
| + | $info_files_cnt = count($array[info][files]); | ||
| + | for ($i=0;$i < $info_files_cnt; | ||
| + | $info_file_path_cnt = count($array[info][files][$i][path]); | ||
| + | $file_cnt++; | ||
| + | echo $file_cnt.": | ||
| + | for ($j=0;$j < $info_file_path_cnt; | ||
| + | echo $array[info][files][$i][path][$j]; | ||
| + | if ($j < $info_file_path_cnt-1) echo "/"; | ||
| + | echo " (" | ||
| + | } | ||
| + | echo "< | ||
| + | } | ||
| + | |||
| + | /* | ||
| + | | ||
| + | */ | ||
| + | //변수가 정의 되었으면 해당 값을 반환하고 정의 되어있지 않으면 지정된 기본값을 반환한다. | ||
| + | function Yvar_check(& | ||
| + | return (isset($var)) ? $var : $return; | ||
| + | } | ||
| + | |||
| + | //변수가 정의되지 않았거나 값이 NULL값 이거나, 값이 0, false 일경우 지정된 기본값을 반환한다. | ||
| + | function Yvar_empty_check(& | ||
| + | return (!empty($var)) ? $var : $return; | ||
| + | } | ||
| + | |||
| + | //http, GET 방식의 소켓연결 | ||
| + | function Ysockopen($url, | ||
| + | if (!empty($url) && preg_match(" | ||
| + | |||
| + | $array = parse_url($url); | ||
| + | $url_scheme = Yvar_check($array[' | ||
| + | $url_server = Yvar_check($array[' | ||
| + | $url_path = Yvar_check($array[' | ||
| + | $url_query= Yvar_check($array[' | ||
| + | $url_port = Yvar_empty_check($array[' | ||
| + | |||
| + | $fp = @fsockopen($url_server, | ||
| + | |||
| + | if (empty($fp)) { | ||
| + | return ''; | ||
| + | } | ||
| + | |||
| + | fputs($fp, "GET " . $url_path . "?" | ||
| + | if (!empty($accept)) fputs($fp, " | ||
| + | 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, " | ||
| + | |||
| + | return $fp; | ||
| + | } else { | ||
| + | return ''; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | function Ysockclose(& | ||
| + | if (!empty($fp)) fclose($fp); | ||
| + | return true; | ||
| + | } | ||
| + | |||
| + | // | ||
| + | function Yreadfile($url, | ||
| + | $fp = Ysockopen($url, | ||
| + | if (!empty($fp)) { | ||
| + | $text = ''; | ||
| + | $check_header = false; | ||
| + | while (!feof($fp)){ | ||
| + | $temp = fgets($fp, 1024); | ||
| + | if ($check_header == false){ | ||
| + | //실제 파일이 아닌 헤더 정보인지 체크 하여 추가하지 않는다. | ||
| + | if (preg_match("' | ||
| + | $check_header = true; | ||
| + | continue; | ||
| + | } | ||
| + | } else{ | ||
| + | //헤더 정보가 아닌 경우에만 추가한다. | ||
| + | $text .= $temp; | ||
| + | } | ||
| + | } | ||
| + | Ysockclose($fp); | ||
| + | return $text; | ||
| + | } else { | ||
| + | return ''; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ?> | ||
| + | </ | ||
| - | {{tag> torrent p2p 토렌트 유토렌트 utorrent}} | ||