Pages

Here is an example of how you can use the tidalapi.page module

See tidalapi.page for additional information about the available fields and functions

Home, Explore and Videos

Goes through these pages and prints all of the categories and items

from tidalapi.page import PageItem, PageLink
from tidalapi.mix import Mix

home = session.home()
home.categories.extend(session.explore().categories)
home.categories.extend(session.videos().categories)

for category in home.categories:
    print(category.title)

for category in home.categories:
    print(category.title)
    items = []
    for item in category.items:
        if isinstance(item, PageItem):
            items.append("\t" + item.short_header)
            items.append("\t" + item.short_sub_header[0:50])
            # Call item.get() on this one, for example on click
        elif isinstance(item, PageLink):
            items.append("\t" + item.title)
            # Call item.get() on this one, for example on click
        elif isinstance(item, Mix):
            items.append("\t" + item.title)
            # You can optionally call item.get() to request the items() first, but it does it for you if you don't
        else:
            items.append("\t" + item.name)
            # An album could be handled by session.album(item.id) for example,
            # to get full details. Usually the relevant info is there already however
        print()
    [print(x) for x in sorted(items)]