From 762540437f7242fabb4d33c6c568538e332dfcb0 Mon Sep 17 00:00:00 2001 From: Emi Date: Mon, 7 Jul 2025 17:43:12 -0300 Subject: [PATCH] fixing one reference error --- script.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/script.py b/script.py index 004526e..25355d8 100644 --- a/script.py +++ b/script.py @@ -4,6 +4,8 @@ from pynput import keyboard as kb import sys +playlist_url = 'https://www.youtube.com/playlist?list=WL' + quit = False half_left = ( @@ -86,7 +88,7 @@ def change_to_not_available(): return True except: - print(f"Critical error in change_to_not_available: {e}") + print(f"Critical error in change_to_not_available") return False @@ -104,7 +106,7 @@ except Exception as e: # Open YouTube pgui.hotkey('ctrl', 't') -pgui.write('https://www.youtube.com/playlist?list=WL') +pgui.write(playlist_url) pgui.press("enter") time.sleep(5) @@ -116,13 +118,12 @@ if __name__ == '__main__': if counter > 0 and (counter % 90) == 0: pgui.hotkey('ctrl', 'w') pgui.hotkey('ctrl', 't') - pgui.write('https://www.youtube.com/playlist?list=WL') + pgui.write(playlist_url) pgui.press("enter") time.sleep(8) try: - success = locate_img('options.png', sleep_time=0.2, confidence=0.8, gray_scale=True, region=half_right) if not success: