diff --git a/main-experimental.py b/main-experimental.py index 7033c06..49a8c01 100644 --- a/main-experimental.py +++ b/main-experimental.py @@ -5,6 +5,9 @@ from spotipy.oauth2 import SpotifyOAuth import time from dotenv import load_dotenv +# Number of seconds to check if same song is playing +interval = "15" + # Load environment variables from .env file load_dotenv() @@ -23,6 +26,9 @@ discord_webhook_url = os.getenv('DISCORD_WEBHOOK_URL') # Initialize variables to track the last played track last_track_id = None +interval_start = 1 +interval_verif = False + while True: current_epoch = time.time() @@ -93,7 +99,13 @@ while True: else: print("No track is currently playing.") - # Wait for a certain time before checking again (e.g., 15 seconds) - print("it has been 15 seconds") - time.sleep(15) + if interval_start == 1 and not interval_verif: + print("ignore this seconds has passed message please") + print("im still working out the bugs in this program") + interval_start = 0 + interval_verif = True + + # Wait for a certain time before checking again (e.g., 15 seconds) + print("it has been", interval,"seconds") + time.sleep(int(interval))