flaresolverr: drop

This commit is contained in:
Julien Malka 2023-10-11 18:42:40 +02:00
parent cdb8856b3e
commit 5a4b3af974
Signed by: Luj
GPG key ID: 6FC74C847011FD83
6 changed files with 0 additions and 147 deletions

View file

@ -61,7 +61,6 @@ in
tinystatus = prev.pkgs.callPackage ../packages/tinystatus { };
jackett = prev.unstable.jackett;
radarr = prev.unstable.radarr;
flaresolverr = prev.pkgs.callPackage ../packages/flaresolverr { };
htpdate = prev.pkgs.callPackage ../packages/htpdate { };
authelia = prev.pkgs.callPackage ../packages/authelia { };
paperless-ng = prev.pkgs.callPackage ../packages/paperless-ng { };

View file

@ -1,26 +0,0 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.luj.flaresolverr;
in
{
options.luj.flaresolverr = {
enable = mkEnableOption "activate flaresolverr service";
};
config = mkIf cfg.enable {
systemd.services.flaresolverr = {
description = "Flaresolverr";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.flaresolverr}/bin/flaresolverr";
Restart = "on-failure";
};
};
};
}

View file

@ -32,8 +32,6 @@ in
nginx.subdomain = "jackett";
};
luj.flaresolverr.enable = true;
luj.deluge = {
enable = true;
user = "mediaserver";

View file

@ -1,54 +0,0 @@
diff --git a/src/utils.py b/src/utils.py
index 79cf6f6..fef4a68 100644
--- a/src/utils.py
+++ b/src/utils.py
@@ -154,47 +154,8 @@ def get_webdriver(proxy: dict = None) -> WebDriver:
else:
start_xvfb_display()
- # if we are inside the Docker container, we avoid downloading the driver
- driver_exe_path = None
- version_main = None
- if os.path.exists("/app/chromedriver"):
- # running inside Docker
- driver_exe_path = "/app/chromedriver"
- else:
- version_main = get_chrome_major_version()
- # Fix for Chrome 115
- # https://github.com/seleniumbase/SeleniumBase/pull/1967
- if int(version_main) > 114:
- version_main = 114
- if PATCHED_DRIVER_PATH is not None:
- driver_exe_path = PATCHED_DRIVER_PATH
-
- # detect chrome path
- browser_executable_path = get_chrome_exe_path()
-
- # downloads and patches the chromedriver
- # if we don't set driver_executable_path it downloads, patches, and deletes the driver each time
- driver = uc.Chrome(options=options, browser_executable_path=browser_executable_path,
- driver_executable_path=driver_exe_path, version_main=version_main,
- windows_headless=windows_headless, headless=windows_headless)
-
- # save the patched driver to avoid re-downloads
- if driver_exe_path is None:
- PATCHED_DRIVER_PATH = os.path.join(driver.patcher.data_path, driver.patcher.exe_name)
- if PATCHED_DRIVER_PATH != driver.patcher.executable_path:
- shutil.copy(driver.patcher.executable_path, PATCHED_DRIVER_PATH)
-
- # clean up proxy extension directory
- if proxy_extension_dir is not None:
- shutil.rmtree(proxy_extension_dir)
-
- # selenium vanilla
- # options = webdriver.ChromeOptions()
- # options.add_argument('--no-sandbox')
- # options.add_argument('--window-size=1920,1080')
- # options.add_argument('--disable-setuid-sandbox')
- # options.add_argument('--disable-dev-shm-usage')
- # driver = webdriver.Chrome(options=options)
+ driver = uc.Chrome(options=options, driver_executable_path="@chromedriver_path@",
+ windows_headless=windows_headless)
return driver

View file

@ -1,52 +0,0 @@
{ lib, stdenv, python3, chromium, xvfb-run, xorgserver, makeWrapper, chromedriver, fetchFromGitHub, substituteAll }:
let
python_env = python3.withPackages
(p: with p; [ bottle waitress selenium func-timeout requests websockets xvfbwrapper webtest certifi prometheus-client ]);
in
stdenv.mkDerivation rec {
pname = "flaresolverr";
version = "3.3.6";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "sha256-lSOw63yjFdi32N44r3A8Ggvexpov9CnaEP7fD7EBdKc=";
};
buildInputs = [ makeWrapper ];
nativeBuildInputs = [ chromedriver ];
patches = [
./is_patched.patch
(substituteAll {
src = ./chromedriver_path.patch;
chromedriver_path = "${chromedriver}/bin/chromedriver";
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/share
cp -r src $out/share/flaresolverr
cp package.json $out/share/flaresolverr
runHook postInstall
'';
postFixup = ''
makeWrapper ${python_env}/bin/python $out/bin/flaresolverr \
--prefix PATH : ${lib.makeBinPath [ chromium xvfb-run xorgserver chromedriver ]} \
--add-flags $out/share/flaresolverr/flaresolverr.py \
--chdir $out/share/flaresolverr
'';
meta = with lib; {
description = "Proxy server to bypass Cloudflare protection";
homepage = "https://github.com/FlareSolverr/FlareSolverr";
license = licenses.mit;
maintainers = with maintainers; [ julienmalka ];
# Flaresolverr will not run without chromedriver and xvfb-run
platforms = lib.intersectLists chromedriver.meta.platforms xvfb-run.meta.platforms;
};
}

View file

@ -1,12 +0,0 @@
diff --git a/src/undetected_chromedriver/patcher.py b/src/undetected_chromedriver/patcher.py
index 5776d19..e3159dd 100644
--- a/src/undetected_chromedriver/patcher.py
+++ b/src/undetected_chromedriver/patcher.py
@@ -334,6 +334,7 @@ class Patcher(object):
return "".join(cdc).encode()
def is_binary_patched(self, executable_path=None):
+ return True
executable_path = executable_path or self.executable_path
try:
with io.open(executable_path, "rb") as fh: