From 0f014b591e3a1108227da04b8a8fa9b2e0a192b7 Mon Sep 17 00:00:00 2001 From: tehkillerbee Date: Fri, 26 Jan 2024 16:13:18 +0100 Subject: [PATCH] Use oauth file login --- examples/simple.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/examples/simple.py b/examples/simple.py index 5f724c9..4d5e34f 100644 --- a/examples/simple.py +++ b/examples/simple.py @@ -1,9 +1,31 @@ +# -*- coding: utf-8 -*- + +# Copyright (C) 2023- The Tidalapi Developers +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . +# +"""simple.py: A simple example script that describes how to get started using tidalapi""" + import tidalapi from tidalapi import Quality +from pathlib import Path + +oauth_file1 = Path("tidal-oauth-user.json") session = tidalapi.Session() # Will run until you visit the printed url and link your account -session.login_oauth_simple() +session.login_oauth_file(oauth_file1) # Override the required playback quality, if necessary # Note: Set the quality according to your subscription. # Normal: Quality.low_320k @@ -11,8 +33,10 @@ # HiFi+ Quality.hi_res_lossless session.audio_quality = Quality.low_320k -album = session.album(66236918) +album = session.album(66236918) # Electric For Life Episode 099 tracks = album.tracks() +print(album.name) +# list album tracks for track in tracks: print(track.name) for artist in track.artists: