-
Notifications
You must be signed in to change notification settings - Fork 0
getVideoId
LakhindarPal edited this page May 12, 2024
·
1 revision
getVideoId(
url
):number
Extracts the video ID from a given URL.
-
url:
string
The URL from which to extract the video ID.
number
- The extracted video ID, or NaN if the URL does not match the expected format.
const { getVideoId } = require("tidal-music-api");
// example url
const url = "https://tidal.com/browse/video/319408964";
const id = getVideoId(url);
if (id) console.log(id);
else console.log("Invalid URL");