feat(p2p): file transfer p2p feature
This commit is contained in:
8
src/background/magnetParse.js
Normal file
8
src/background/magnetParse.js
Normal file
@ -0,0 +1,8 @@
|
||||
module.exports = (magnet) => {
|
||||
const match = /magnet:\?xt=urn:btih:([0-9a-f]+)/i.exec(magnet)
|
||||
if(!match)
|
||||
return
|
||||
if(match[1].length === 40)
|
||||
return match[1].toLowerCase()
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user