Skip to content

getVideoId

LakhindarPal edited this page May 12, 2024 · 1 revision

Method: getVideoId()

getVideoId(url): number

Extracts the video ID from a given URL.

Parameters

  • url: string

The URL from which to extract the video ID.

Returns

number

  • The extracted video ID, or NaN if the URL does not match the expected format.

Usage

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");
Clone this wiki locally