[PR #172] [MERGED] Magnet link from hash only #186

Closed
opened 2026-02-25 20:32:47 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/asapach/peerflix-server/pull/172
Author: @Coriou
Created: 10/21/2019
Status: Merged
Merged: 10/21/2019
Merged by: @asapach

Base: masterHead: master


📝 Commits (3)

  • 93c6b49 Generate magnet from hash only
  • 97baf20 Fix: Generate magnet from hash only
  • 2259e0c Fix: Generate magnet from hash only

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 server/store.js (+4 -0)

📄 Description

Sometimes it's just easier to copy/paste a torrent's hash than it's full magnet URL (mostly on mobile devices).

This PR allows a hash to be dropped in the input and a valid magnet link will be generated and passed to read-torrent.

An added benefit of doing so is that it will use the trackers users pass in the options file instead of the trackers usually added to the magnet file by various sites.

Other types of links / uploads aren't affected.

Example: Pasting this 08ada5a7a6183aae1e09d831df6748d566095a10 will retrieve the torrents metadata and start the download the same way it would if you pasted this:

magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent

The example is using WebTorrent.io's "Sintel" torrent


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/asapach/peerflix-server/pull/172 **Author:** [@Coriou](https://github.com/Coriou) **Created:** 10/21/2019 **Status:** ✅ Merged **Merged:** 10/21/2019 **Merged by:** [@asapach](https://github.com/asapach) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (3) - [`93c6b49`](https://github.com/asapach/peerflix-server/commit/93c6b497438e07f47b1e7876d66b5e4b17f2b490) Generate magnet from hash only - [`97baf20`](https://github.com/asapach/peerflix-server/commit/97baf20824f19193564e541eba80b999f5838775) Fix: Generate magnet from hash only - [`2259e0c`](https://github.com/asapach/peerflix-server/commit/2259e0c213c480842a2680dace0ebe8beec4e3e2) Fix: Generate magnet from hash only ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `server/store.js` (+4 -0) </details> ### 📄 Description Sometimes it's just easier to copy/paste a torrent's hash than it's full magnet URL (mostly on mobile devices). This PR allows a hash to be dropped in the input and a valid magnet link will be generated and passed to `read-torrent`. An added benefit of doing so is that it will use the trackers users pass in the options file instead of the trackers usually added to the magnet file by various sites. Other types of links / uploads aren't affected. **Example:** Pasting this `08ada5a7a6183aae1e09d831df6748d566095a10` will retrieve the torrents metadata and start the download the same way it would if you pasted this: `magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent` **The example is using WebTorrent.io's "Sintel" torrent** --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 20:32:47 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/peerflix-server#186
No description provided.