Update index.js
Browse files
index.js
CHANGED
|
@@ -140,10 +140,8 @@ const app = express()
|
|
| 140 |
const id = match[1];
|
| 141 |
const query = match[2] || ''; // Jika tidak ada query, gunakan string kosong
|
| 142 |
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
fileURL += `#${query}`;
|
| 146 |
-
}
|
| 147 |
|
| 148 |
const file = File.fromURL(fileURL);
|
| 149 |
await file.loadAttributes();
|
|
@@ -159,4 +157,5 @@ const app = express()
|
|
| 159 |
res.json({ message: error.message });
|
| 160 |
}
|
| 161 |
})
|
|
|
|
| 162 |
.listen(7860, () => console.log('App running on port 7860'));
|
|
|
|
| 140 |
const id = match[1];
|
| 141 |
const query = match[2] || ''; // Jika tidak ada query, gunakan string kosong
|
| 142 |
|
| 143 |
+
// If there's a query, add a hash symbol to the URL
|
| 144 |
+
const fileURL = query ? `https://mega.nz/file/${id}#${query}` : `https://mega.nz/file/${id}`;
|
|
|
|
|
|
|
| 145 |
|
| 146 |
const file = File.fromURL(fileURL);
|
| 147 |
await file.loadAttributes();
|
|
|
|
| 157 |
res.json({ message: error.message });
|
| 158 |
}
|
| 159 |
})
|
| 160 |
+
|
| 161 |
.listen(7860, () => console.log('App running on port 7860'));
|