diff --git a/docs/source/_static/style.css b/docs/source/_static/style.css
new file mode 100644
index 0000000..18dd3fa
--- /dev/null
+++ b/docs/source/_static/style.css
@@ -0,0 +1,3 @@
+.wy-nav-content {
+ max-width: 1080px !important;
+}
diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html
new file mode 100644
index 0000000..4392ca7
--- /dev/null
+++ b/docs/source/_templates/layout.html
@@ -0,0 +1,4 @@
+{% extends "!layout.html" %}
+{% block extrahead %}
+
+{% endblock %}
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 5dfad5f..3ae20fb 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -23,7 +23,7 @@ on_rtd = os.environ.get("READTHEDOCS", None) == "True"
# -- Project information -----------------------------------------------------
project = "ytmusicapi"
-copyright = "2022, sigma67"
+copyright = "2024, sigma67"
author = "sigma67"
# The full version, including alpha/beta/rc tags
@@ -47,6 +47,11 @@ master_doc = "index"
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
+# 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"]
+
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
diff --git a/docs/source/faq.rst b/docs/source/faq.rst
index 239f7c8..f0e533f 100644
--- a/docs/source/faq.rst
+++ b/docs/source/faq.rst
@@ -12,7 +12,7 @@ My library results are empty even though I set up my cookie correctly.
Please make sure that you don't have multiple Google accounts. ``ytmusicapi`` might be returning
results from a different account which is currently empty. You can set your account using ``X-Goog-AuthUser``
in your headers file (numeric index) or by providing the id of a brand account with ``ytmusic = YTMusic(headers, "1234..")``.
-For more details see the :doc:`reference`.
+For more details see the :doc:`reference/index`.
Usage
-----------------------
diff --git a/docs/source/index.rst b/docs/source/index.rst
index f30b893..fa1a5b1 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -12,7 +12,7 @@ To achieve this, it emulates web requests that would occur if you performed the
To **get started**, read the :doc:`setup instructions `.
-For a **complete documentation** of available functions, see the :doc:`Reference `.
+For a **complete documentation** of available functions, see the :doc:`Reference `.
Contents
--------
@@ -26,5 +26,5 @@ Contents
setup/index
usage
- reference
+ reference/index
faq
diff --git a/docs/source/reference.rst b/docs/source/reference.rst
deleted file mode 100644
index d77018b..0000000
--- a/docs/source/reference.rst
+++ /dev/null
@@ -1,97 +0,0 @@
-Reference
-==================
-
-Reference for the YTMusic class.
-
-.. currentmodule:: ytmusicapi
-.. autoclass:: YTMusic
-.. automethod:: YTMusic.__init__
-
-
-Setup
------
-See also the :doc:`Setup ` page
-
-.. autofunction:: setup
-.. autofunction:: setup_oauth
-
-Search
-------
-.. automethod:: YTMusic.search
-.. automethod:: YTMusic.get_search_suggestions
-.. automethod:: YTMusic.remove_search_suggestions
-
-
-Browsing
---------
-.. automethod:: YTMusic.get_home
-.. automethod:: YTMusic.get_artist
-.. automethod:: YTMusic.get_artist_albums
-.. automethod:: YTMusic.get_album
-.. automethod:: YTMusic.get_album_browse_id
-.. automethod:: YTMusic.get_user
-.. automethod:: YTMusic.get_user_playlists
-.. automethod:: YTMusic.get_user_videos
-.. automethod:: YTMusic.get_song
-.. automethod:: YTMusic.get_song_related
-.. automethod:: YTMusic.get_lyrics
-.. automethod:: YTMusic.get_tasteprofile
-.. automethod:: YTMusic.set_tasteprofile
-
-Explore
---------
-.. automethod:: YTMusic.get_mood_categories
-.. automethod:: YTMusic.get_mood_playlists
-.. automethod:: YTMusic.get_charts
-
-Watch
---------
-.. automethod:: YTMusic.get_watch_playlist
-
-Library
--------
-.. automethod:: YTMusic.get_library_playlists
-.. automethod:: YTMusic.get_library_songs
-.. automethod:: YTMusic.get_library_albums
-.. automethod:: YTMusic.get_library_artists
-.. automethod:: YTMusic.get_library_subscriptions
-.. automethod:: YTMusic.get_library_podcasts
-.. automethod:: YTMusic.get_library_channels
-.. automethod:: YTMusic.get_liked_songs
-.. automethod:: YTMusic.get_saved_episodes
-.. automethod:: YTMusic.get_history
-.. automethod:: YTMusic.add_history_item
-.. automethod:: YTMusic.remove_history_items
-.. automethod:: YTMusic.rate_song
-.. automethod:: YTMusic.edit_song_library_status
-.. automethod:: YTMusic.rate_playlist
-.. automethod:: YTMusic.subscribe_artists
-.. automethod:: YTMusic.unsubscribe_artists
-.. automethod:: YTMusic.get_account_info
-
-Playlists
----------
-.. automethod:: YTMusic.get_playlist
-.. automethod:: YTMusic.create_playlist
-.. automethod:: YTMusic.edit_playlist
-.. automethod:: YTMusic.delete_playlist
-.. automethod:: YTMusic.add_playlist_items
-.. automethod:: YTMusic.remove_playlist_items
-
-Podcasts
---------
-.. automethod:: YTMusic.get_channel
-.. automethod:: YTMusic.get_channel_episodes
-.. automethod:: YTMusic.get_podcast
-.. automethod:: YTMusic.get_episode
-.. automethod:: YTMusic.get_episodes_playlist
-
-Uploads
--------
-.. automethod:: YTMusic.get_library_upload_songs
-.. automethod:: YTMusic.get_library_upload_artists
-.. automethod:: YTMusic.get_library_upload_albums
-.. automethod:: YTMusic.get_library_upload_artist
-.. automethod:: YTMusic.get_library_upload_album
-.. automethod:: YTMusic.upload_song
-.. automethod:: YTMusic.delete_upload_entity
diff --git a/docs/source/reference/browsing.rst b/docs/source/reference/browsing.rst
new file mode 100644
index 0000000..b69813e
--- /dev/null
+++ b/docs/source/reference/browsing.rst
@@ -0,0 +1,17 @@
+Browsing
+--------
+
+.. currentmodule:: ytmusicapi
+.. automethod:: YTMusic.get_home
+.. automethod:: YTMusic.get_artist
+.. automethod:: YTMusic.get_artist_albums
+.. automethod:: YTMusic.get_album
+.. automethod:: YTMusic.get_album_browse_id
+.. automethod:: YTMusic.get_user
+.. automethod:: YTMusic.get_user_playlists
+.. automethod:: YTMusic.get_user_videos
+.. automethod:: YTMusic.get_song
+.. automethod:: YTMusic.get_song_related
+.. automethod:: YTMusic.get_lyrics
+.. automethod:: YTMusic.get_tasteprofile
+.. automethod:: YTMusic.set_tasteprofile
diff --git a/docs/source/reference/explore.rst b/docs/source/reference/explore.rst
new file mode 100644
index 0000000..36df372
--- /dev/null
+++ b/docs/source/reference/explore.rst
@@ -0,0 +1,7 @@
+Explore
+--------
+
+.. currentmodule:: ytmusicapi
+.. automethod:: YTMusic.get_mood_categories
+.. automethod:: YTMusic.get_mood_playlists
+.. automethod:: YTMusic.get_charts
diff --git a/docs/source/reference/index.rst b/docs/source/reference/index.rst
new file mode 100644
index 0000000..9192d60
--- /dev/null
+++ b/docs/source/reference/index.rst
@@ -0,0 +1,18 @@
+Reference
+=========
+
+Reference for the YTMusic class.
+
+
+.. toctree::
+
+ ytmusic
+ setup
+ search
+ browsing
+ explore
+ watch
+ library
+ playlists
+ podcasts
+ uploads
diff --git a/docs/source/reference/library.rst b/docs/source/reference/library.rst
new file mode 100644
index 0000000..16a92df
--- /dev/null
+++ b/docs/source/reference/library.rst
@@ -0,0 +1,22 @@
+Library
+-------
+
+.. currentmodule:: ytmusicapi
+.. automethod:: YTMusic.get_library_playlists
+.. automethod:: YTMusic.get_library_songs
+.. automethod:: YTMusic.get_library_albums
+.. automethod:: YTMusic.get_library_artists
+.. automethod:: YTMusic.get_library_subscriptions
+.. automethod:: YTMusic.get_library_podcasts
+.. automethod:: YTMusic.get_library_channels
+.. automethod:: YTMusic.get_liked_songs
+.. automethod:: YTMusic.get_saved_episodes
+.. automethod:: YTMusic.get_history
+.. automethod:: YTMusic.add_history_item
+.. automethod:: YTMusic.remove_history_items
+.. automethod:: YTMusic.rate_song
+.. automethod:: YTMusic.edit_song_library_status
+.. automethod:: YTMusic.rate_playlist
+.. automethod:: YTMusic.subscribe_artists
+.. automethod:: YTMusic.unsubscribe_artists
+.. automethod:: YTMusic.get_account_info
diff --git a/docs/source/reference/playlists.rst b/docs/source/reference/playlists.rst
new file mode 100644
index 0000000..3e36ff3
--- /dev/null
+++ b/docs/source/reference/playlists.rst
@@ -0,0 +1,10 @@
+Playlists
+---------
+
+.. currentmodule:: ytmusicapi
+.. automethod:: YTMusic.get_playlist
+.. automethod:: YTMusic.create_playlist
+.. automethod:: YTMusic.edit_playlist
+.. automethod:: YTMusic.delete_playlist
+.. automethod:: YTMusic.add_playlist_items
+.. automethod:: YTMusic.remove_playlist_items
diff --git a/docs/source/reference/podcasts.rst b/docs/source/reference/podcasts.rst
new file mode 100644
index 0000000..716af84
--- /dev/null
+++ b/docs/source/reference/podcasts.rst
@@ -0,0 +1,9 @@
+Podcasts
+--------
+
+.. currentmodule:: ytmusicapi
+.. automethod:: YTMusic.get_channel
+.. automethod:: YTMusic.get_channel_episodes
+.. automethod:: YTMusic.get_podcast
+.. automethod:: YTMusic.get_episode
+.. automethod:: YTMusic.get_episodes_playlist
diff --git a/docs/source/reference/search.rst b/docs/source/reference/search.rst
new file mode 100644
index 0000000..46537eb
--- /dev/null
+++ b/docs/source/reference/search.rst
@@ -0,0 +1,7 @@
+Search
+------
+
+.. currentmodule:: ytmusicapi
+.. automethod:: YTMusic.search
+.. automethod:: YTMusic.get_search_suggestions
+.. automethod:: YTMusic.remove_search_suggestions
diff --git a/docs/source/reference/setup.rst b/docs/source/reference/setup.rst
new file mode 100644
index 0000000..7d36f14
--- /dev/null
+++ b/docs/source/reference/setup.rst
@@ -0,0 +1,8 @@
+Setup
+-----
+
+See also the :doc:`Setup <../setup/index>` page
+
+.. currentmodule:: ytmusicapi
+.. autofunction:: setup
+.. autofunction:: setup_oauth
diff --git a/docs/source/reference/uploads.rst b/docs/source/reference/uploads.rst
new file mode 100644
index 0000000..be9b697
--- /dev/null
+++ b/docs/source/reference/uploads.rst
@@ -0,0 +1,11 @@
+Uploads
+-------
+
+.. currentmodule:: ytmusicapi
+.. automethod:: YTMusic.get_library_upload_songs
+.. automethod:: YTMusic.get_library_upload_artists
+.. automethod:: YTMusic.get_library_upload_albums
+.. automethod:: YTMusic.get_library_upload_artist
+.. automethod:: YTMusic.get_library_upload_album
+.. automethod:: YTMusic.upload_song
+.. automethod:: YTMusic.delete_upload_entity
diff --git a/docs/source/reference/watch.rst b/docs/source/reference/watch.rst
new file mode 100644
index 0000000..e5ac600
--- /dev/null
+++ b/docs/source/reference/watch.rst
@@ -0,0 +1,5 @@
+Watch
+--------
+
+.. currentmodule:: ytmusicapi
+.. automethod:: YTMusic.get_watch_playlist
diff --git a/docs/source/reference/ytmusic.rst b/docs/source/reference/ytmusic.rst
new file mode 100644
index 0000000..f593f0d
--- /dev/null
+++ b/docs/source/reference/ytmusic.rst
@@ -0,0 +1,6 @@
+YTMusic
+-------
+
+.. currentmodule:: ytmusicapi
+.. autoclass:: YTMusic
+.. automethod:: YTMusic.__init__
diff --git a/ytmusicapi/mixins/library.py b/ytmusicapi/mixins/library.py
index 0517c96..dc67eca 100644
--- a/ytmusicapi/mixins/library.py
+++ b/ytmusicapi/mixins/library.py
@@ -312,11 +312,21 @@ class LibraryMixin(MixinProtocol):
def add_history_item(self, song):
"""
Add an item to the account's history using the playbackTracking URI
- obtained from :py:func:`get_song`.
+ obtained from :py:func:`get_song`. A ``204`` return code indicates success.
+
+ Usage::
+
+ song = yt_auth.get_song(videoId)
+ response = yt_auth.add_history_item(song)
+
+ .. note::
+
+ You need to use the same YTMusic instance as you used for :py:func:`get_song`.
:param song: Dictionary as returned by :py:func:`get_song`
:return: Full response. response.status_code is 204 if successful
"""
+ self._check_auth()
url = song["playbackTracking"]["videostatsPlaybackUrl"]["baseUrl"]
CPNA = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
cpn = "".join(CPNA[randint(0, 256) & 63] for _ in range(0, 16))