Closed buffolollo closed 2 months ago
Could you attach your code with the search terms please? It seems to be working fine for me.
if (spotify.validateTrackURL(query)) {
const data = await spotify.getTrack(query);
const searchQuery = ${data.name} ${getNameArtist(data.artists)}
;
console.log(searchQuery);
const res = await search(searchQuery, {
filterType: "video",
});
console.log(res);
}
so far it only gives me this error with this link:
https://open.spotify.com/track/6VOoSi7mgFrKCeymxG6wKB?si=d8e1d5dcd0af464b
searchQuery: DISCO PARADISE Fedez Annalisa Articolo 31
sometimes when I search certain songs it still gives me this error:
Error: Failed to parse contents from data. (SyntaxError: Unexpected token } in JSON at position 8636)
at /home/buffolollo/DrummerTS/node_modules/youtube-ext/dist/search.js:56:15
at Generator.next (
sometimes when I search certain songs it still gives me this error:
Error: Failed to parse contents from data. (SyntaxError: Unexpected token } in JSON at position 8636) at /home/buffolollo/DrummerTS/node_modules/youtube-ext/dist/search.js:56:15 at Generator.next () at fulfilled (/home/buffolollo/DrummerTS/node_modules/youtube-ext/dist/search.js:5:58) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Unless I have steps to reproduce this issue, I cannot help with it.
With some searches it gives me this error:
Error: Failed to parse contents from data. (SyntaxError: Unexpected token } in JSON at position 8768)
at /home/buffolollo/DrummerTS/node_modules/youtube-ext/dist/search.js:56:15
at Generator.next (
code: import { search } from "youtube-ext"; const res = await search(query, { filterType: "video" }); if (res.videos.length < 1 || !res) return error(message, "I have not found any video!");
these are some queries: (examples)
I get this error sometimes when I search for certain songs
Not sure if this is still relevant, kindly re-open if so.
Full error message: Error: Failed to parse contents from data. (SyntaxError: Unexpected token } in JSON at position 8653) at /home/buffolollo/DrummerTS/node_modules/youtube-ext/dist/search.js:56:15 at Generator.next ()
at fulfilled (/home/buffolollo/DrummerTS/node_modules/youtube-ext/dist/search.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)