Skip to content

Commit 98f9297

Browse files
committed
Document get_playlist2()
1 parent 47b213a commit 98f9297

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

doc/index.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,3 +518,44 @@ The returned dict contains the following keys:
518518
>>>
519519
>>> playlist['items'][21]['pafy'].getbest().url
520520
u'http://r4---sn-4g57knzr.googlevideo.com/videoplayback?ipbits=0&ratebypas...'
521+
522+
523+
The :func:`pafy.get_playlist2` serves the same purpose as the :func:`pafy.get_playlist`, but uses version 3 of youtube's api, making it able to retrieve playlists of over 200 items. It also provides a different interface, returning a :class:`pafy.Playlist` instead of a dictionary.
524+
525+
.. function:: pafy.get_playlist2(playlist_url[, basic=False][, gdata=False][, signature=False][, size=False][, callback=None])
526+
527+
:param playlist_url: The YouTube playlist url
528+
:type playlist_url: str
529+
:param basic: fetch basic metadata and streams
530+
:type basic: bool
531+
:param gdata: fetch gdata info (upload date, description, category, username, likes, dislikes)
532+
:type gdata: bool
533+
:param signature: fetch data required to decrypt urls, if encrypted
534+
:type signature: bool
535+
:param size: fetch the size of each stream (slow)(decrypts urls if needed)
536+
:type size: bool
537+
:param callback: a callback function to receive status strings
538+
:type callback: function
539+
:rtype: :class:`pafy.Playlist`
540+
541+
Playlist Attributes
542+
-------------------
543+
544+
Once you have retrieved a playlist with :func:`pafy.get_playlist2` you can iterate over it to get the Pafy objects for the items in it, or use `len(playlist)` to get its length. In addition, you can access the following attributes:
545+
546+
.. attribute:: Pafy.plid
547+
548+
The ID of the playlist (*str*)
549+
550+
.. attribute:: Pafy.title
551+
552+
The title of the playlist (*str*)
553+
554+
.. attribute:: Pafy.author
555+
556+
The author of the playlist (*str*)
557+
558+
.. attribute:: Pafy.description
559+
560+
The description of the playlist (*str*)
561+

0 commit comments

Comments
 (0)