@@ -65,23 +65,30 @@ async def Check_clipboard_links(drive): #Only works for windows
6565 else :
6666 raise OSError ("os isn't windows !" )
6767 CF_HTML = win32clipboard .RegisterClipboardFormat ("HTML Format" )
68+ cacheClipboard = ""
6869 while 1 :
70+ await asyncio .sleep (1 )
6971 win32clipboard .OpenClipboard (0 )
70- src = win32clipboard .GetClipboardData (CF_HTML )
72+ try :
73+ src = win32clipboard .GetClipboardData (CF_HTML ).decode ("UTF-8" )
74+ except TypeError :#if not html
75+ try :
76+ src = win32clipboard .GetClipboardData (win32clipboard .CF_TEXT ).decode ("UTF-8" )
77+ except TypeError :
78+ src = ""
7179 win32clipboard .CloseClipboard ()
72- src = src .decode ("UTF-8" )
73- Copy_dwnld_from_links (src , drive )
74-
75- await asyncio .sleep (1 )
80+ if (src != cacheClipboard ): #avoid downloading infinite loop if still in clipboard
81+ cacheClipboard = src
82+ Copy_dwnld_from_links (src , drive )
7683
7784print (" Some infos : \n "
7885 "You can put the links directly from google drive ('https://drive.google.com') but also those behind a "
7986 "redirection(like the one from igg).\n "
8087 "Temporary files in google drive of your download will be stored on 'Temp folder for script', you can delete it "
8188 "after the downloads. \n "
8289 "Settings are stored in the config.ini file.\n "
83- "If you want to put the google drive folder in a custom folder(for example if you want to use a team drive ), "
84- "edit the FolderId field in config.ini and replace 'root' with the google drive folder id. \n "
90+ "If you want to put the google drive folder in a custom folder(to use your google team account ), "
91+ "edit the FolderId field in config.ini and replace 'root' with the google drive team folder id.\n "
8592 "If you use Windows, you can go on config.ini and change ClipboardDetection to ClipboardDetection=1,"
8693 "you just have to Ctrl+C the links to download and it should handle the rest.\n "
8794 "The download percentage status is updated about every 100 MB, so wait a little if it appears to be stuck.\n "
0 commit comments