mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-09-27 20:11:15 +02:00
feat: centralize isPlaylistUrl function as a helper that could be upgraded in the future
This commit is contained in:
12
server/helpers/playlist.helpers.js
Normal file
12
server/helpers/playlist.helpers.js
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Determines whether a URL targets a playlist.
|
||||
*
|
||||
* The detection is based on the presence of the YouTube
|
||||
* playlist query parameter (`list`).
|
||||
*
|
||||
* @param {string} url - URL to inspect.
|
||||
* @returns {boolean} True if the URL appears to be a playlist.
|
||||
*/
|
||||
export function isUrlPlaylist(url) {
|
||||
return url.includes("?list=") || url.includes("&list=") || url.includes("@");
|
||||
}
|
||||
Reference in New Issue
Block a user