HLSDownloaderUtils

HLSDownloaderUtils

Utility module for HLSDownloader

Methods

(static) isNotFunction(fn) → {boolean}

Parameters:
NameTypeDescription
fnfunction

function to validate

Author
  • Nur Rony<pro.nmrony@gmail.com> Checks parameter is a function or not
Returns:
Type: 
boolean

(static) isValidPlaylist(playlistContent) → {boolean}

Validate a Playlist

Parameters:
NameTypeDescription
playlistContentstring

Content of playlist file

Author
  • Nur Rony<pro.nmrony@gmail.com>
Returns:
Type: 
boolean

(static) isValidUrl(url, protocolsopt) → {boolean}

Check if the url is valid

Parameters:
NameTypeAttributesDescription
urlstring

string to check

protocolsArray.<string><optional>

supported protocols

Author
  • Nur Rony<pro.nmrony@gmail.com>
Throws:
  • TypeError

  • ProtocolNotSupported

Returns:
Type: 
boolean

(static) omit(…keys, subject) → {object}

omit given keys from an object.

Parameters:
NameTypeAttributesDescription
keysany<repeatable>

keys to remove from the object

subjectobject

object to remove the keys form

Author
  • Nur Rony<pro.nmrony@gmail.com>
Returns:
Type: 
object

(static) parseUrl(url) → {object}

Validate a Playlist

Parameters:
NameTypeDescription
urlstring

url to parse

Author
  • Nur Rony<pro.nmrony@gmail.com>
Throws:

TypeError

Returns:
Type: 
object

(static) stripFirstSlash(url) → {String}

Strip first slash from a url / path

Parameters:
NameTypeDescription
urlString

URL to strip the slash

Author
  • Nur Rony<pro.nmrony@gmail.com>
Returns:

Stripped url

Type: 
String