Update server.js
Browse files
server.js
CHANGED
|
@@ -50,7 +50,7 @@ app.all('/play', async(req, res) => {
|
|
| 50 |
app.all('/track/:id', async(req, res) => {
|
| 51 |
try {
|
| 52 |
const { id } = req.params || res.params
|
| 53 |
-
if(!id
|
| 54 |
const spotify = await Spotify.download(`https://open.spotify.com/track/${id}`)
|
| 55 |
res.redirect(spotify?.download)
|
| 56 |
} catch(e) {
|
|
|
|
| 50 |
app.all('/track/:id', async(req, res) => {
|
| 51 |
try {
|
| 52 |
const { id } = req.params || res.params
|
| 53 |
+
if(!id) return res.json({ status: false, error: "Track ID is not valid." })
|
| 54 |
const spotify = await Spotify.download(`https://open.spotify.com/track/${id}`)
|
| 55 |
res.redirect(spotify?.download)
|
| 56 |
} catch(e) {
|