Skip to content

Commit 480cbe6

Browse files
authored
Merge pull request #61 from lf2a/fix-wait-for-file-firefox
Fix: Firefox wait for file method
2 parents e34c6b8 + 479e03b commit 480cbe6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

botcity/web/bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,8 +2020,8 @@ def wait_for_file(self, path, timeout=60000):
20202020
if elapsed_time > timeout:
20212021
return False
20222022
if os.path.isfile(path) and os.access(path, os.R_OK):
2023-
if self.browser == Browser.FIREFOX and os.path.exists(path + '.part'):
2024-
# if *.part exists, the download is not completed.
2023+
if self.browser == Browser.FIREFOX and os.path.getsize(path) == 0:
2024+
# if file is empty, the download is not completed.
20252025
continue
20262026
self.sleep(config.DEFAULT_SLEEP_AFTER_ACTION)
20272027
return True

0 commit comments

Comments
 (0)