Code Monkey home page Code Monkey logo

btlet's People

Contributors

neoql avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

btlet's Issues

find_node no response

老哥你好,我最近也在写一个dht爬虫,但是遇到一个问题卡住很久,希望老哥能帮帮我,先谢过了。
我遇到问题是: 对bootstrap返回的节点继续发送find_node请求,但是竟然没有一个节点给我response,如果对compact node info 进行bdecode后的ip和port无误的话,按道理向这些ip:port发送请求,总得有几个会回复的吧..

性能如何限制?

老哥你做的这个dht spider在市面上应该是最快的了,很牛!
我在一台E5 24G 100M机器上试了一下,两三个小时就采集了5w+的数据,比别人写的那些破玩意强太多了!
下面是E5 24G 100M机器上的运行情况,cpu已经到了70%
image

然后我换了一台E52 16G 5M机器上试了一下,速度就慢了下来,看来跟带宽也有很大关系。
下图是E5
2 16G 5M的运行情况
image

经过这几天的测试,发现了几个问题:
1,在带宽大的机器上有时候远程无法连接,不知道是cpu的问题还是带宽的问题
2,CPU占用比较高

如果能限制采集速度就更好了!

我试了一下,使用runtime.GOMAXPROCS就可以了
image

编码问题

首先谢谢作者提供源码

我讲得到的magnet文件信息写入mongodb,然后我建立索引,提示错误:

{ "ok" : 0.0, "errmsg" : "text contains invalid UTF-8", "code" : NumberInt(28755), "codeName" : "Location28755" }

所以好像mo.title不是utf8 编码。你bencode 里面decide 返回的string不是utf8编码的,麻烦作者看看不是有这个bug

RunAndFetchTracker

作者你好,请问可以提供一下sniffer.go里面RunAndFetchTracker方法的调用类么?谢谢。

运行一段时间之后报错,程序退出

Have already sniff 194058 torrents.panic: interface conversion: interface {} is string, not int64

goroutine 396122512 [running]:
github.com/neoql/btlet.loadMeta(0xc42122fcb0, 0xc421f863c0, 0x14, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/root/go/src/github.com/neoql/btlet/sniffer.go:126 +0x557
github.com/neoql/btlet.(*Sniffer).Sniff.func1(0xc421f863c0, 0x14, 0xc4249e684c, 0x10, 0x10, 0x6f25)
	/root/go/src/github.com/neoql/btlet/sniffer.go:92 +0x1d8
github.com/neoql/btlet/dht.(*sybilTransaction).OnQuery(0xc4200746e0, 0x7e84c0, 0xc4200ecb40, 0xc4224209c0, 0xc4219baa5c, 0x4, 0xc4219baa40, 0xd, 0xc421f080c0, 0xb4, ...)
	/root/go/src/github.com/neoql/btlet/dht/crawler.go:254 +0xe4
github.com/neoql/btlet/dht.(*sybilMessageDisposer).DisposeQuery(0xc4200ecc00, 0xc4224209c0, 0xc4219baa5c, 0x4, 0xc4219baa40, 0xd, 0xc421f080c0, 0xb4, 0xc0, 0x0, ...)
	/root/go/src/github.com/neoql/btlet/dht/crawler.go:81 +0xa6
created by github.com/neoql/btlet/dht.newDisposerProxy.func1
	/root/go/src/github.com/neoql/btlet/dht/dht.go:169 +0xaa
exit status 2

看起来像是length出现string这样的特殊情况导致转换失败,应该需要加一个类型判断吧

谢谢开源,如何保存种子?

这代码简洁易懂,非常适合学习.再次言谢.
不过有个问题,一直没弄明白,如何保存种子呢?
bencode.Encode() 这个函数貌似不能直接传Meta.

fatal error: all goroutines are asleep - deadlock!

在一台主机上可以跑,另一台主机运行后死锁
[root@xxx bt]# ./btsniffer
Start crawl ...
fatal error: all goroutines are asleep - deadlock!

goroutine 1 [chan receive]:
main.main()
/.../.../example/btsniffer/btsniffer.go:21 +0x36d

无法抓取数据

在个人电脑,win10环境,启动程序能收到零星的回应。但是还是没有抓取到数据。方面网络是不是需要配置什么东西。请指教,谢谢。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.