### Windows file manager commands Source: https://github.com/zerx-lab/fluxdown/blob/main/website/src/content/docs/en/getting-started/settings.md Example commands for third-party file managers on Windows. Adjust install paths as needed. Use {path} for managers that can navigate to a specific file, {dir} for those that only open a folder. ```text "C:\Program Files\OneCommander\OneCommander.exe" {path} ``` ```text "C:\Program Files\Everything\Everything.exe" -select {path} ``` ```text "C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /cmd Go {path} NEW ``` ```text "C:\totalcmd\TOTALCMD64.EXE" /O /T {dir} ``` -------------------------------- ### Install Flutter Windows application files Source: https://github.com/zerx-lab/fluxdown/blob/main/packages/tray_manager_local/example/windows/CMakeLists.txt Defines the installation rules for the Flutter Windows example, copying the executable, ICU data, Flutter library, plugin libraries, and assets next to the executable. It sets the install prefix to the build bundle directory and installs the AOT library only for Profile and Release configurations. ```cmake # === Installation === # Support files are copied into place next to the executable, so that it can # run in place. This is done instead of making a separate bundle (as on Linux) # so that building and running from within Visual Studio will work. set(BUILD_BUNDLE_DIR "$") # Make the "install" step default, as it's required to run. set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # Install the AOT library on non-Debug builds only. install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" CONFIGURATIONS Profile;Release COMPONENT Runtime) ``` -------------------------------- ### Installation Bundle Configuration Source: https://github.com/zerx-lab/fluxdown/blob/main/packages/tray_manager_local/example/linux/CMakeLists.txt Configures the installation process to create a relocatable bundle in the build directory. ```cmake # === Installation === # By default, "installing" just makes a relocatable bundle in the build # directory. set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() # Start with a clean build bundle directory every time. install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # Install the AOT library on non-Debug builds only. if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Configure installation bundle directory Source: https://github.com/zerx-lab/fluxdown/blob/main/linux/CMakeLists.txt Sets the default install prefix to a bundle directory in the build tree, making installation produce a relocatable bundle. ```cmake set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() ``` -------------------------------- ### Install Application and Dependencies Source: https://github.com/zerx-lab/fluxdown/blob/main/windows/CMakeLists.txt Installs the application executable, ICU data file, Flutter library, and any bundled plugin libraries to the appropriate destinations. ```cmake install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Probe media file with flux.ffprobe.run Source: https://github.com/zerx-lab/fluxdown/blob/main/website/src/content/docs/en/plugins/api-reference.md Example of using flux.ffprobe.run() to get structured media information. It runs ffprobe with JSON output and parses the result to access format and stream details. ```javascript const out = await flux.ffprobe.run({ args: ['-v', 'quiet', '-print_format', 'json', '-show_format', '-show_streams', './in.mp4'], }); const info = JSON.parse(out.stdout); ``` -------------------------------- ### Install Linux dependency: libayatana-appindicator3-dev Source: https://github.com/zerx-lab/fluxdown/blob/main/packages/tray_manager_local/README.md Installs the required Linux package for tray support using apt-get. ```bash sudo apt-get install libayatana-appindicator3-dev ``` -------------------------------- ### Install Linux dependency: appindicator3-0.1 Source: https://github.com/zerx-lab/fluxdown/blob/main/packages/tray_manager_local/README.md Alternative Linux package installation command for systems using appindicator3. ```bash sudo apt-get install appindicator3-0.1 libappindicator3-dev ``` -------------------------------- ### Install tray icons Source: https://github.com/zerx-lab/fluxdown/blob/main/windows/CMakeLists.txt Copies the tray icon and dark/light mode tray icons to the install prefix so tray_manager can find them. ```cmake install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/runner/resources/app_icon.ico" DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/runner/resources/tray_win_dark.ico" DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/runner/resources/tray_win_light.ico" DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) ``` -------------------------------- ### Install FluxDown with Scoop Source: https://github.com/zerx-lab/fluxdown/blob/main/website/src/content/docs/en/getting-started/installation.md Install FluxDown via Scoop from the official Extras bucket. This installs the portable build and keeps settings.json across upgrades; new releases arrive automatically and can be updated with 'scoop update fluxdown'. ```powershell scoop bucket add extras scoop install extras/fluxdown ``` -------------------------------- ### POST /api/v1/market/install Source: https://github.com/zerx-lab/fluxdown/blob/main/website/src/content/docs/en/plugins/packaging.md Installs the latest non-yanked version of a specified plugin. ```APIDOC ## POST /api/v1/market/install ### Description Installs the latest non-yanked version of a specified plugin. ### Method POST ### Endpoint /api/v1/market/install ### Authentication Requires the management token (see API overview). ### Parameters #### Request Body - **pluginId** (string) - Required - The plugin identifier in the format `name@author`. ### Request Example ```json { "pluginId": "name@author" } ``` ### Response #### Success Response (200) Confirms the installation of the plugin. #### Response Example ```json { "status": "installed" } ``` ``` -------------------------------- ### Docker Compose setup for fluxdown-server Source: https://github.com/zerx-lab/fluxdown/blob/main/website/src/content/docs/en/headless-server/docker.md Docker Compose configuration for the FluxDown server, exposing port 17800 and persisting data in a named volume. The commented environment variables show optional settings: FLUXDOWN_TOKEN presets the access key and skips the init wizard, FLUXDOWN_LANG sets the default Web UI language (en/zh), and FLUXDOWN_DATABASE_URL points to an external PostgreSQL instead of the bundled SQLite. After saving the file, run 'docker compose up -d' to start the service. ```yaml services: fluxdown-server: image: ghcr.io/zerx-lab/fluxdown-server:latest container_name: fluxdown-server restart: unless-stopped ports: - "17800:17800" volumes: - fluxdown-data:/data - ./downloads:/root/Downloads # environment: # FLUXDOWN_TOKEN: your-secure-key-here # optional: preset access key, skips the init wizard # FLUXDOWN_LANG: zh # FLUXDOWN_DATABASE_URL: postgres://user:pass@host:5432/fluxdown volumes: fluxdown-data: ``` ```bash docker compose up -d ``` -------------------------------- ### Install runtime executable, ICU data, and libraries Source: https://github.com/zerx-lab/fluxdown/blob/main/linux/CMakeLists.txt Installs the main binary, Flutter ICU data file, Flutter library, and plugin libraries into the bundle prefix directories using component Runtime. Requires variables BINARY_NAME, FLUTTER_ICU_DATA_FILE, FLUTTER_LIBRARY, and PLUGIN_BUNDLED_LIBRARIES. ```cmake set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") ``` ```cmake install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) ``` ```cmake install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` ```cmake install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` ```cmake foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endforeach(bundled_library) ``` -------------------------------- ### Build web front end and server Source: https://github.com/zerx-lab/fluxdown/blob/main/website/src/content/docs/en/headless-server/setup.md Build the React SPA in web/ and then compile the server binary, embedding the web/dist output. Required before building the server when building from source. ```bash cd web bun install bun run build # outputs to web/dist cd .. cargo build --release -p fluxdown_server # embeds web/dist into the binary ``` -------------------------------- ### Run FluxDown as a systemd service Source: https://github.com/zerx-lab/fluxdown/blob/main/website/src/content/docs/en/headless-server/setup.md Minimal systemd unit file for a Linux deployment of the FluxDown headless server, followed by the commands to reload systemd, enable and start the service, and watch its logs for the first-run setup banner. Adjust paths and user as needed; the binary carries the Web UI inside it. ```ini [Unit] Description=FluxDown headless download server After=network-online.target Wants=network-online.target [Service] Type=simple User=fluxdown Group=fluxdown WorkingDirectory=/opt/fluxdown Environment=FLUXDOWN_BIND=0.0.0.0:17800 Environment=FLUXDOWN_DATA_DIR=/var/lib/fluxdown ExecStart=/opt/fluxdown/fluxdown-server Restart=on-failure RestartSec=5 NoNewPrivileges=true [Install] WantedBy=multi-user.target ``` ```bash sudo systemctl daemon-reload sudo systemctl enable --now fluxdown-server sudo journalctl -u fluxdown-server -f # watch for the first-run setup guidance banner ``` -------------------------------- ### Add download tasks via CLI Source: https://github.com/zerx-lab/fluxdown/blob/main/website/src/content/docs/en/api/cli.md Examples for creating download tasks using single URLs, multiple URLs, or input files. The command supports reading from standard input using the -i - flag. ```bash # Single URL, auto everything fluxdown add https://example.com/file.zip # Several URLs at once fluxdown add https://example.com/a.zip https://example.com/b.zip # Read URLs from a file (one per line; blank lines and lines starting with # are ignored) fluxdown add -i urls.txt # Read URLs from stdin cat urls.txt | fluxdown add -i - ``` -------------------------------- ### Resolve direct URL using flux.ytdlp.run() Source: https://github.com/zerx-lab/fluxdown/blob/main/website/src/content/docs/en/plugins/api-reference.md Use this example to resolve a page by running yt-dlp with -J to get metadata JSON, then extract a direct URL. It guards with if (flux.ytdlp) since the API is undefined without the ytdlp permission, throws on non-zero exit codes, and falls back to the last format URL. The returned object includes a fileName derived from the title and extension. ```javascript globalThis.resolve = async (ctx) => { if (!flux.ytdlp) return null; const r = await flux.ytdlp.run({ args: ['-J', '--no-warnings', ctx.url] }); if (r.code !== 0) throw new Error('yt-dlp failed: ' + (r.stderr || '').slice(-400)); const info = JSON.parse(r.stdout); const direct = info.url || info.formats?.[info.formats.length - 1]?.url; if (!direct) return null; return { url: direct, fileName: info.title ? `${info.title}.${info.ext || 'mp4'}` : undefined }; }; ``` -------------------------------- ### Clean build bundle directory before install Source: https://github.com/zerx-lab/fluxdown/blob/main/linux/CMakeLists.txt Uses install(CODE) to remove the build bundle directory specified by BUILD_BUNDLE_DIR before install, ensuring a clean state. Component is Runtime. ```cmake install(CODE " file(REMOVE_RECURSE "${BUILD_BUNDLE_DIR}/") " COMPONENT Runtime) ``` -------------------------------- ### Build and run from source Source: https://github.com/zerx-lab/fluxdown/blob/main/README.md Build and run the project from source. Requires Flutter SDK, Rust toolchain, and Rinf CLI. The main branch is for active development; stable is for stable releases. ```shell # Clone the development branch (main = active development, stable = stable releases) git clone -b main https://github.com/zerx-lab/FluxDown.git cd FluxDown # Check your environment rustc --version flutter doctor # Install the Rinf CLI (once) cargo install rinf_cli # Fetch dependencies & generate Dart bindings flutter pub get rinf gen # Run in debug mode flutter run # Build a release flutter build windows --release # or: macos / linux ``` -------------------------------- ### Clean and install Flutter assets directory Source: https://github.com/zerx-lab/fluxdown/blob/main/linux/CMakeLists.txt First removes any stale flutter_assets directory under the data directory, then installs the fresh assets from the project build directory. Prevent stale files from previous installs. ```cmake set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE "${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}") " COMPONENT Runtime) ``` ```cmake install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Add FluxDown entry to Awesome-Linux-Software README Source: https://github.com/zerx-lab/fluxdown/blob/main/promotion/lists/desktop-mobile-apps.md Markdown list entry to insert into the '#### Download Manager' section of the README, between 'Flareget' and 'Free Download Manager'. Must follow the required format: icon first, then name linking to the homepage, then a short description. Use only the [oss icon] since FluxDown is free and open source. ```markdown - [![Open-Source Software][oss icon]](https://github.com/zerx-lab/FluxDown) [FluxDown](https://fluxdown.zerx.dev/) - FluxDown is a Rust-powered multi-protocol download manager with IDM-style dynamic segmentation, supporting HTTP/HTTPS, FTP, BitTorrent, eD2K, HLS and DASH. ``` -------------------------------- ### Install AOT library for Profile and Release Source: https://github.com/zerx-lab/fluxdown/blob/main/windows/CMakeLists.txt Installs the AOT library only for Profile and Release configurations. ```cmake install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" CONFIGURATIONS Profile;Release COMPONENT Runtime) ``` -------------------------------- ### Project Initialization and Platform Configuration Source: https://github.com/zerx-lab/fluxdown/blob/main/packages/tray_manager_local/example/linux/CMakeLists.txt Sets the minimum CMake version, project name, and configures cross-compilation sysroot settings if provided. ```cmake cmake_minimum_required(VERSION 3.10) project(runner LANGUAGES CXX) set(BINARY_NAME "tray_manager_example") set(APPLICATION_ID "com.example.tray_manager") cmake_policy(SET CMP0063 NEW) set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") # Root filesystem for cross-building. if(FLUTTER_TARGET_PLATFORM_SYSROOT) set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) endif() ``` -------------------------------- ### Add tray_manager dependency from git Source: https://github.com/zerx-lab/fluxdown/blob/main/packages/tray_manager_local/README.md Alternative installation using the git repository URL and branch 'main'. ```yaml dependencies: tray_manager: git: url: https://github.com/leanflutter/tray_manager.git ref: main ``` -------------------------------- ### Flutter and System Dependency Setup Source: https://github.com/zerx-lab/fluxdown/blob/main/packages/tray_manager_local/example/linux/CMakeLists.txt Includes Flutter build rules and checks for required GTK system dependencies. ```cmake set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") # Flutter library and tool build rules. add_subdirectory(${FLUTTER_MANAGED_DIR}) # System-level dependencies. find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") ``` -------------------------------- ### Run headless server with environment variables Source: https://github.com/zerx-lab/fluxdown/blob/main/website/src/content/docs/en/headless-server/setup.md Starts the fluxdown-server binary with explicit bind address and data directory, overriding auto-detection for stable headless deployments. ```bash FLUXDOWN_BIND=0.0.0.0:8080 \ FLUXDOWN_DATA_DIR=/srv/fluxdown/data \ ./fluxdown-server ``` -------------------------------- ### Build and install fluxdown_updater helper binary Source: https://github.com/zerx-lab/fluxdown/blob/main/windows/CMakeLists.txt Defines a custom CMake target that runs 'cargo build -p fluxdown_updater --release' in the workspace directory, building the auto-update helper binary. Adds a dependency so the main binary builds after this target, and installs the resulting executable to the installation prefix. ```cmake add_custom_target(fluxdown_updater ALL COMMAND cargo build -p fluxdown_updater --release WORKING_DIRECTORY "${_NMH_WORKSPACE_DIR}" COMMENT "Building fluxdown_updater helper binary" VERBATIM ) add_dependencies(${BINARY_NAME} fluxdown_updater) install(PROGRAMS "${_NMH_WORKSPACE_DIR}/target/release/fluxdown_updater.exe" DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime ) ``` -------------------------------- ### Run FluxDown server with FLUXDOWN_TOKEN Source: https://github.com/zerx-lab/fluxdown/blob/main/website/src/content/docs/en/headless-server/docker.md Runs the server with a pre-set access key via the FLUXDOWN_TOKEN environment variable, skipping the initialization wizard. The key only takes effect when the instance has not set a key yet, unless FLUXDOWN_TOKEN_FORCE=1 is also set to override the stored key on every restart. ```bash docker run -d \ --name fluxdown-server \ --restart unless-stopped \ -p 17800:17800 \ -e FLUXDOWN_TOKEN=your-secure-key-here \ -v fluxdown-data:/data \ -v /path/to/downloads:/root/Downloads \ ghcr.io/zerx-lab/fluxdown-server:latest ```