Members
(readonly) LinkType
Music links enum
Name | Type | Description |
---|---|---|
Music | 0 | Music type |
Playlist | 1 | Playlist type |
Album | 2 | Album type |
Video | 3 | Video type |
Podcast | 4 | Podcast type |
TV | 5 | TV type |
Methods
downloadMusicViaURL(url, qualityopt) → {Promise.<Readable>}
Used to download music via its URL
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
url | string | Music's url | ||
quality | "hq" | "lq" | <optional> | hq | Music quality |
- Type:
- Promise.<Readable>
const readable = await Rj.downloadMusicViaURL("https://play.radiojavan.com/song/Koorosh-Un-Momento-(Ft-Raha)")
readable.pipe(fs.createWriteStream("Koorosh-Un-Momento.mp3"))
downloadPodcastViaURL(url, qualityopt) → {Promise.<Readable>}
Used to download podcast via its URL
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
url | string | Podcast's url | ||
quality | "hq" | "lq" | <optional> | hq | Podcast quality Bear in mind that sometimes |
- Type:
- Promise.<Readable>
const readable = await Rj.downloadPodcastViaURL("https://play.radiojavan.com/podcast/Abo-Atash-119")
readable.pipe(fs.createWriteStream("Abo-Atash-119.mp3")
downloadVideoViaURL(url, qualityopt) → {Promise.<Readable>}
Used to download video via its URL
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
url | string | Video's url | ||
quality | "hq" | "lq" | <optional> | hq | Video quality |
- Type:
- Promise.<Readable>
const readable = await Rj.downloadVideoViaURL("https://play.radiojavan.com/video/gdaal-madgal-banafsh")
readable.pipe(fs.createWriteStream("gdaal-madgal-banafsh.mp4")
formatURL(url) → {string}
Used to format a radio javan url into a standard form
Name | Type | Description |
---|---|---|
url | string |
Formatted url
- Type:
- string
const formatted = Rj.formatURL("www.play.radiojavan.com/song");
console.log(formatted) // https://play.radiojavan.com/song
getAlbum(url) → {Promise.<AlbumInfo>}
Used to get album info based on its url
Name | Type | Description |
---|---|---|
url | string | Album's url |
- Type:
- Promise.<AlbumInfo>
const info = await Rj.getAlbum("https://play.radiojavan.com/album/Koorosh-420")
console.log(info.title) // "420"
console.log(info.artist) // "Koorosh"
console.log(info.tracks) // [ AlbumTrack , ... ]
getLinkType(url) → {LinkType}
Used to get url link type
Name | Type | Description |
---|---|---|
url | string |
- Type:
- LinkType
const type = Rj.getLinkType("https://radiojavan.com/mp3s/mp3/Koorosh-Greenwich-(Ft-Salaar)")
console.log(type === Rj.LinkType.Music) // true
getMusic(url) → {Promise.<Music>}
Used to get music info and provide an optimized getDownloadLinks
function
Name | Type | Description |
---|---|---|
url | string |
- Type:
- Promise.<Music>
const music = await Rj.getMusic("https://play.radiojavan.com/song/Koorosh-Yebaram-Man-(Ft-Arta-Behzad-Leito-Raha)");
console.log(music.title); // Yebaram Man
const downloadLinks = await music.getDownloadLinks();
console.log(downloadLinks.midQuality) // mid quality download link (256)
getMusicDownloadLinksViaURL(url) → {Promise.<DownloadLinks>}
Used to get music download links via its url
Name | Type | Description |
---|---|---|
url | string | Music's url |
- Type:
- Promise.<DownloadLinks>
const links = await Rj.getMusicDownloadLinksViaURL("https://play.radiojavan.com/song/Koorosh-Yebaram-Man-(Ft-Arta-Behzad-Leito-Raha)")
// mid quality download link (256)
console.log(links.midQuality)
// high quality download link (320)
console.log(links.highQuality)
getPlaylist(url) → {Promise.<PlaylistInfo>}
Used to get playlist info based on its url
Name | Type | Description |
---|---|---|
url | string | Playlist's url |
- Type:
- Promise.<PlaylistInfo>
const info = await Rj.getPlaylist("https://play.radiojavan.com/playlist/mp3/dec52eeff468")
console.log(info.title) // "Acoustic"
console.log(info.creator) // "Radio Javan"
console.log(info.tracks) // [ Track , ... ]
getPodcast(url) → {Promise.<Podcast>}
Used to get podcast info and provide an optimized getDownloadLinks
function
Name | Type | Description |
---|---|---|
url | string |
- Type:
- Promise.<Podcast>
const podcast = await Rj.getPodcast("https://play.radiojavan.com/podcast/Dance-Station-35");
console.log(podcast.title); // Dance Station 35
const downloadLinks = await podcast.getDownloadLinks();
console.log(downloadLinks.midQuality) // mid quality download link (192)
getPodcastDownloadLinksViaURL(url) → {Promise.<DownloadLinks>}
Used to get podcast download links via its url
Bear in mind that sometimes mid and high qualities can be the same
Name | Type | Description |
---|---|---|
url | string | Podcast's url |
- Type:
- Promise.<DownloadLinks>
const links = await Rj.getPodcastDownloadLinksViaURL("https://play.radiojavan.com/podcast/Dance-Station-35")
// mid quality download link (192)
console.log(links.midQuality)
// high quality download link (320)
console.log(links.highQuality)
getVideo(url) → {Promise.<Video>}
Used to get video info and provide an optimized getDownloadLinks
function
Name | Type | Description |
---|---|---|
url | string |
- Type:
- Promise.<Video>
const video = await Rj.getVideo("https://play.radiojavan.com/video/donya-bye-bye-bye");
console.log(video.title); // Bye Bye Bye
const downloadLinks = await video.getDownloadLinks();
console.log(downloadLinks.midQuality) // mid quality download link
getVideoDownloadLinksViaURL(url) → {Promise.<DownloadLinks>}
Used to get video download links via its url
Name | Type | Description |
---|---|---|
url | string | Video's url |
- Type:
- Promise.<DownloadLinks>
const links = await Rj.getVideoDownloadLinksViaURL("https://play.radiojavan.com/video/donya-bye-bye-bye")
// mid quality download link
console.log(links.midQuality)
// high quality download link
console.log(links.highQuality)
validateURL(url) → {boolean}
Used to check whether the url is valid or not
Only the urls which their type is recognizable are considered valid
Recognizable types are defiled in LinkType
Name | Type | Description |
---|---|---|
url | string |
- Type:
- boolean
Type Definitions
DownloadLinks
PropertiesName | Type | Description |
---|---|---|
midQuality | string | Middle quality download link |
highQuality | string | high quality download link |