aldenml / libtorrent4j

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

update to libtorrent master HEAD, version 2.1.0-27 #226

Closed aldenml closed 1 year ago

proninyaroslav commented 1 year ago

@aldenml When to expect publication in maven?

aldenml commented 1 year ago

Hi @proninyaroslav!, Ideally this week

proninyaroslav commented 1 year ago

Thank you, hope for a release soon

aldenml commented 1 year ago

@proninyaroslav took me a bit longer :), it's published now

proninyaroslav commented 1 year ago

@aldenml Can you tell me how to replace the TorrentInfo::bencode method? I see that it has been removed.

aldenml commented 1 year ago

@proninyaroslav good question, here it is the answer from Arvidn: https://github.com/arvidn/libtorrent/issues/7200

Let me know if you need help with doing that in java.

proninyaroslav commented 1 year ago

@aldenml Thank you. I realized that this will have to be done in an asynchronous manner through AlertListener, which of course is not as good as before)

proninyaroslav commented 1 year ago

@aldenml The only difficulty I faced: let's say I got the magnet torrent bencode in the AlertListener:

byte_vector bytes = libtorrent.write_resume_data(((SaveResumeDataAlert) alert).params().swig()).bencode();

but now I can't add trackers and url seeds that a magnet link can contain. Previously, I used a create_torrent class for this, passing bencode and add_torrent_params to it, but now it has also changed its API, it no longer accepts bencode. Is there a way to edit the bencode obtained in this way?

P.S: This is an example of what I did before: https://gitlab.com/proninyaroslav/libretorrent/-/commit/14e08121347997bbef04e06fe665ae70b2c5493a#facfb0df3f87925576cd944c736f694664e4bb73_1325_1328

aldenml commented 1 year ago

@proninyaroslav totally agree that now it a lot more difficult to achieve the same. I did try to recreate the feature but was too much hack. With enough time I think something can be done, just not ETA from me.

proninyaroslav commented 1 year ago

And also a resume data doesn't seem to contain trackers and url seeds of the magnet, despite the SAVE_INFO_DICT flag.

proninyaroslav commented 1 year ago

@aldenml

And also a resume data doesn't seem to contain trackers and url seeds of the magnet, despite the SAVE_INFO_DICT flag.

Yes, it looks like it's broken in the new version. I thought my magnet fetching code was the problem, but I also checked the default SessionManager::fetchMagnet method and it returns an empty list of trackers and url seeds even if the magnet contains trackers. At the same time, TorrentInfo::bencode in the old version correctly returned a list of trackers and url seeds.

aldenml commented 1 year ago

I see, please, create an issue and I will look at it

proninyaroslav commented 1 year ago

https://github.com/aldenml/libtorrent4j/issues/231

proninyaroslav commented 1 year ago

@aldenml Hi! Do you have any news? I would like to release my app, but had to be delayed due to this issue https://github.com/aldenml/libtorrent4j/issues/231

aldenml commented 1 year ago

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