Update docs (closes #7)

This commit is contained in:
sigma67 2020-05-22 16:19:22 +02:00
commit fadba30274
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0
8 changed files with 129 additions and 104 deletions

35
docs/make.bat Normal file
View file

@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd

View file

@ -13,12 +13,11 @@
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, '../..')
from ytmusicapi import __version__ # noqa: E402
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
from ytmusicapi import __version__
# -- Project information -----------------------------------------------------
project = 'ytmusicapi'
@ -51,7 +50,6 @@ templates_path = ['_templates']
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
@ -73,4 +71,4 @@ else:
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ['_static']

View file

@ -6,7 +6,8 @@
ytmusicapi: Unofficial API for YouTube Music
==================================================
The purpose of this library is to automate interactions with `YouTube Music <https://music.youtube.com/>`_,
such as retrieving your library content or creating large playlists.
such as retrieving your library content, managing playlists and uploading songs.
To achieve this, it emulates web requests that would occur if you performed the same actions in your web browser.
**This project is not supported nor endorsed by Google**
@ -14,7 +15,9 @@ such as retrieving your library content or creating large playlists.
:start-after: features
:end-before: end-features
For a complete documentation of available functions, refer to the :doc:`Reference <reference>`
To **get started**, read the :doc:`setup instructions <setup>`.
For a **complete documentation** of available functions, see the :doc:`Reference <reference>`.
Contents
--------

View file

@ -17,8 +17,13 @@ To do so, follow these steps:
- Go to the developer tools (Ctrl-Shift-I) and find an authenticated POST request. You can filter for /browse to easily find a suitable request.
- Copy the request headers (right click > copy > copy request headers)
Now call :py:func:`YTMusic.setup()` and paste the request headers and it will create configuration file
in the correct format in the current directory.
Now call :py:func:`YTMusic.setup` with the parameter ``filepath=headers_auth.json`` and paste the request headers to the terminal input.
If you don't want terminal interaction you can pass the request headers with the ``headers_raw`` parameter.
The function returns a JSON string with the credentials needed for :doc:`Usage <usage>`. Alternatively, if you passed the filepath parameter as described above,
a file called ``headers_auth.json`` will be created in the current directory, which you can pass to ``YTMusic()`` for authentication.
These credentials remain valid as long as your YTMusic browser session is valid (about 2 years unless you log out).
Manual file creation
--------------------