att1
This commit is contained in:
parent
acc120ec74
commit
eaf0ed70a7
@ -152,8 +152,17 @@ def main():
|
||||
chrome_options.add_argument('--disable-notifications')
|
||||
chrome_options.add_experimental_option('excludeSwitches', ['enable-logging'])
|
||||
|
||||
# Definir pasta de download para a Área de Trabalho
|
||||
download_dir = os.path.join(os.path.expanduser("~"), "Desktop")
|
||||
# Definir pasta de download
|
||||
# Tenta usar Desktop, se não existir usa /tmp (para Kubernetes/Docker)
|
||||
desktop_dir = os.path.join(os.path.expanduser("~"), "Desktop")
|
||||
if os.path.exists(desktop_dir):
|
||||
download_dir = desktop_dir
|
||||
else:
|
||||
# Em ambiente Kubernetes/Docker, usar /tmp ou criar diretório
|
||||
download_dir = "/tmp/downloads"
|
||||
os.makedirs(download_dir, exist_ok=True)
|
||||
print(f"Usando diretório de download: {download_dir}")
|
||||
|
||||
prefs = {
|
||||
"download.default_directory": download_dir,
|
||||
"download.prompt_for_download": False,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user