aldenml / libtorrent4j

libtorrent for java, a swig Java interface for libtorrent
http://libtorrent4j.org
Other
204 stars 31 forks source link

Does anyone has WebTorrent working? #232

Closed tuxayo closed 1 year ago

tuxayo commented 1 year ago

(without DHT, LSD or PEX to get peers, only wss tracker)

With libretorrent I don't have it working. And neither with qBittorrent (but there is no official support, I enabled it on compile)

See this ticket for testing methodology https://gitlab.com/proninyaroslav/libretorrent/-/issues/431

Can anyone test with any of the clients based on libtorrent4j? (which are they btw? besides libretorrent)

aldenml commented 1 year ago

Hi @tuxayo, I will give it a try and test it locally in a desktop application based on libtorrent4j.

As for your second question, I don't know, but I'm very grateful to have libretorrent on my list :)

tuxayo commented 1 year ago

Thanks @aldenml , I retried on my phone and I still can't have webtorrent working. Somehow libretorrent gets non-webtorrent peers, that's how I can download. (no DHT, no LSD, only a WSS tracker, I don't know where to disable PEX in libretorrent though). But zero seeding in 24h.

As for your second question, I don't know, but I'm very grateful to have libretorrent on my list :)

Yes, thanks a lot for making it possible with libtorrent4j. That's great to make a homemade seedbox with an old phone. Not massive storage but still decent with an SD card. And it's not an environmental aberration as opposed to a dedicated seedbox.

tuxayo commented 1 year ago

I will give it a try and test it locally in a desktop application based on libtorrent4j.

Any news @aldenml ? Since all that time my libretorrent still couldn't seed a single byte.

aldenml commented 1 year ago

Hi @tuxayo , I will try to dedicate some time this weekend.

aldenml commented 1 year ago

Hi @tuxayo, I tested with the latest version 2.1.0-28 desktop based application and it works (https://github.com/aldenml/libtorrent4j/blob/master/demo/src/main/java/org/libtorrent4j/demo/DownloadWebTorrent.java). However, I needed to make some adjustments to the torrent. Your torrent has only a wss tracker that seems to have problems. I downloaded the latest one from webtorrent.io and deleted all non-wss trackers.

This online tool is helpful http://torrenteditor.com/edit.php

Screenshot 2023-03-18 at 2 11 13 PM
tuxayo commented 1 year ago

Thanks for testing :)

downloaded the latest one from webtorrent.io

Where did you find it? The browser network tools don't show a .torrent file being downloaded. Weird.

and it works

Can you see the connection type of a peer when downloading?

I just retried with LibreTorrent and it worked with a peer connected via uTP . So not via webtorrent.

aldenml commented 1 year ago

Hi @tuxayo I'm attaching an image with the link to download the torrent (webtorrent.io). Try with removing all the non-wss trackers and let me now.

Screenshot 2023-05-19 at 8 18 25 PM
tuxayo commented 1 year ago

Oh crap, so obvious, I was digging blindly the URLs based on the webseed until I found and came back here.

Thanks! So, maybe it was only the tracker that I got the first time I tried that was bad!! Now I'm getting BT (connection type) peers but the user agent is Webtorrent. So that's it, we can suppose it's using webtorrent protocol? :D

Is that expected that the connection type is BT? (maybe is a LibreTorrent thing) Is there any way to tell other than the user agent? Which will be unclear once webtorrent is enabled by default upstream and qBittorrent and Deluge get support.

aldenml commented 1 year ago

Hi @tuxayo, seeing peers with user agent Webtorrent is a good development, but that's not the whole story. If I recall correctly, they have a desktop version that can communicate via regular TCP and UTP. I don't know if LibreTorrent has advanced logging, but I would try to look for PeerConnectAlert and socket type RTC.