Skip to content

Commit 8ebf93f

Browse files
committed
fix: getMagnetLink v2 xt typo
closed: #10
1 parent d646aa8 commit 8ebf93f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/TorrentFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ public function getMagnetLink($dn = true, $tr = true)
501501

502502
$infoHashV2 = $this->getInfoHashV2();
503503
if ($infoHashV2) {
504-
$urlSearchParams[] = 'xt=url:btmh:' . '1220' . $infoHashV2; // 1220 is magic number
504+
$urlSearchParams[] = 'xt=urn:btmh:' . '1220' . $infoHashV2; // 1220 is magic number
505505
}
506506

507507
if ($dn) {

tests/traits/TorrentFileCommonTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,12 @@ public function testGetMagnetLink()
210210
}
211211

212212
if ($this->protocol === TorrentFile::PROTOCOL_V2) {
213-
$xtComponent = 'xt=url:btmh:1220' . $this->infoHashs[TorrentFile::PROTOCOL_V2];
213+
$xtComponent = 'xt=urn:btmh:1220' . $this->infoHashs[TorrentFile::PROTOCOL_V2];
214214
}
215215

216216
if ($this->protocol === TorrentFile::PROTOCOL_HYBRID) {
217217
$xtComponent = 'xt=urn:btih:' . $this->infoHashs[TorrentFile::PROTOCOL_V1] .
218-
'&xt=url:btmh:1220' . $this->infoHashs[TorrentFile::PROTOCOL_V2];
218+
'&xt=urn:btmh:1220' . $this->infoHashs[TorrentFile::PROTOCOL_V2];
219219
}
220220

221221
$name = $this->fileMode === TorrentFile::FILEMODE_MULTI ? 'tname' : 'file1.dat';

0 commit comments

Comments
 (0)