arvidn / libtorrent

an efficient feature complete C++ bittorrent implementation
http://libtorrent.org
Other
5.17k stars 994 forks source link

peer_class in python #1517

Closed NetSharkDon closed 4 years ago

NetSharkDon commented 7 years ago

HELLO There Are Some Evil Bt client ,(i.e Xunlei,It download ,But dont upload) I want to use peer_class::set_upload_limit in PYTHON , but How to Use?

Falcosc commented 7 years ago

You have only access the settings http://libtorrent.org/reference-Settings.html and some interfaces and some public members of libtorrent. With python you can list the members of libtorrent.

arvidn commented 7 years ago

it's possible the peer_class feature hasn't been exposed to python. patches are welcome! however, peer_class cannot distinguish between client versions, just IPs (and a few other things)

NetSharkDon commented 7 years ago

Qbittorrent 3.1.92 with libtorrent 0.16.16 it calls _"set_peer_uploadlimit" to "set_upload_limit" a specific peer ,and I think it is very GOOD!

NetSharkDon commented 7 years ago

but the new version doesnt support it

NetSharkDon commented 7 years ago

if peerclass can distinguish between client versions ,it is very GOOD , that I can " set_uploadlimit" specific Bt client (i.e Xunlei,BitTorrent)

Falcosc commented 7 years ago

@arvidn wouldn't this cause the mentioned deadlock issue https://sourceforge.net/p/libtorrent/mailman/message/29959727/ ?

@NetSharkDon you could create a binding for peer_class here https://github.com/arvidn/libtorrent/tree/master/bindings/python/src like the other classes

arvidn commented 7 years ago

@Falcosc no. peer_class refers to a specific feature in libtorrent, not the C++ class representing a peer connection.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.