mpetazzoni / ttorrent

BitTorrent Java library with tracker and download client
http://mpetazzoni.github.com/ttorrent/
Apache License 2.0
1.39k stars 502 forks source link

Can't download - Invalid metadata format. Map doesn't contain required field announce #231

Closed vikulin closed 5 years ago

vikulin commented 6 years ago

com.turn.ttorrent.bcodec.InvalidBEncodingException: Invalid metadata format. Map doesn't contain required field announce at com.turn.ttorrent.common.TorrentParser.getRequiredValueOrThrowException(TorrentParser.java:159) at com.turn.ttorrent.common.TorrentParser.parse(TorrentParser.java:51) at com.turn.ttorrent.common.TorrentParser.parseFromFile(TorrentParser.java:23) at com.turn.ttorrent.client.FileMetadataProvider.getTorrentMetadata(FileMetadataProvider.java:22) at com.turn.ttorrent.client.CommunicationManager.addTorrent(CommunicationManager.java:174) at com.turn.ttorrent.client.CommunicationManager.addTorrent(CommunicationManager.java:156) at com.turn.ttorrent.client.CommunicationManager.addTorrent(CommunicationManager.java:127) at com.turn.ttorrent.client.SimpleClient.startDownloading(SimpleClient.java:71) at com.turn.ttorrent.client.SimpleClient.downloadTorrent(SimpleClient.java:58) at org.hyperborian.bt.client.App.main(App.java:24)

My simple code public class App { public static void main( String[] args ) throws UnknownHostException {

    // First, instantiate the Client object.
    SimpleClient client = new SimpleClient();

    // This is the interface the client will listen on (you might need something
    // else than localhost here because other peers cannot connect to localhost).
    InetAddress address = InetAddress.getLocalHost();

    //Start download. Thread is blocked here
    try {
      client.downloadTorrent("C:\\Users\\Vadym\\Downloads\\example.torrent",
              "~\\Downloads",
              address);
      //download finished
    } catch (Exception e) {
      //download failed, see exception for details
      e.printStackTrace();
    }
    //If you don't want to seed the torrent you can stop client
    client.stop();  
}

}

Torrent file is a valid and susscessfully downloaded from uTorrent client

Dead-off commented 6 years ago

can you attach torrent file please?

vikulin commented 6 years ago

Sure. Torrent file attached,

пн, 12 нояб. 2018 г. в 10:08, Maxim Zaytsev notifications@github.com:

can you attach torrent file please?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mpetazzoni/ttorrent/issues/231#issuecomment-437791045, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtYxpolTiR88JT3fhRyw3nTcXd7x1iKks5uuSyUgaJpZM4YYmBW .

Dead-off commented 6 years ago

hmm, i don't see it. If you answered via email looks like github doesn't support providing files from mail to issue. Can you attach file here?

vikulin commented 6 years ago

Attached.

example.zip

Dead-off commented 6 years ago

thank you! I will fix bug that library cannot parse this torrent but you cannot download this torrent anyway because library doesn't support DHT and PEX extensions for working without tracker.

vikulin commented 6 years ago

Ok. I hope the DHT support is going to be added soon.

пн, 12 нояб. 2018 г. в 13:21, Maxim Zaytsev notifications@github.com:

thank you! I will fix bug that library cannot parse this torrent but you cannot download this torrent anyway because library doesn't support DHT and PEX extensions for working without tracker.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mpetazzoni/ttorrent/issues/231#issuecomment-437844840, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtYxjH7qMJX9BRAagsriHYoURjR4l3hks5uuVmtgaJpZM4YYmBW .

Dead-off commented 5 years ago

bug with parsing fixed, for DHT support exists other issue https://github.com/mpetazzoni/ttorrent/issues/83