bitlet icon indicating copy to clipboard operation
bitlet copied to clipboard

save torrent file error

Open edeye opened this issue 10 years ago • 6 comments

Metafile metafile = new Metafile(new BufferedInputStream(new FileInputStream(filename))); // filename1 is a new torrent file metafile.print(new BufferedOutputStream(new FileOutputStream(filename1, true))); //but filename1 can't be used

//first,edit Announce/Comment/FileName or something else in a torrent file,after that save a new torrent file,how to do that?

edeye avatar Jun 07 '15 09:06 edeye

Hi @edeye, what do you mean with the following?

//but filename1 can't be used

Could you share a snippet of code demonstrating what you're trying to do and the output you get?

abahgat avatar Jun 07 '15 15:06 abahgat

very sorry that my english is not good... I want to edit the Comment in the torrent,@abahgat

    String filename = "C:\\Users\\k\\Desktop\\oldBtFile.torrent";
    Metafile metafile = new Metafile(new BufferedInputStream(
            new FileInputStream(filename)));
    String a = metafile.getComment();
    metafile.setComment(a + "my flag");

    String filename1 = "C:\\Users\\k\\Desktop\\newBtFile.torrent";
    metafile.print(new BufferedOutputStream(new FileOutputStream(filename1,
            true)));
    // when I use torrent Client open newBtFile.torrent, alert "Failure to obtain seed information"
    // how can I edit the Announce/Comment/Files in a torrent,then save a new one

edeye avatar Jun 08 '15 00:06 edeye

Thanks, I understand what you mean, I am adding tests to the library, so that we can reproduce that scenario.

abahgat avatar Jun 20 '15 22:06 abahgat

Hi @edeye, the test in 123684d is doing what you're trying to do here, but it seems like it's passing, can you take a look?

There's one thing that might explain what you're seeing, though: can you tell me what's the default encoding on the platform you're using?

Thanks

abahgat avatar Jun 24 '15 01:06 abahgat

@abahgat I'am sorry that bother you again, = =! I want to edit a torrent file(such as some Sensitive words info,I need to change it), and save it to a new torrent file, then I can use the new torrent file which the Sensitive words has been changed

edeye avatar Jan 26 '16 16:01 edeye

It's hard to say what's going wrong without being able to see your code. Perhaps you could try uploading your code to a gist so that we can take a look?

Cheers!

abahgat avatar Jan 31 '16 16:01 abahgat