52 lines
29 KiB
HTML
52 lines
29 KiB
HTML
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>SpotifyPlaylist | play-dl</title><meta name="description" content="Documentation for play-dl"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">play-dl</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">play-dl</a></li><li><a href="../modules/_internal_.html"><internal></a></li><li><a href="_internal_.SpotifyPlaylist.html">SpotifyPlaylist</a></li></ul><h1>Class SpotifyPlaylist</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist Class</p>
|
|
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">SpotifyPlaylist</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#collaborative" class="tsd-kind-icon">collaborative</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#description" class="tsd-kind-icon">description</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="_internal_.SpotifyPlaylist.html#fetched_tracks" class="tsd-kind-icon">fetched_<wbr/>tracks</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#id" class="tsd-kind-icon">id</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#name" class="tsd-kind-icon">name</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#owner" class="tsd-kind-icon">owner</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="_internal_.SpotifyPlaylist.html#spotifyData" class="tsd-kind-icon">spotify<wbr/>Data</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#thumbnail" class="tsd-kind-icon">thumbnail</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#tracksCount" class="tsd-kind-icon">tracks<wbr/>Count</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#type" class="tsd-kind-icon">type</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#url" class="tsd-kind-icon">url</a></li></ul></section><section class="tsd-index-section "><h3>Accessors</h3><ul class="tsd-index-list"><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#total_pages" class="tsd-kind-icon">total_<wbr/>pages</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#total_tracks" class="tsd-kind-icon">total_<wbr/>tracks</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#fetch" class="tsd-kind-icon">fetch</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#page" class="tsd-kind-icon">page</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#toJSON" class="tsd-kind-icon">toJSON</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"><a id="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">new <wbr/>Spotify<wbr/>Playlist<span class="tsd-signature-symbol">(</span>data<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, spotifyData<span class="tsd-signature-symbol">: </span><a href="../interfaces/_internal_.SpotifyDataOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">SpotifyDataOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.SpotifyPlaylist.html" class="tsd-signature-type" data-tsd-kind="Class">SpotifyPlaylist</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L223">play-dl/Spotify/classes.ts:223</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Constructor for Spotify Playlist Class</p>
|
|
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>data: <span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>JSON parsed data of playlist</p>
|
|
</div></div></li><li><h5>spotifyData: <a href="../interfaces/_internal_.SpotifyDataOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">SpotifyDataOptions</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Data about sporify token for furhter fetching.</p>
|
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="_internal_.SpotifyPlaylist.html" class="tsd-signature-type" data-tsd-kind="Class">SpotifyPlaylist</a></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="collaborative" class="tsd-anchor"></a><h3>collaborative</h3><div class="tsd-signature tsd-kind-icon">collaborative<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L181">play-dl/Spotify/classes.ts:181</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist collaborative boolean.</p>
|
|
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="description" class="tsd-anchor"></a><h3>description</h3><div class="tsd-signature tsd-kind-icon">description<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L185">play-dl/Spotify/classes.ts:185</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist Description</p>
|
|
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private"><a id="fetched_tracks" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagPrivate">Private</span> fetched_<wbr/>tracks</h3><div class="tsd-signature tsd-kind-icon">fetched_<wbr/>tracks<span class="tsd-signature-symbol">:</span> <a href="../modules/_internal_.html" class="tsd-signature-type" data-tsd-kind="Namespace"><internal></a><span class="tsd-signature-symbol">.</span><a href="../modules/_internal_.html#Map-1" class="tsd-signature-type" data-tsd-kind="Variable">Map</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><a href="_internal_.SpotifyTrack.html" class="tsd-signature-type" data-tsd-kind="Class">SpotifyTrack</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L217">play-dl/Spotify/classes.ts:217</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist fetched tracks Map</p>
|
|
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="id" class="tsd-anchor"></a><h3>id</h3><div class="tsd-signature tsd-kind-icon">id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L193">play-dl/Spotify/classes.ts:193</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist ID</p>
|
|
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="name" class="tsd-anchor"></a><h3>name</h3><div class="tsd-signature tsd-kind-icon">name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L173">play-dl/Spotify/classes.ts:173</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist Name</p>
|
|
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="owner" class="tsd-anchor"></a><h3>owner</h3><div class="tsd-signature tsd-kind-icon">owner<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_internal_.SpotifyArtists.html" class="tsd-signature-type" data-tsd-kind="Interface">SpotifyArtists</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L201">play-dl/Spotify/classes.ts:201</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist Owner Artist data</p>
|
|
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private"><a id="spotifyData" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagPrivate">Private</span> spotify<wbr/>Data</h3><div class="tsd-signature tsd-kind-icon">spotify<wbr/>Data<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_internal_.SpotifyDataOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">SpotifyDataOptions</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L211">play-dl/Spotify/classes.ts:211</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist Spotify data</p>
|
|
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="thumbnail" class="tsd-anchor"></a><h3>thumbnail</h3><div class="tsd-signature tsd-kind-icon">thumbnail<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_internal_.SpotifyThumbnail.html" class="tsd-signature-type" data-tsd-kind="Interface">SpotifyThumbnail</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L197">play-dl/Spotify/classes.ts:197</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist Thumbnail Data</p>
|
|
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="tracksCount" class="tsd-anchor"></a><h3>tracks<wbr/>Count</h3><div class="tsd-signature tsd-kind-icon">tracks<wbr/>Count<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L205">play-dl/Spotify/classes.ts:205</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist total tracks Count</p>
|
|
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="type" class="tsd-anchor"></a><h3>type</h3><div class="tsd-signature tsd-kind-icon">type<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"album"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"playlist"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"track"</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L177">play-dl/Spotify/classes.ts:177</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Class type. == "playlist"</p>
|
|
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="url" class="tsd-anchor"></a><h3>url</h3><div class="tsd-signature tsd-kind-icon">url<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L189">play-dl/Spotify/classes.ts:189</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist URL</p>
|
|
</div></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Accessors</h2><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="total_pages" class="tsd-anchor"></a><h3>total_<wbr/>pages</h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> total_pages<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L321">play-dl/Spotify/classes.ts:321</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist total no of pages in a playlist</p>
|
|
</div><div><p>For getting all songs in a playlist,</p>
|
|
<pre><code class="language-ts"><span class="hl-2">const</span><span class="hl-0"> </span><span class="hl-6">playlist</span><span class="hl-0"> = </span><span class="hl-1">await</span><span class="hl-0"> </span><span class="hl-3">play</span><span class="hl-0">.</span><span class="hl-7">spotify</span><span class="hl-0">(</span><span class="hl-4">'playlist url'</span><span class="hl-0">)</span><br/><br/><span class="hl-1">await</span><span class="hl-0"> </span><span class="hl-3">playlist</span><span class="hl-0">.</span><span class="hl-7">fetch</span><span class="hl-0">()</span><br/><br/><span class="hl-2">const</span><span class="hl-0"> </span><span class="hl-6">result</span><span class="hl-0"> = []</span><br/><br/><span class="hl-1">for</span><span class="hl-0"> (</span><span class="hl-2">let</span><span class="hl-0"> </span><span class="hl-3">i</span><span class="hl-0"> = </span><span class="hl-8">0</span><span class="hl-0">; </span><span class="hl-3">i</span><span class="hl-0"> <= </span><span class="hl-3">playlist</span><span class="hl-0">.</span><span class="hl-3">tota_pages</span><span class="hl-0">; </span><span class="hl-3">i</span><span class="hl-0">++) {</span><br/><span class="hl-0"> </span><span class="hl-3">result</span><span class="hl-0">.</span><span class="hl-7">push</span><span class="hl-0">(</span><span class="hl-3">playlist</span><span class="hl-0">.</span><span class="hl-7">page</span><span class="hl-0">(</span><span class="hl-3">i</span><span class="hl-0">))</span><br/><span class="hl-0">}</span>
|
|
</code></pre>
|
|
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="total_tracks" class="tsd-anchor"></a><h3>total_<wbr/>tracks</h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> total_tracks<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L327">play-dl/Spotify/classes.ts:327</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist total no of tracks that have been fetched so far.</p>
|
|
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="fetch" class="tsd-anchor"></a><h3>fetch</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">fetch<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules/_internal_.html" class="tsd-signature-type" data-tsd-kind="Namespace"><internal></a><span class="tsd-signature-symbol">.</span><a href="../modules/_internal_.html#Promise-1" class="tsd-signature-type" data-tsd-kind="Variable">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="_internal_.SpotifyPlaylist.html" class="tsd-signature-type" data-tsd-kind="Class">SpotifyPlaylist</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L251">play-dl/Spotify/classes.ts:251</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Fetches Spotify Playlist tracks more than 100 tracks.</p>
|
|
</div><div><p>For getting all tracks in playlist, see <code>total_pages</code> property.</p>
|
|
</div></div><h4 class="tsd-returns-title">Returns <a href="../modules/_internal_.html" class="tsd-signature-type" data-tsd-kind="Namespace"><internal></a><span class="tsd-signature-symbol">.</span><a href="../modules/_internal_.html#Promise-1" class="tsd-signature-type" data-tsd-kind="Variable">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="_internal_.SpotifyPlaylist.html" class="tsd-signature-type" data-tsd-kind="Class">SpotifyPlaylist</a><span class="tsd-signature-symbol">></span></h4><div><p>Playlist Class.</p>
|
|
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="page" class="tsd-anchor"></a><h3>page</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">page<span class="tsd-signature-symbol">(</span>num<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.SpotifyTrack.html" class="tsd-signature-type" data-tsd-kind="Class">SpotifyTrack</a><span class="tsd-signature-symbol">[]</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L299">play-dl/Spotify/classes.ts:299</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Spotify Playlist tracks are divided in pages.</p>
|
|
</div><div><p>For example getting data of 101 - 200 videos in a playlist,</p>
|
|
<pre><code class="language-ts"><span class="hl-2">const</span><span class="hl-0"> </span><span class="hl-6">playlist</span><span class="hl-0"> = </span><span class="hl-1">await</span><span class="hl-0"> </span><span class="hl-3">play</span><span class="hl-0">.</span><span class="hl-7">spotify</span><span class="hl-0">(</span><span class="hl-4">'playlist url'</span><span class="hl-0">)</span><br/><br/><span class="hl-1">await</span><span class="hl-0"> </span><span class="hl-3">playlist</span><span class="hl-0">.</span><span class="hl-7">fetch</span><span class="hl-0">()</span><br/><br/><span class="hl-2">const</span><span class="hl-0"> </span><span class="hl-6">result</span><span class="hl-0"> = </span><span class="hl-3">playlist</span><span class="hl-0">.</span><span class="hl-7">page</span><span class="hl-0">(</span><span class="hl-8">2</span><span class="hl-0">)</span>
|
|
</code></pre>
|
|
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>num: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Page Number</p>
|
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="_internal_.SpotifyTrack.html" class="tsd-signature-type" data-tsd-kind="Class">SpotifyTrack</a><span class="tsd-signature-symbol">[]</span></h4><div></div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="toJSON" class="tsd-anchor"></a><h3>toJSON</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">toJSON<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules/_internal_.html" class="tsd-signature-type" data-tsd-kind="Namespace"><internal></a><span class="tsd-signature-symbol">.</span><a href="../interfaces/_internal_.PlaylistJSON-1.html" class="tsd-signature-type" data-tsd-kind="Interface">PlaylistJSON</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/play-dl/play-dl/blob/56b1ebe/play-dl/Spotify/classes.ts#L335">play-dl/Spotify/classes.ts:335</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Converts Class to JSON</p>
|
|
</div></div><h4 class="tsd-returns-title">Returns <a href="../modules/_internal_.html" class="tsd-signature-type" data-tsd-kind="Namespace"><internal></a><span class="tsd-signature-symbol">.</span><a href="../interfaces/_internal_.PlaylistJSON-1.html" class="tsd-signature-type" data-tsd-kind="Interface">PlaylistJSON</a></h4><div><p>JSON data</p>
|
|
</div></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Exports</a></li><li class="current tsd-kind-namespace"><a href="../modules/_internal_.html"><internal></a><ul><li class=" tsd-kind-namespace tsd-parent-kind-namespace tsd-is-external"><a href="../modules/_internal_._node_stream_consumers_.html">"node:stream/consumers"</a></li><li class=" tsd-kind-namespace tsd-parent-kind-namespace tsd-is-external"><a href="../modules/_internal_._node_stream_promises_.html">"node:stream/promises"</a></li><li class=" tsd-kind-namespace tsd-parent-kind-namespace tsd-is-external"><a href="../modules/_internal_.EventEmitter.html">Event<wbr/>Emitter</a></li><li class=" tsd-kind-namespace tsd-parent-kind-namespace tsd-is-external"><a href="../modules/_internal_.internal.html">internal</a></li></ul></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class tsd-parent-kind-namespace"><a href="_internal_.SpotifyPlaylist.html" class="tsd-kind-icon">Spotify<wbr/>Playlist</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#collaborative" class="tsd-kind-icon">collaborative</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#description" class="tsd-kind-icon">description</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="_internal_.SpotifyPlaylist.html#fetched_tracks" class="tsd-kind-icon">fetched_<wbr/>tracks</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#id" class="tsd-kind-icon">id</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#name" class="tsd-kind-icon">name</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#owner" class="tsd-kind-icon">owner</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="_internal_.SpotifyPlaylist.html#spotifyData" class="tsd-kind-icon">spotify<wbr/>Data</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#thumbnail" class="tsd-kind-icon">thumbnail</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#tracksCount" class="tsd-kind-icon">tracks<wbr/>Count</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#type" class="tsd-kind-icon">type</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#url" class="tsd-kind-icon">url</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#total_pages" class="tsd-kind-icon">total_<wbr/>pages</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#total_tracks" class="tsd-kind-icon">total_<wbr/>tracks</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#fetch" class="tsd-kind-icon">fetch</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#page" class="tsd-kind-icon">page</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="_internal_.SpotifyPlaylist.html#toJSON" class="tsd-kind-icon">toJSON</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html> |