From 82e1c94c6f248506efec6c660258fb050191ac72 Mon Sep 17 00:00:00 2001 From: ngosang Date: Thu, 3 Aug 2023 08:10:14 +0200 Subject: [PATCH] Fix HEADLESS=false in Windows binary --- src/flaresolverr.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/flaresolverr.py b/src/flaresolverr.py index c4d0720..9e5f8de 100644 --- a/src/flaresolverr.py +++ b/src/flaresolverr.py @@ -62,6 +62,12 @@ if __name__ == "__main__": if sys.version_info < (3, 9): raise Exception("The Python version is less than 3.9, a version equal to or higher is required.") + # fix for HEADLESS=false in Windows binary + # https://stackoverflow.com/a/27694505 + if os.name == 'nt': + import multiprocessing + multiprocessing.freeze_support() + # fix ssl certificates for compiled binaries # https://github.com/pyinstaller/pyinstaller/issues/7229 # https://stackoverflow.com/questions/55736855/how-to-change-the-cafile-argument-in-the-ssl-module-in-python3