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

How can I use webseed when download files with hashinfo? #1388

Closed
hz0324 opened this issue May 14, 2018 · 2 comments
Closed

How can I use webseed when download files with hashinfo? #1388

hz0324 opened this issue May 14, 2018 · 2 comments

Comments

@hz0324
Copy link

@hz0324 hz0324 commented May 14, 2018

I just knew the concept of webseed and feel like it will solve our problem : downloading starts too late (about 1 minute)

Right now, we have parsed 1000+ files and get their hashinfo stored in our database. Users can search the filename to get the hashinfo, and then download the file using the hashinfo in a web app just like instant.io.
(when user click download, we will call the server host the files to start seeding the target file).

This works fine overall, but very slow. Usually, the downloading starts in about 1 minute.

Since we know where the files are, I think we can add some information, such as webseed url, to facilitate the downloading. But I can not find anything about "using webseed with hashinfo". Is this possible?

Thanks.

@KayleePop

This comment has been minimized.

Copy link
Contributor

@KayleePop KayleePop commented May 14, 2018

From the docs at https://webtorrent.io/docs

torrent.addWebSeed(url)

Add a web seed to the torrent swarm. For more information on BitTorrent web seeds, see BEP19.

In the browser, web seed servers must have proper CORS (Cross-origin resource sharing) headers so that data can be fetched across domain.

The url argument is the web seed URL.

 

You could also create a magnet link using the infohash and url like this

let infoHash = 'infohash here'
let webSeed = 'webseed url here'
let magnetLink = `magnet:?xt=urn:btih:${infoHash}&ws=${webSeed}` // you also need to add trackers for torrenting in browser
@hz0324

This comment has been minimized.

Copy link
Author

@hz0324 hz0324 commented May 15, 2018

@KayleePop

Thank you very much, I just knew that magnet link can be created with infohash and webseed.
It is really helpful, thank you.
Have a good day

@hz0324 hz0324 closed this May 15, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.