自己挖個(gè)坑沙咏,準(zhǔn)備入手二次修改。
價(jià)值1000元的班套,最近比較熱門肢藐,本人沒(méi)什么用,拿來(lái)給分享各位吱韭。
一鍵搭建平臺(tái)吆豹,比較智能
下載鏈接:http://www.johnz.co/html/jishuyuanma/2017/1228/82.html
P2P中DHT網(wǎng)絡(luò)爬蟲(chóng)
繼續(xù)挖坑,一個(gè)dht網(wǎng)絡(luò)的“磁力鏈接”搜索python代碼:https://github.com/NanYoMy/DHT-woodworm
這個(gè)python代碼是用來(lái)從DHT網(wǎng)絡(luò)(一種分布式的“磁力鏈接”的共享網(wǎng)絡(luò)理盆,這個(gè)叫法是我個(gè)人對(duì)這種分布式網(wǎng)絡(luò)的稱呼)中痘煤,檢測(cè)收集“磁力鏈接”。每一個(gè)磁力鏈接就對(duì)應(yīng)著一個(gè)種子文件猿规。由于“磁力鏈接”在DHT網(wǎng)絡(luò)中是通過(guò)分布式共享衷快。所以通過(guò)檢測(cè)DHT網(wǎng)絡(luò)中的數(shù)據(jù)包就可以獲得其他客戶端發(fā)來(lái)的“磁力鏈接”,通過(guò)這些磁力鏈接下載相應(yīng)的種子文件分析獲取種子文件的文件資源名姨俩,這就完成了整個(gè)過(guò)程蘸拔。
繼續(xù)挖坑师郑,python挖磁鏈實(shí)例。
import?requests??
import?re??
from?bs4?import?BeautifulSoup??
url="*種子的網(wǎng)站*/" ?
header={??
"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",??
"Accept-Encoding":"gzip,?deflate",??
"Accept-Language":"zh-CN,zh;q=0.8",??
"Cache-Control":"max-age=0",??
"Connection":"keep-alive",??
"Content-Length":"65",??
"Content-Type":"application/x-www-form-urlencoded",??
"Host":"btkitty.bid",??
"Origin":"*種子的網(wǎng)站*",??
"Referer":"*種子的網(wǎng)站*/",??
"Upgrade-Insecure-Requests":"1",??
"User-Agent":"Mozilla/5.0?(Windows?NT?10.0.14393;?WOW64)?AppleWebKit/537.36?(KHTML,?like?Gecko)?Chrome/57.0.2950.5?Safari/537.36"??
????}??
while?True:??
word=input("輸入搜索關(guān)鍵詞:")??
????data={??
"keyword":word,??
"hidden":"true"??
????????}??
????res=requests.post(url,data=data,headers=header)??
bs=BeautifulSoup(res.text,"lxml")??
itemInfo=bs.find_all("dd",class_="option")??
????torrent={}??
for?item?in?itemInfo:??
magnet=item.find_next("a",href=re.compile("magnet.*")).attrs["href"]??
name=item.find_previous("a",href=re.compile("*種子的網(wǎng)站*/.*\.html")).text??
size=item.find_next(text=re.compile("\u6587\u4ef6\u5927\u5c0f")).find_next("b").text??
time=item.find_next(text=re.compile("\u6536\u5f55\u65f6\u95f4")).find_next("b").text??
hot=item.find_next(text=re.compile("\u4eba\u6c14")).find_next("b").text??
????????torrent[name]=[name,time,size,hot,magnet]??
for?item?in?torrent:??
print("名稱:",torrent[item][0])??
print("發(fā)布時(shí)間:",torrent[item][1])??
print("大械髑稀:",torrent[item][2])??
print("熱度:",torrent[item][3])??
print("磁力鏈接:",torrent[item][4],'\n')