+ const playlistExists = await VideoStreamingPlaylistModel.doesInfohashExistCached(infoHash)
+ if (playlistExists === true) return cb()
+
+ cb(new Error(`Unknown infoHash ${infoHash} requested by ip ${ip}`))
+
+ // Close socket connection and block IP for a few time
+ if (params.type === 'ws') {
+ blockedIPs.set(ip, true)
+
+ // setTimeout to wait filter response
+ setTimeout(() => params.socket.close(), 0)
+ }
+ } catch (err) {
+ logger.error('Error in tracker filter.', { err })
+ return cb(err)
+ }