mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-20 14:06:09 +05:00
torrent source regex added
This commit is contained in:
@@ -21,3 +21,9 @@ export const checkImageURL = async url => {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const magnetRegex = /magnet:\?xt=urn:[a-z0-9]{20,50}/i
|
||||
const hashRegex = /\b[0-9a-f]{32}\b|\b[0-9a-f]{40}\b|\b[0-9a-f]{64}\b/i
|
||||
const torrentRegex = /^.*\.(torrent)$/i
|
||||
export const chechTorrentSource = source =>
|
||||
source.match(hashRegex) !== null || source.match(magnetRegex) !== null || source.match(torrentRegex) !== null
|
||||
|
||||
Reference in New Issue
Block a user