Closed fjkda closed 1 year ago
Something like: http://localhost/transmission/web/?uri=magnet:?xt=urn:btih:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&dn=LinuxDistribution[abc]&tr=udp%3A%2F%2Fxyz.com%3A80%2Fannounce&tr=udp%3A%2F%2Fabc.com%3A6969%2Fannounce
https://github.com/killemov/Shift/blob/c56c5d647f8e95ae194a23af0dd9aa2656abe62d/shift.js#L254
Suggest this that also matches parenthesis: const torrentRegExp = /(\b(https?|ftp|magnet):\/?\/?[\-A-Z0-9()[\]+&@#\/%?=~_|!:,.;]*[\-A-Z0-9()[\]+&@#\/%=~_|])/ig;
const torrentRegExp = /(\b(https?|ftp|magnet):\/?\/?[\-A-Z0-9()[\]+&@#\/%?=~_|!:,.;]*[\-A-Z0-9()[\]+&@#\/%=~_|])/ig;
AFAIK [ and ] must also be encoded. See Reserved characters in https://www.urldecoder.org/ .
[
]
Reserved characters
Ah, maybe it's on the site generating the links then
Something like: http://localhost/transmission/web/?uri=magnet:?xt=urn:btih:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&dn=LinuxDistribution[abc]&tr=udp%3A%2F%2Fxyz.com%3A80%2Fannounce&tr=udp%3A%2F%2Fabc.com%3A6969%2Fannounce
https://github.com/killemov/Shift/blob/c56c5d647f8e95ae194a23af0dd9aa2656abe62d/shift.js#L254
Suggest this that also matches parenthesis:
const torrentRegExp = /(\b(https?|ftp|magnet):\/?\/?[\-A-Z0-9()[\]+&@#\/%?=~_|!:,.;]*[\-A-Z0-9()[\]+&@#\/%=~_|])/ig;