-
Notifications
You must be signed in to change notification settings - Fork 0
getURLType
LakhindarPal edited this page May 12, 2024
·
1 revision
getURLType(
url
):string
|null
Extracts the type of URL from a Tidal URL.
-
url:
string
The Tidal URL to extract the type from.
string
| null
- The type of URL extracted from the input URL, or null if the URL does not match the expected format.
- The value will be
TRACK
,VIDEO
,ALBUM
,PLAYLIST
,MIX
,ARTIST
ornull
const { getURLType } = require("tidal-music-api");
// example url
const url = "https://tidal.com/browse/track/188267445";
const type = getURLType(url);
if (!type) console.log("Invalid URL");
else console.log(type);