Giter Club home page Giter Club logo

Comments (24)

atomashpolskiy avatar atomashpolskiy commented on May 22, 2024

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

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

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.

from bt.

atomashpolskiy avatar atomashpolskiy commented on May 22, 2024

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/

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

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();

from bt.

atomashpolskiy avatar atomashpolskiy commented on May 22, 2024

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

from bt.

atomashpolskiy avatar atomashpolskiy commented on May 22, 2024

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

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

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

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

I used version 1.5 of Bt.

from bt.

atomashpolskiy avatar atomashpolskiy commented on May 22, 2024

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.?

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

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.

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

JDK 1.8

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

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

from bt.

atomashpolskiy avatar atomashpolskiy commented on May 22, 2024

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.

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

Thanks, @atomashpolskiy. That's it!

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

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

from bt.

atomashpolskiy avatar atomashpolskiy commented on May 22, 2024

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

from bt.

atomashpolskiy avatar atomashpolskiy commented on May 22, 2024

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.

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

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.

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

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?

from bt.

atomashpolskiy avatar atomashpolskiy commented on May 22, 2024

@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).

from bt.

rafael-vieira-coelho avatar rafael-vieira-coelho commented on May 22, 2024

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

from bt.

atomashpolskiy avatar atomashpolskiy commented on May 22, 2024

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?

from bt.

Related Issues (20)

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.