mikmc5 commited on
Commit
4b287a3
·
verified ·
1 Parent(s): 6b7981d

Update rutor.js

Browse files
Files changed (1) hide show
  1. rutor.js +7 -2
rutor.js CHANGED
@@ -35,9 +35,14 @@ function extractInfoHash(magnetLink) {
35
  return match ? match[1] : null;
36
  }
37
 
38
- // ✅ Removes the year from queries
39
  function cleanQuery(query) {
40
- return query.replace(/\(\d{4}\)/g, '').trim(); // Removes (YYYY)
 
 
 
 
 
41
  }
42
 
43
  // ✅ Decodes Unicode escape sequences
 
35
  return match ? match[1] : null;
36
  }
37
 
38
+ // ✅ Removes the year and brackets from queries
39
  function cleanQuery(query) {
40
+ return query
41
+ .replace(/\(\d{4}\)/g, '') // Removes (YYYY)
42
+ .replace(/\[\d{4}\]/g, '') // Removes [YYYY]
43
+ .replace(/\{\d{4}\}/g, '') // Removes {YYYY}
44
+ .replace(/\s+/g, ' ') // Replace multiple spaces with single space
45
+ .trim(); // Remove leading/trailing whitespace
46
  }
47
 
48
  // ✅ Decodes Unicode escape sequences