Spaces:
Paused
Paused
Update server.js
Browse files
server.js
CHANGED
|
@@ -127,13 +127,16 @@ app.get("/search", async (req, res) => {
|
|
| 127 |
|
| 128 |
// **Clean up movie title**
|
| 129 |
movieTitle = movieTitle
|
| 130 |
-
.replace(/[_\.-]/g, " ") // Replace underscores and hyphens
|
| 131 |
.replace(/\b(BluRay|HD|720p|1080p|480p|fzmovies|net|mp4|mkv|avi)\b/gi, "") // Remove extra words
|
|
|
|
|
|
|
| 132 |
.replace(/\s+/g, " ") // Remove extra spaces
|
|
|
|
| 133 |
.trim();
|
| 134 |
|
| 135 |
// **Remove everything after .mp4, .mkv, etc.**
|
| 136 |
-
const cleanedDownloadURL = finalDownloadURL.match(/(.*\.(mp4|mkv|avi))/i);
|
| 137 |
const finalLink = cleanedDownloadURL ? cleanedDownloadURL[1] : finalDownloadURL;
|
| 138 |
|
| 139 |
console.log(`Cleaned Movie Title: ${movieTitle}`);
|
|
|
|
| 127 |
|
| 128 |
// **Clean up movie title**
|
| 129 |
movieTitle = movieTitle
|
| 130 |
+
.replace(/[_\.-]/g, " ") // Replace underscores and hyphens with spaces
|
| 131 |
.replace(/\b(BluRay|HD|720p|1080p|480p|fzmovies|net|mp4|mkv|avi)\b/gi, "") // Remove extra words
|
| 132 |
+
.replace(/\(\s*\)/g, "") // Remove empty parentheses
|
| 133 |
+
.replace(/\b(\d{4})\b.*\b\1\b/, "$1") // Remove duplicate years
|
| 134 |
.replace(/\s+/g, " ") // Remove extra spaces
|
| 135 |
+
.replace(/\b[a-f0-9]{32}\b/, "") // Remove hash codes (MD5-like)
|
| 136 |
.trim();
|
| 137 |
|
| 138 |
// **Remove everything after .mp4, .mkv, etc.**
|
| 139 |
+
const cleanedDownloadURL = finalDownloadURL.match(/(.*\.(mp4|mkv|mov|avi))/i);
|
| 140 |
const finalLink = cleanedDownloadURL ? cleanedDownloadURL[1] : finalDownloadURL;
|
| 141 |
|
| 142 |
console.log(`Cleaned Movie Title: ${movieTitle}`);
|