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

add magnet links to Metalinks #32

Open
poeml opened this issue Jun 5, 2015 · 0 comments
Open

add magnet links to Metalinks #32

poeml opened this issue Jun 5, 2015 · 0 comments

Comments

@poeml
Copy link
Owner

poeml commented Jun 5, 2015

                                                                                                                                                                                                                                                                         [          ]

Issue migrated (2015-06-05) from old issue tracker http://mirrorbrain.org/issues/issue38

Title    add magnet links to Metalinks
 Priority   wish    Status   in-progress
Superseder        Nosy List  ant, poeml
Assigned To poeml  Keywords

                           Files

File name Uploaded Type Edit Remove
dax33.html funnycafeteria6, 2013-10-18.20:49:40 html

msg130 (view) Author: poeml Date: 2010-02-16.17:29:36

The planned redesign of the hash cache will (should) also allow to trivially add
magnet links into metalinks.

See http://en.wikipedia.org/wiki/Magnet_URI_scheme

msg147 (view) Author: poeml Date: 2010-03-10.00:16:17

For now, this is blocked by issue 40.

msg152 (view) Author: poeml Date: 2010-03-12.00:02:46

Issue #40 is resolved far enough so to not block this change anymore.

msg153 (view) Author: poeml Date: 2010-03-12.00:33:54

For Magnet links, we need to base32-encode stuff in Apache.

h = hashlib.sha1()
h.update('asdf')
base64.b32encode(h.digest())
'HWSUCVMZDCUARQSAFO5FAEXWYYFSOZQ4'

msg154 (view) Author: poeml Date: 2010-03-12.00:52:44

Ah, I'm relieved:

http://wiki.bitcomet.com/Peers,_seeds,_torrent,_tracker,_DHT,_Peer_Exchange_(PEX),_Magnet_Links
The first implementations for Magnet Links required that the
BitTorrent hash values contained in Magnet Links be Base32
encoded.^[7] Later that was changed to hex encoding, which is the
format recommended at this point for magnet links by the official
BitTorrent specifications.^[8]
[8] http://www.bittorrent.org/beps/bep_0009.html#magnet-uri-format

msg155 (view) Author: poeml Date: 2010-03-12.02:00:39

Basic magnet links implemented in new metalinks now. (r7988)

I think the magnet links should be shown in the mirror list as well.

Also there should be a handler that replies with the magnet link (or
redirects to one??) when .magnet is appended to an URL. Is that
possible?

msg156 (view) Author: poeml Date: 2010-03-12.02:01:53

Example:

% curl -s "http://192.168.0.115/extended/3.1.1rc2/OOo_3.1.1rc2_20090820_Win32Intel_langpack_sw-TZ.exe?meta4" | grep magnet
magnet:&xl=24822941&dn=OOo_3.1.1rc2_20090820_Win32Intel_langpack_sw-TZ.exe?xt=urn:sha1:0e1aefc1df0ba4c147fb36d3c62d000441e6b945?xt=urn:bith:0e1aefc1df0ba4c147fb36d3c62d000441e6b945&xt=urn:md5:c7feb5365c2e9ce205ba212c6fa19aa0

msg157 (view) Author: poeml Date: 2010-03-12.02:47:41

mediatype changed to "torrent". See metalink-discussion list for further
discussion.

msg176 (view) Author: poeml Date: 2010-03-31.20:30:46

The hashes that our current magnet links contain are not optimal.

(Info by Harold Feit following below.)

  • BTIH + MD5 magnets don't work that well
  • although we CAN get away with it on single-file torrents
  • it would never work right on batches
  • and clients that support magnets, but not torrent magnets don't use MD5 as their
    search key
  • they usually use SHA1
  • which, in a magnet, needs to be Base32 encoded

On the URL http://opensource.depthstrike.com/, several examples can be found.

msg180 (view) Author: poeml Date: 2010-04-23.02:53:24

Further note:

as= and xs= are compatible with the sha1 Magnets. But not btih ones.

Minimal example for an SHA1 Magnet:
xt=urn:sha1:<file's base32 encoded sha1 hash>&xl=<file's size>&dn=<file's
name>&as=

History
         Date              User       Action              Args
2013-10-18 20:49:40 funnycafeteria6 set    files: + dax33.html
2010-04-23 02:53:24 poeml           set    messages: + msg180
2010-03-31 20:30:46 poeml           set    messages: + msg176
2010-03-29 06:45:04 ant             set    nosy: + ant
2010-03-12 02:47:41 poeml           set    messages: + msg157
2010-03-12 02:01:53 poeml           set    messages: + msg156
2010-03-12 02:00:40 poeml           set    status: deferred -> in-progress
                                             messages: + msg155
2010-03-12 00:52:44 poeml           set    messages: + msg154
2010-03-12 00:33:54 poeml           set    messages: + msg153
2010-03-12 00:02:46 poeml           set    messages: + msg152
2010-03-10 00:18:06 poeml           set    assignedto: poeml
2010-03-10 00:16:17 poeml           set    status: chatting -> deferred
                                             messages: + msg147
2010-02-16 17:29:37 poeml           create

(end of migrated issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant