diff options
author | pukkandan <pukkandan@gmail.com> | 2021-02-25 01:16:57 +0530 |
---|---|---|
committer | pukkandan <pukkandan@gmail.com> | 2021-02-25 01:42:33 +0530 |
commit | 0744a815b734dcc80eeb93b1392ae6d06500f214 (patch) | |
tree | 577110611202b68540969fff3a2db747ac3aa684 /docs | |
parent | 7a5c1cfe93924351387b44919b3c0b2f66c4b883 (diff) | |
download | hypervideo-pre-0744a815b734dcc80eeb93b1392ae6d06500f214.tar.lz hypervideo-pre-0744a815b734dcc80eeb93b1392ae6d06500f214.tar.xz hypervideo-pre-0744a815b734dcc80eeb93b1392ae6d06500f214.zip |
[documentation] Changes left behind from #85 and #107
Diffstat (limited to 'docs')
-rw-r--r-- | docs/conf.py | 1 | ||||
-rw-r--r-- | docs/index.rst | 23 | ||||
-rw-r--r-- | docs/module_guide.rst | 66 |
3 files changed, 1 insertions, 89 deletions
diff --git a/docs/conf.py b/docs/conf.py index 58c0359e7..3fbf82f54 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,6 +30,7 @@ master_doc = 'index' # General information about the project. project = u'yt-dlp' +author = u'yt-dlp' copyright = u'UNLICENSE' # The version info for the project you're documenting, acts as replacement for diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 9be67038a..000000000 --- a/docs/index.rst +++ /dev/null @@ -1,23 +0,0 @@ -Welcome to yt-dlp's documentation! -====================================== - -*yt-dlp* is a command-line program to download videos from YouTube.com and more sites. -It can also be used in Python code. - -Developer guide ---------------- - -This section contains information for using *yt-dlp* from Python programs. - -.. toctree:: - :maxdepth: 2 - - module_guide - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/docs/module_guide.rst b/docs/module_guide.rst deleted file mode 100644 index d6a96a9cf..000000000 --- a/docs/module_guide.rst +++ /dev/null @@ -1,66 +0,0 @@ -Using the ``yt_dlp`` module -=============================== - -When using the ``yt_dlp`` module, you start by creating an instance of :class:`YoutubeDL` and adding all the available extractors: - -.. code-block:: python - - >>> from yt_dlp import YoutubeDL - >>> ydl = YoutubeDL() - >>> ydl.add_default_info_extractors() - -Extracting video information ----------------------------- - -You use the :meth:`YoutubeDL.extract_info` method for getting the video information, which returns a dictionary: - -.. code-block:: python - - >>> info = ydl.extract_info('http://www.youtube.com/watch?v=BaW_jenozKc', download=False) - [youtube] Setting language - [youtube] BaW_jenozKc: Downloading webpage - [youtube] BaW_jenozKc: Downloading video info webpage - [youtube] BaW_jenozKc: Extracting video information - >>> info['title'] - 'youtube-dl test video "\'/\\ä↭𝕐' - >>> info['height'], info['width'] - (720, 1280) - -If you want to download or play the video you can get its url: - -.. code-block:: python - - >>> info['url'] - 'https://...' - -Extracting playlist information -------------------------------- - -The playlist information is extracted in a similar way, but the dictionary is a bit different: - -.. code-block:: python - - >>> playlist = ydl.extract_info('http://www.ted.com/playlists/13/open_source_open_world', download=False) - [TED] open_source_open_world: Downloading playlist webpage - ... - >>> playlist['title'] - 'Open-source, open world' - - - -You can access the videos in the playlist with the ``entries`` field: - -.. code-block:: python - - >>> for video in playlist['entries']: - ... print('Video #%d: %s' % (video['playlist_index'], video['title'])) - - Video #1: How Arduino is open-sourcing imagination - Video #2: The year open data went worldwide - Video #3: Massive-scale online collaboration - Video #4: The art of asking - Video #5: How cognitive surplus will change the world - Video #6: The birth of Wikipedia - Video #7: Coding a better government - Video #8: The era of open innovation - Video #9: The currency of the new economy is trust |