atomashpolskiy / bt

BitTorrent library and client with DHT, magnet links, encryption and more
https://atomashpolskiy.github.io/bt/
Apache License 2.0
2.42k stars 381 forks source link

Jar Bt #43

Closed rafael-vieira-coelho closed 6 years ago

rafael-vieira-coelho commented 7 years ago

Hi, where can i download the jar file to put in my project to use your library? Thanks.

atomashpolskiy commented 7 years ago

@rafael-vieira-coelho , you may download all jars from the central Maven repository

rafael-vieira-coelho commented 7 years ago

Thank you!

2017-11-29 19:35 GMT-02:00 Andrei Tomashpolskiy notifications@github.com:

@rafael-vieira-coelho https://github.com/rafael-vieira-coelho , you may download all jars from the central Maven repository http://search.maven.org/#search%7Cga%7C1%7Ccom.github.atomashpolskiy

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/atomashpolskiy/bt/issues/43#issuecomment-348003847, or mute the thread https://github.com/notifications/unsubscribe-auth/AgENcZl7qGSvQ_GmBym5jH4E9d0hmiSTks5s7c4PgaJpZM4QvnYu .

--


Rafael Vieira Coelho

Engenheiro de Computação pela Fundação Universidade Federal do Rio Grande (FURG)

Mestre em Ciência da Computação pela Universidade Federal do Rio Grande do Sul (UFRGS) - Redes de Computadores

https://twitter.com/rafael_coelho84

rafael-vieira-coelho commented 7 years ago

Hi, @atomashpolskiy.

I downloaded the jar files and tried the example in the main page of Bt GitHub, but keeps getting an error with Module class from Google's Guice. I even trieded to add Guice jar to the project but didn't work. Could you help me?

Att.

atomashpolskiy commented 7 years ago

You may find the dependencies for each jar in its' META-INF/MANIFEST.MF file.

E.g. for bt-core-1.6-SNAPSHOT:

Class-Path: bt-bencoding-1.6-SNAPSHOT.jar snakeyaml-1.17.jar slf4j-api
 -1.7.21.jar guice-4.1.0.jar javax.inject-1.jar aopalliance-1.0.jar gu
 ava-19.0.jar guice-multibindings-4.1.0.jar

But it's usually a lot easier to just use Maven or Gradle to manage the dependencies. Check out the Maven's starting guide, for instance: https://maven.apache.org/guides/getting-started/

rafael-vieira-coelho commented 7 years ago

Now it worked the dependencies, but the example of creating a BtClient doesn't work. It's constructor only accepts storage. That example is deprecated?

BtClient client = Bt.client()
                    .config(config)
                    .storage(storage)
                    .magnet(magnet_uri)
                    .autoLoadModules()
                    .module(dhtModule)
                    .stopWhenDownloaded()
                    .build();
atomashpolskiy commented 7 years ago

Yeah, please use the code from the readme. I probably forgot to update the docs for this matter :)

atomashpolskiy commented 7 years ago

Disregard my previous comment, your piece of code should work. What does the compiler say?

rafael-vieira-coelho commented 7 years ago

"method client in classe Bt cannot be applied to given type: required Storage, found no arguments"

rafael-vieira-coelho commented 7 years ago

I used version 1.5 of Bt.

atomashpolskiy commented 7 years ago

This is weird, because the message is obviously wrong: https://github.com/atomashpolskiy/bt/blob/master/bt-core/src/main/java/bt/Bt.java. Would you mind elaborating more on your environment: JDK/javac version, IDE, etc.?

rafael-vieira-coelho commented 7 years ago

Sure, i am using Netbeans with javac 9.0.1 (JDK Project is 8). I added bt-dht, bt-http-tracker-client, bt-core, bt-bencoding, bt-cli jars.

rafael-vieira-coelho commented 7 years ago

JDK 1.8

rafael-vieira-coelho commented 7 years ago

The class that appears to import for BtClient is from bt.runtime.BtClient. Shouldn't be from bt.BtClient?

atomashpolskiy commented 7 years ago

Remove bt-cli from the classpath, if you've downloaded it from Central. It's not published in binary form since 1.1, and the outdated version must be causing conflicts. It's not needed for Bt operation anyways, it's just a standalone app.

rafael-vieira-coelho commented 7 years ago

Thanks, @atomashpolskiy. That's it!

rafael-vieira-coelho commented 7 years ago

Just another doubt: in Bt there is a way to create a torrent file from files in the computer?

atomashpolskiy commented 7 years ago

Of course, there's a method in the client builder: torrent(URL)

atomashpolskiy commented 7 years ago

See this class: https://github.com/atomashpolskiy/bt/blob/master/bt-core/src/main/java/bt/TorrentClientBuilder.java . All methods are available in the object returned by Bt.client() invocation.

rafael-vieira-coelho commented 7 years ago

Thanks a lot. You were very helpfull and the code is very good. Congrats.

Em 1 de dez de 2017 06:00, "Andrei Tomashpolskiy" notifications@github.com escreveu:

See this class: https://github.com/atomashpolskiy/bt/blob/master/ bt-core/src/main/java/bt/TorrentClientBuilder.java . All methods are available in the object returned by Bt.client() invocation.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/atomashpolskiy/bt/issues/43#issuecomment-348427592, or mute the thread https://github.com/notifications/unsubscribe-auth/AgENcTbLe--rhr_SM-kDhUU5B1OepxjGks5s77IOgaJpZM4QvnYu .

rafael-vieira-coelho commented 7 years ago

The method that receives an URL isn't for opening a torrent file? I was wondering if there is a method to create a torrent file from files in the computer.

rafael-vieira-coelho commented 7 years ago

Another thing, i got a warning: [bt.service.executor-thread-1] WARN bt.torrent.TrackerAnnouncer - Tracker URL protocol is not supported: http://tracker.trackerfix.com:80/announce. Do you know how could i fix that? That means that the torrent file uses another protocol?

atomashpolskiy commented 7 years ago

@rafael-vieira-coelho ,

The method that receives an URL isn't for opening a torrent file? I was wondering if there is a method to create a torrent file from files in the computer.

Yes, it's for opening a .torrent file. The latter is a feature that I'd really like to see in Bt, but it's not present at the moment.

Another thing, i got a warning: [bt.service.executor-thread-1] WARN bt.torrent.TrackerAnnouncer - Tracker URL protocol is not supported: http://tracker.trackerfix.com:80/announce. Do you know how could i fix that? That means that the torrent file uses another protocol?

Make sure that bt-http-tracker-client module is present in the runtime (either it's available on the classpath and auto-loading is turned on OR it's contributed manually in the runtime builder).

rafael-vieira-coelho commented 7 years ago

I just get these messages from log: [JavaFX Application Thread] INFO bt.runtime.BtRuntimeBuilder - Auto-loading module bt.peerexchange.PeerExchangeModule with default configuration [JavaFX Application Thread] INFO bt.runtime.BtRuntimeBuilder - Auto-loading module bt.tracker.http.HttpTrackerModule with default configuration [JavaFX Application Thread] INFO bt.runtime.BtRuntimeBuilder - Overriding auto-loaded module bt.dht.DHTModule [bt.net.pool.incoming-acceptor] INFO bt.net.PeerConnectionPool - Opening server channel for incoming connections @ /127.0.0.1:6968

atomashpolskiy commented 7 years ago

Very strange, can you set a breakpoint in bt.tracker.TrackerService#isSupportedProtocol and check, if there is an entry for key http in trackerFactories map variable?