Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/billiegoose/webtorrentify-link
Generate a WebTorrent-compatible .torrent from a URL
https://github.com/billiegoose/webtorrentify-link
Last synced: 3 months ago
JSON representation
Generate a WebTorrent-compatible .torrent from a URL
- Host: GitHub
- URL: https://github.com/billiegoose/webtorrentify-link
- Owner: billiegoose
- License: unlicense
- Created: 2017-04-07T18:26:53.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-19T18:26:59.000Z (almost 8 years ago)
- Last Synced: 2024-09-25T12:45:54.264Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 43 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# webtorrentify-link
Generate a WebTorrent-compatible .torrent from a URL## What it does
This module will take a download URL and convert it into a .torrent file. *Warning: it downloads the URL in order to do this.* It's basically a thin wrapper around [create-torrent](https://npm.im/create-torrent) that makes sure the .torrent files satisfy certain properties.
## Features
- **Deterministic.** Assuming the file on the server hasn't changed, identical input will result in identical output.
- **WebSeeds.** It lists the source URL as a WebSeed in order to bootstrap the torrent, so it always has at least one seed.
- **WebTorrent trackers.** Client side JavaScript cannot make UDP requests, so it cannot use traditional UDP trackers. The .torrent files generated use the default tracker list from `create-torrent`, which includes both UDP and WebSocket trackers.You might also be interested in [`webtorrentify-server`](https://npm.im/webtorrentify-server), which wraps this module in an HTTP microservice.
## Installation
```
npm install webtorrentify-link --save
```## Usage
var webtorrentify = require('webtorrentify-link')
var fs = require('fs')
webtorrentify('https://nodejs.org/dist/v6.10.2/node-v6.10.2-linux-x64.tar.gz')
.then(function (buffer) {
fs.writeFileSync('node-v6.10.2-linux-x64.tar.gz.torrent', buffer)
})## Changelog
1.0.5 - Add https://cors-buster-backup.now.sh/ proxy to urlList
1.0.4 - Add https://cors-buster.now.sh/ proxy to urlList
1.0.3 - Use Origin header in requests
1.0.2 - Fix link to repo
1.0.1 - Return error rather than crash for stream errors
1.0.0 - Initial commit
## License
Copyright 2017 William Hilton.
Licensed under [The Unlicense](http://unlicense.org/).