Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get different info hash from webtorrent-hybrid and webtorrent-desktop #79

Closed
zarzen opened this issue May 24, 2018 · 2 comments
Closed

Comments

@zarzen
Copy link

zarzen commented May 24, 2018

Hi, I just noticed the info hashes created by webtorrent-desktop and webtorrent-hybrid are different.
It causes a problem, when I use webtorrent-desktop created a torrent or magnet link and I also want to use servers somewhere else to seed same content to contribute the download seed, but command webtorrent-hybrid seed <the-file> won't work due to the different hash created by desktop software. Any suggestions to make it consistent hash?

@feross
Copy link
Member

feross commented May 25, 2018

Thanks for reporting this. WebTorrent Desktop uses the result of the "Private" checkbox at torrent creation time to set the torrent's private flag to true or false. Unfortunately, there's an issue with the way this private flag spec was designed. There are actually 3 possible values for the private flag:

  • private: true
  • private: false
  • not specified (defaults to false)

The problem is that private flag is part of the info section in the .torrent file, which means that each of these three values for private will produce a different info hash.

So, what's happening is that webtorrent-cli and webtorrent-hybrid are not setting private at all, while WebTorrent Desktop is setting it to false.

I submitted a PR to fix this in WebTorrent Desktop: webtorrent/webtorrent-desktop#1411

@feross
Copy link
Member

feross commented May 25, 2018

As a temporary workaround until a new version of WebTorrent Desktop is released, you can create a torrent from the command line that matches the WebTorrent Desktop one by explicitly setting private to false like this:

create-torrent --no-private ~/test-files/cat.jpg > ~/Desktop/cat.torrent

@feross feross closed this as completed May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants