### MPV Library Loading Error Traceback Example Source: https://hydrusnetwork.github.io/hydrus/client_api.html/getting_started_installing An example traceback for an OSError indicating failure to load 'libmpv.so.1' due to an undefined symbol 'g_module_open_full', commonly encountered when the application is frozen or packaged. This error suggests missing or incompatible system libraries. ```Text OSError: /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined symbol: g_module_open_full (traceback) pyimod04_ctypes.install..PyInstallerImportError: Failed to load dynlib/dll 'libmpv.so.1'. Most likely this dynlib/dll was not found when the application was frozen. ``` -------------------------------- ### Verify Git Installation Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Checks if Git is correctly installed and accessible from the command line by displaying its version. This command is applicable across Windows, Linux, and macOS. ```Shell git --version ``` -------------------------------- ### Install Git on Linux and macOS Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Provides commands to install Git using the native package managers for Linux (apt) and macOS (brew) if it's not already present on the system. ```Shell apt install git ``` ```Shell brew install git ``` -------------------------------- ### Running the Hydrus Client Source: https://hydrusnetwork.github.io/hydrus/client_api.html/getting_started_installing Instructions for launching the Hydrus client application on various operating systems. ```Windows * For the installer, run the Start menu shortcut it added. * For the extract, run 'hydrus_client.exe' in the base directory, or make a shortcut to it. ``` ```macOS * Run the App you installed. ``` ```Linux * Run the 'client' executable in the base directory. You may be able to double-click it, otherwise you are running `./client` from the terminal. * If you experience virtual memory crashes, please review [this thorough guide](Fixing_Hydrus_Random_Crashes_Under_Linux.html) by a user. ``` -------------------------------- ### Example Request for GET /manage_pages/get_page_info Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api An example URL demonstrating how to call the GET /manage_pages/get_page_info endpoint with a specific page_key and 'simple' parameter set to true. ```APIDOC /manage_pages/get_page_info?page_key=aebbf4b594e6986bddf1eeb0b5846a1e6bc4e07088e517aff166f1aeb1c3c9da&simple=true ``` -------------------------------- ### Install Hydrus Client Desktop File on Linux Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Optional command to run 'setup_desktop.sh' on Linux, which installs an application desktop file for the Hydrus Client into your applications folder. Alternatively, users can manually check the template file located in 'install_dir/static/io.github.hydrusnetwork.hydrus.desktop'. ```Shell setup_desktop.sh ``` -------------------------------- ### Install Xwayland for Wayland Compatibility Source: https://hydrusnetwork.github.io/hydrus/client_api.html/getting_started_installing This command installs the 'xwayland' package using 'apt'. It may be required to enable Hydrus and its embedded mpv windows to use Xwayland when WAYLAND_DISPLAY is unset, improving compatibility on Wayland systems. ```Bash sudo apt install xwayland ``` -------------------------------- ### Install libmpv on Linux Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Installs the libmpv library on Debian/Ubuntu-based Linux distributions using the apt package manager. This library is crucial for media playback functionality within Hydrus. ```bash apt install libmpv1 ``` ```bash apt install libmpv2 ``` -------------------------------- ### Install libmpv Library on Linux Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Installs the `libmpv` development library on Linux using `apt`. This underlying library is crucial for the 'python-mpv' wrapper to function, enabling video playback capabilities within the application. Users can choose between `libmpv1` or `libmpv2`. ```bash apt install libmpv1 ``` ```bash apt install libmpv2 ``` -------------------------------- ### Install Python Pip and Venv on Linux Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Commands to install 'pip' and 'venv' for Python 3 on Linux systems using 'apt', addressing cases where these tools are not bundled with the system's Python installation. ```Shell sudo apt install python3-pip sudo apt install python3-venv ``` -------------------------------- ### Install Hydrus Network Client via Winget Source: https://hydrusnetwork.github.io/hydrus/client_api.html/getting_started_installing This command uses Winget, a package manager for Windows, to install the Hydrus Network client. It provides options for specifying a custom installation path or installing to the current directory. ```Windows Batch winget install --id=HydrusNetwork.HydrusNetwork -e --location "\PATH\TO\INSTALL\HERE" ``` ```Windows Batch winget install --id=HydrusNetwork.HydrusNetwork -e --location "." ``` -------------------------------- ### Check FFMPEG Installation on Linux Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Verifies if FFMPEG is installed and accessible on the system's PATH by running the ffmpeg command in a new terminal. A basic version response indicates successful installation. ```bash ffmpeg ``` -------------------------------- ### Install MPV Libraries on Debian/Ubuntu Source: https://hydrusnetwork.github.io/hydrus/client_api.html/getting_started_installing Commands to install the necessary MPV libraries (libmpv1 or libmpv2) on Debian-based Linux distributions to enable video/audio playback in Hydrus client. ```Shell apt install libmpv1 apt install libmpv2 ``` -------------------------------- ### Install QtPy and PyQt6 for Python Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Installs the `qtpy` wrapper library along with `PyQt6-Charts` and `PyQt6` using pip. `qtpy` allows flexibility between PySide6 and PyQt6, with PySide6 as the default, and `PyQt6-Charts` is an extra module needed for PyQt6. ```bash python -m pip install qtpy PyQt6-Charts PyQt6 ``` -------------------------------- ### Verify Python Version and Tools (Pip, Venv) Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Verifies the installed Python version and checks for the presence of 'pip' (Python package installer) and 'venv' (virtual environment tool). These commands are crucial for Python development setup on various operating systems. ```Shell python --version python -m pip --version python -m venv --help ``` ```Shell python3 -m pip --version python3 -m venv --help ``` -------------------------------- ### Install Qt6 Missing Dependencies on Linux Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Installs `libicu-dev` and `libxcb-cursor-dev` on Linux using `apt`. These packages are often required for Qt6 to load its xcb platform plugin correctly, resolving common runtime errors. ```bash sudo apt install libicu-dev ``` ```bash sudo apt install libxcb-cursor-dev ``` -------------------------------- ### Install Python Dependencies from requirements.txt Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source After activating the virtual environment, use pip to install all required Python libraries from the `requirements.txt` file. This ensures all necessary dependencies for running Hydrus are present. Different versions of libraries can be found in advanced requirement files. ```Shell python -m pip install -r requirements.txt ``` -------------------------------- ### Run Hydrus Client Environment Setup on Windows Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Instructions for initiating the Hydrus Client API environment setup on Windows by double-clicking the 'setup_venv.bat' file. It is important not to run this script with elevated privileges (sudo) as it may cause unexpected issues. ```Batch setup_venv.bat ``` -------------------------------- ### Run Hydrus Client Environment Setup on macOS Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Instructions for initiating the Hydrus Client API environment setup on macOS by double-clicking the 'setup_venv.command' file. Users might need to experiment with advanced options, especially if their macOS version is older. ```Shell setup_venv.command ``` -------------------------------- ### Example Response for Get Local File Storage Locations API Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api An example JSON response showing the structure of the data returned by the GET /get_files/local_file_storage_locations endpoint. It includes multiple storage locations, each with a path, ideal weight, optional max_num_bytes, and a list of prefixes. ```JSON { "locations" : [ { "path" : "C:\\my_thumbs", "ideal_weight" : 1, "max_num_bytes": null, "prefixes" : [ "t00", "t01", "t02", "t03", "t04", "t05", "t06", "t07", "t08", "t09", "t0a", "t0b", "t0c", "t0d", "t0e", "t0f", "t10", "t11", "t12", "t13", "t14", "t15", "t16", "t17", "t18", "t19", "t1a", "t1b", "t1c", "t1d", "t1e", "t1f", "t20", "t21", "t22", "t23", "t24", "t25", "t26", "t27", "t28", "t29", "t2a", "t2b", "t2c", "t2d", "t2e", "t2f", "t30", "t31", "t32", "t33", "t34", "t35", "t36", "t37", "t38", "t39", "t3a", "t3b", "t3c", "t3d", "t3e", "t3f", "t40", "t41", "t42", "t43", "t44", "t45", "t46", "t47", "t48", "t49", "t4a", "t4b", "t4c", "t4d", "t4e", "t4f", "t50", "t51", "t52", "t53", "t54", "t55", "t56", "t57", "t58", "t59", "t5a", "t5b", "t5c", "t5d", "t5e", "t5f", "t60", "t61", "t62", "t63", "t64", "t65", "t66", "t67", "t68", "t69", "t6a", "t6b", "t6c", "t6d", "t6e", "t6f", "t70", "t71", "t72", "t73", "t74", "t75", "t76", "t77", "t78", "t79", "t7a", "t7b", "t7c", "t7d", "t7e", "t7f", "t80", "t81", "t82", "t83", "t84", "t85", "t86", "t87", "t88", "t89", "t8a", "t8b", "t8c", "t8d", "t8e", "t8f", "t90", "t91", "t92", "t93", "t94", "t95", "t96", "t97", "t98", "t99", "t9a", "t9b", "t9c", "t9d", "t9e", "t9f", "ta0", "ta1", "ta2", "ta3", "ta4", "ta5", "ta6", "ta7", "ta8", "ta9", "taa", "tab", "tac", "tad", "tae", "taf", "tb0", "tb1", "tb2", "tb3", "tb4", "tb5", "tb6", "tb7", "tb8", "tb9", "tba", "tbb", "tbc", "tbd", "tbe", "tbf", "tc0", "tc1", "tc2", "tc3", "tc4", "tc5", "tc6", "tc7", "tc8", "tc9", "tca", "tcb", "tcc", "tcd", "tce", "tcf", "td0", "td1", "td2", "td3", "td4", "td5", "td6", "td7", "td8", "td9", "tda", "tdb", "tdc", "tdd", "tde", "tdf", "te0", "te1", "te2", "te3", "te4", "te5", "te6", "te7", "te8", "te9", "tea", "teb", "tec", "ted", "tee", "tef", "tf0", "tf1", "tf2", "tf3", "tf4", "tf5", "tf6", "tf7", "tf8", "tf9", "tfa", "tfb", "tfc", "tfd", "tfe", "tff" ] }, { "path" : "D:\\hydrus_files_1", "ideal_weight" : 5, "max_num_bytes": null, "prefixes" : [ "f00", "f02", "f04", "f05", "f08", "f0c", "f11", "f12", "f13", "f15", "f17", "f18", "f1a", "f1b", "f20", "f23", "f25", "f26", "f27", "f2b", "f2e", "f2f", "f31", "f35", "f36", "f37", "f38", "f3a", "f40", "f42", "f43", "f44", "f49", "f4b", "f4d", "f4e", "f50", "f51", "f55", "f59", "f60", "f63", "f64", "f65", "f66", "f68", "f69", "f6e", "f71", "f73", "f78", "f79", "f7a", "f7d", "f7f", "f82", "f83", "f84", "f86", "f87", "f88", "f89", "f8f", "f90", "f91", "f96", "f9e", "fa1", "fa4", "fa5", "fa7", "faa", "fad", "faf", "fb1", "fb9", "fba", "fbb", "fbf", "fc1", "fc4", "fc7", "fc8", "fcf", "fd2", "fd6", "fd7", "fd8", "fd9", "fdf", "fe2", "fe8", "fe9", "fea", "feb", "fec", "ff4", "ff7", "ffd", "ffe" ] }, { "path" : "E:\\hydrus\\hydrus_files_2", "ideal_weight" : 2, "max_num_bytes": 805306368000, "prefixes" : [ "f01", "f03", "f06", "f07", "f09", "f0a", "f0b", "f0d", "f0e", "f0f", "f10", "f14", "f16", "f19", "f1c", "f1d", "f1e", "f1f", "f21", "f22", "f24", "f28", "f29", "f2a", "f2c", "f2d", "f30", "f32", "f33", "f34", "f39", "f3b", "f3c", "f3d", "f3e", "f3f", "f41", "f45", "f46", "f47", "f48", "f4a", "f4c", "f4f", "f52", "f53", "f54", "f56", "f57", "f58", "f5a", "f5b", "f5c", "f5d", "f5e", "f5f", "f61", "f62", "f67", "f6a", "f6b", "f6c", "f6d", "f6f", "f70", "f72", "f74", "f75", "f76", "f77", "f7b", "f7c", "f7e", "f80", "f81", "f85", "f8a", "f8b", "f8c", "f8d", "f8e", "f92", "f93", "f94", "f95", "f97", "f98", "f99", "f9a", "f9b", "f9c", "f9d", "f9f", "fa0", "fa2", "fa3", "fa6", "fa8", "fa9", "fab", "fac", "fae", "fb0", "fb2", "fb3", "fb4", "fb5", "fb6", "fb7", "fb8", "fbc", "fbd", "fbe", "fc0", "fc2", "fc3", "fc5", "fc6", "fc9", "fca", "fcb", "fcc", "fcd", "fce", "fd0", "fd1", "fd3", "fd4", "fd5", "fda", "fdb", "fdc", "fdd", "fde", "fe0", "fe1", "fe3", "fe4", "fe5", "fe6", "fe7", "fed", "fee", "fef" ] } ] } ``` -------------------------------- ### Clone Hydrus Network Source Repository Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Clones the official Hydrus Network source code repository from GitHub into the current directory. This command creates the local 'hydrus' installation directory containing all necessary files. ```bash git clone https://github.com/hydrusnetwork/hydrus ``` -------------------------------- ### Legacy Hydrus Client Setup for Windows 7 Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Instructions for setting up the Hydrus client on Windows 7, which requires an older Python 3.8 and specific Git commands to clone the repository and checkout a compatible version due to library updates. ```Shell git clone https://github.com/hydrusnetwork/hydrus git checkout tags/v578 ``` -------------------------------- ### Install Qt6 Dependencies for Hydrus Client on Linux Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source If the Hydrus client fails to run with a Qt xcb platform plugin error, install these development packages on Debian/Ubuntu-based systems using apt. This resolves common Qt6 compatibility issues. ```Shell sudo apt install libicu-dev sudo apt install libxcb-cursor-dev ``` -------------------------------- ### Example JSON Response for Get Popups API Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api An example JSON object demonstrating the structure and content of the response from the GET /manage_popups/get_popups API endpoint. It illustrates various job status objects, including those for simple messages, downloaders, and subscriptions with detailed progress and file information. ```JSON { "job_statuses": [ { "key": "e57d42d53f957559ecaae3054417d28bfef3cd84bbced352be75dedbefb9a40e", "creation_time": 1700348905.7647762, "status_text_1": "This is a test popup message", "had_error": false, "is_cancellable": false, "is_cancelled": false, "is_done": true, "is_pausable": false, "is_paused": false, "is_working": true, "nice_string": "This is a test popup message" }, { "key": "0d9e134fe0b30b05f39062b48bd60c35cb3bf3459c967d4cf95dde4d01bbc801", "creation_time": 1700348905.7667763, "status_title": "sub gap downloader test", "had_error": false, "is_cancellable": false, "is_cancelled": false, "is_done": true, "is_pausable": false, "is_paused": false, "is_working": true, "nice_string": "sub gap downloader test", "user_callable_label": "start a new downloader for this to fill in the gap!" }, { "key": "d59173b59c96b841ab82a08a05556f04323f8446abbc294d5a35851fa01035e6", "creation_time": 1700689162.6635988, "status_text_1": "downloading files for \"elf\" (1/1)", "status_text_2": "file 4/27: downloading file", "status_title": "subscriptions - safebooru", "had_error": false, "is_cancellable": true, "is_cancelled": false, "is_done": false, "is_pausable": false, "is_paused": false, "is_working": true, "nice_string": "subscriptions - safebooru\r\ndownloading files for \"elf\" (1/1)\r\nfile 4/27: downloading file", "popup_gauge_2": [ 3, 27 ], "files": { "hashes": [ "9b5485f83948bf369892dc1234c0a6eef31a6293df3566f3ee6034f2289fe984", "cd6ebafb8b39b3455fe382cba0daeefea87848950a6af7b3f000b05b43f2d4f2", "422cebabc95fabcc6d9a9488060ea88fd2f454e6eb799de8cafa9acd83595d0d" ], "label": "safebooru: elf" }, "network_job": { "url": "https://somebooru.org//images/12345/4d7f62bb8675cef84760d6263e4c254c5129ef56.jpg", "waiting_on_connection_error": false, "domain_ok": true, "waiting_on_serverside_bandwidth": false, "no_engine_yet": false, "has_error": false, "total_data_used": 2031616, "is_done": false, "status_text": "downloading…", "current_speed": 2031616, "bytes_read": 2031616, "bytes_to_read": 3807369 } } ] } ``` -------------------------------- ### Run Hydrus Client Environment Setup on Linux Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Instructions for initiating the Hydrus Client API environment setup on Linux by executing the 'setup_venv.sh' script from a terminal. Users should avoid running this script with 'sudo' to prevent potential problems. ```Shell ./setup_venv.sh ``` -------------------------------- ### Install MkDocs Material Source: https://hydrusnetwork.github.io/hydrus/client_api.html/about_docs Instructions to install the MkDocs Material theme, which is the recommended installation method for working on the documentation locally. This uses the Python package installer, pip. ```Shell pip install mkdocs-material ``` -------------------------------- ### Example Requests for GET /get_files/thumbnail_path Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api Illustrative examples demonstrating how to construct requests to the /get_files/thumbnail_path endpoint using either a file_id or a hash, with an optional parameter for including file type. ```HTTP /get_files/thumbnail_path?file_id=452158 /get_files/thumbnail_path?hash=7f30c113810985b69014957c93bc25e8eb4cf3355dae36d8b9d011d8b0cf623a&include_thumbnail_filetype=true ``` -------------------------------- ### Install Qt6 libxcb-cursor-dev Dependency on Debian/Ubuntu Source: https://hydrusnetwork.github.io/hydrus/client_api.html/getting_started_installing This command installs the 'libxcb-cursor-dev' package using 'apt'. This package is crucial for Qt6 applications like Hydrus Client to load the 'xcb' platform plugin, resolving common runtime errors related to missing cursor libraries. ```Bash sudo apt install libxcb-cursor-dev ``` -------------------------------- ### Update Hydrus Client from Source Source: https://hydrusnetwork.github.io/hydrus/client_api.html/getting_started_installing Instructions for updating the Hydrus client when running from source, including commands for pulling the latest changes and optionally updating the virtual environment if dependencies have changed. ```Shell git pull # If it has been a few months since you made your venv, or the changelog talks about a new library version specifically, you might like to run setup_venv again. setup_venv ``` -------------------------------- ### Create Custom Hydrus Client Launch Shortcut on Windows Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source For Windows users, create a custom shortcut to run hydrus_client-user.bat via cmd.exe. This allows for custom database paths or launch arguments and is pinnable to the Start menu. ```Shell C:\Windows\System32\cmd.exe /c "C:\hydrus\Hydrus Source\hydrus_client-user.bat" ``` -------------------------------- ### Install Visual Studio Build Tools via Chocolatey on Windows Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source This set of Chocolatey commands provides a convenient way to install various Visual Studio redistributables and build tools on Windows. These tools are often required to compile Python packages that have C/C++ dependencies, helping to resolve 'Visual Studio C++' errors during pip install. ```Shell choco install -y vcredist-all choco install -y vcbuildtools (this is Visual Studio 2015) choco install -y visualstudio2017buildtools choco install -y visualstudio2022buildtools choco install -y windows-sdk-10.0 ``` -------------------------------- ### Install Qt6 libicu-dev Dependency on Debian/Ubuntu Source: https://hydrusnetwork.github.io/hydrus/client_api.html/getting_started_installing This command installs the 'libicu-dev' package using 'apt'. It is a necessary dependency for Qt6 applications like Hydrus Client to run correctly, especially when encountering 'xcb-cursor0' or 'libxcb-cursor0' errors related to Qt platform plugins. ```Bash sudo apt install libicu-dev ``` -------------------------------- ### Run Hydrus Client on Windows, Linux, and macOS Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Start the Hydrus client using platform-specific scripts. For Linux and macOS, ensure the scripts have execute permissions before running. ```Shell hydrus_client.bat ``` ```Shell hydrus_client.sh chmod +x hydrus_client.sh ``` ```Shell hydrus_client.command chmod +x hydrus_client.command ``` -------------------------------- ### Example JSON Response for GET /manage_pages/get_page_info (simple=true) Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api A sample JSON object returned by the GET /manage_pages/get_page_info endpoint when 'simple' is set to true. This response primarily shows downloader and management information, including details for multiple watcher imports. ```json { "page_info" : { "name" : "threads", "page_key" : "aebbf4b594e6986bddf1eeb0b5846a1e6bc4e07088e517aff166f1aeb1c3c9da", "page_state" : 0, "page_type" : 3, "is_media_page" : true, "management" : { "multiple_watcher_import" : { "watcher_imports" : [ { "url" : "https://someimageboard.net/m/123456", "watcher_key" : "cf8c3525c57a46b0e5c2625812964364a2e801f8c49841c216b8f8d7a4d06d85", "created" : 1566164269, "last_check_time" : 1566164272, "next_check_time" : 1566174272, "files_paused" : false, "checking_paused" : false, "checking_status" : 0, "subject" : "gundam pictures", "imports" : { "status" : "4 successful (2 already in db)", "simple_status" : "4", "total_processed" : 4, "total_to_process" : 4 }, "gallery_log" : { "status" : "1 successful", "simple_status" : "1", "total_processed" : 1, "total_to_process" : 1 } }, { "url" : "https://someimageboard.net/a/1234", "watcher_key" : "6bc17555b76da5bde2dcceedc382cf7d23281aee6477c41b643cd144ec168510", "created" : 1566063125, "last_check_time" : 1566063133, "next_check_time" : 1566104272, "files_paused" : false, "checking_paused" : true, "checking_status" : 1, "subject" : "anime pictures", "imports" : { "status" : "124 successful (22 already in db), 2 previously deleted", "simple_status" : "124", "total_processed" : 124, "total_to_process" : 124 }, "gallery_log" : { "status" : "3 successful", "simple_status" : "3", "total_processed" : 3, "total_to_process" : 3 } } ] }, "highlight" : "cf8c3525c57a46b0e5c2625812964364a2e801f8c49841c216b8f8d7a4d06d85" } }, "media" : { "num_files" : 4 } } ``` -------------------------------- ### Run Hydrus Client with Custom Database Path Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source This example demonstrates how to run the hydrus_client.py script while specifying a custom database directory using the -d launch argument. This allows users to manage their database location independently of the default 'db' directory. ```Shell #!/bin/bash source venv/bin/activate python hydrus_client.py -d="/path/to/database" ``` -------------------------------- ### Update Hydrus Client via Git or Source Extraction Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Update the Hydrus client quickly if installed with Git by pulling the latest changes. Alternatively, for zip installations, extract the new source over the existing directory. ```Shell git pull ``` ```Shell git_pull.bat ``` -------------------------------- ### Example Request for Get Potential Pairs API Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api Illustrates a sample HTTP GET request URL for the /manage_file_relationships/get_potential_pairs endpoint, including various query parameters for filtering potential duplicate pairs. ```HTTP /manage_file_relationships/get_potential_pairs?tag_service_key_1=c1ba23c60cda1051349647a151321d43ef5894aacdfb4b4e333d6c4259d56c5f&tags_1=%5B%22dupes_to_process%22%2C%20%22system%3Awidth%3C400%22%5D&potentials_search_type=1&pixel_duplicates=2&max_hamming_distance=0&max_num_pairs=50 ``` -------------------------------- ### Example GET Request for Potential Duplicates Count Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api An example URL path demonstrating how to query the `get_potentials_count` endpoint with various parameters, including tag service keys, tags, search types, pixel duplicate settings, and Hamming distance. ```HTTP /manage_file_relationships/get_potentials_count?tag_service_key_1=c1ba23c60cda1051349647a151321d43ef5894aacdfb4b4e333d6c4259d56c5f&tags_1=%5B%22dupes_to_process%22%2C%20%22system%3Awidth%3C400%22%5D&potentials_search_type=1&pixel_duplicates=2&max_hamming_distance=0&max_num_pairs=50 ``` -------------------------------- ### Example Request: Render File by Hash with Download Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api Example HTTP request to render a file using its SHA256 hash, with the 'download' option enabled to trigger browser download. ```HTTP /get_files/render?hash=7f30c113810985b69014957c93bc25e8eb4cf3355dae36d8b9d011d8b0cf623a&download=true ``` -------------------------------- ### Grant Execute Permissions for Setup Script on macOS Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Command to grant execute permissions to the 'setup_venv.command' file on macOS. This step is required if the file cannot be run directly, ensuring the script is executable for proper setup. ```Shell chmod +x setup_venv.command ``` -------------------------------- ### Grant Execute Permissions for Setup Script on Linux Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Command to grant execute permissions to the 'setup_venv.sh' script on Linux. This step is necessary if the file cannot be run directly due to insufficient permissions, ensuring the script is executable. ```Shell chmod +x setup_venv.sh ``` -------------------------------- ### Example Responses for GET /get_files/thumbnail_path Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api Sample JSON responses from the /get_files/thumbnail_path endpoint, showing the path to the thumbnail and an optional 'filetype' field when requested. ```JSON { "path" : "D:\\hydrus_files\\f7f\\7f30c113810985b69014957c93bc25e8eb4cf3355dae36d8b9d011d8b0cf623a.thumbnail" } { "path" : "C:\\hydrus_thumbs\\f85\\85daaefdaa662761d7cb1b026d7b101e74301be08e50bf09a235794ec8656f79.thumbnail", "filetype" : "image/png" } ``` -------------------------------- ### Example Request: Lookup SHA256 from MD5 Hash Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api An example HTTP GET request to the `/get_files/file_hashes` endpoint, demonstrating how to convert an MD5 hash to its corresponding SHA256 hash using query parameters. This shows a common use case for the hash lookup functionality. ```HTTP /get_files/file_hashes?hash=ec5c5a4d7da4be154597e283f0b6663c&source_hash_type=md5&desired_hash_type=sha256 ``` -------------------------------- ### Force Hydrus Client to Use X11 on Wayland Source: https://hydrusnetwork.github.io/hydrus/client_api.html/getting_started_installing This snippet shows how to set the QT_QPA_PLATFORM environment variable to 'xcb'. This forces the Hydrus client to launch using X11 instead of Wayland, which can resolve known compatibility issues on Wayland. ```Bash QT_QPA_PLATFORM=xcb ``` -------------------------------- ### Example Request Body for Setting File Relationships Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api An example JSON payload demonstrating how to use the POST /manage_file_relationships/set_file_relationships endpoint to set multiple file relationships, including content merge and deletion options. This example shows setting files as 'A is better' and 'same quality'. ```json { "relationships" : [ { "hash_a" : "b54d09218e0d6efc964b78b070620a1fa19c7e069672b4c6313cee2c9b0623f2", "hash_b" : "bbaa9876dab238dcf5799bfd8319ed0bab805e844f45cf0de33f40697b11a845", "relationship" : 4, "do_default_content_merge" : true, "delete_b" : true }, { "hash_a" : "22667427eaa221e2bd7ef405e1d2983846c863d40b2999ce8d1bf5f0c18f5fb2", "hash_b" : "65d228adfa722f3cd0363853a191898abe8bf92d9a514c6c7f3c89cfed0bf423", "relationship" : 4, "do_default_content_merge" : true, "delete_b" : true }, { "hash_a" : "0480513ffec391b77ad8c4e57fe80e5b710adfa3cb6af19b02a0bd7920f2d3ec", "hash_b" : "5fab162576617b5c3fc8caabea53ce3ab1a3c8e0a16c16ae7b4e4a21eab168a7", "relationship" : 2, "do_default_content_merge" : true } ] } ``` -------------------------------- ### Example Request: Get File by Hash with Download Option Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api Illustrates how to request a file using its SHA256 `hash` and trigger a browser download using the `download=true` parameter via the `/get_files/file` endpoint. This option requires access to all files. ```HTTP /get_files/file?hash=7f30c113810985b69014957c93bc25e8eb4cf3355dae36d8b9d011d8b0cf623a&download=true ``` -------------------------------- ### Set QT_API Environment Variable on Windows Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Sets the `QT_API` environment variable to 'pyqt6' in a Windows batch file. This allows users to explicitly select which Qt library (PySide6 or PyQt6) to use if multiple versions are installed, ensuring the correct one is loaded. ```batch set QT_API=pyqt6 ``` -------------------------------- ### Update Python's SQLite on Linux/macOS Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Installs `libsqlite3-dev` using `apt` and then `pysqlite3` via pip within a Python virtual environment. This process updates the SQLite version used by Python, significantly improving performance and enabling features like Fast Text Search (FTS) that hydrus needs. ```bash apt install libsqlite3-dev ``` ```bash (activate your venv) python -m pip install pysqlite3 ``` -------------------------------- ### Specify Hydrus Client SQLite Database Location via Command Line Source: https://hydrusnetwork.github.io/hydrus/client_api.html/database_migration This snippet provides examples for directing the hydrus_client executable to a specific SQLite database directory using the `-d` or `--db_dir` command-line arguments. This is crucial when the database has been moved from its default installation path to prevent the client from creating a new, empty database in the old location. Examples are provided for Windows command prompt, Python source execution, and macOS. ```cmd hydrus_client -d="D:\media\my_hydrus_database" ``` ```cmd hydrus_client --db_dir="G:\misc documents\New Folder (3)\DO NOT ENTER" ``` ```python python hydrus_client.py -d="D:\media\my_hydrus_database" ``` ```macos_shell open -n -a "Hydrus Network.app" --args -d="/path/to/db" ``` -------------------------------- ### URL Normalization: Equivalence Examples Source: https://hydrusnetwork.github.io/hydrus/client_api.html/downloader_url_classes Provides examples of different URLs that resolve to the same content, illustrating the need for normalization. This includes variations in HTTP/HTTPS protocols, query parameter order, and decorative path components that do not affect content. ```APIDOC Equivalence Examples: 1. HTTP vs HTTPS & Query Parameter Order: https://gelbooru.com/index.php?page=post&s=view&id=3767497 is equivalent to: https://gelbooru.com/index.php?id=3767497&page=post&s=view 2. Decorative Path Components: https://e621.net/post/show/1421754/abstract_background-animal_humanoid-blush-brown_ey is equivalent to: https://e621.net/post/show/1421754 is equivalent to: https://e621.net/post/show/1421754/help_computer-made_up_tags-REEEEEEEE ``` -------------------------------- ### Example Request: Render File by ID Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api Example HTTP request to render a file using its numerical file ID. ```HTTP /get_files/render?file_id=452158 ``` -------------------------------- ### Build Local Hydrus Client Help Documentation Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Instructions to run the 'setup_help' script to build local help documentation for the Hydrus Client. This step is not strictly necessary for functionality but is recommended for convenient local access to help files. ```Shell setup_help ``` -------------------------------- ### Example: Search Files API Request with Tags and Limit Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api Demonstrates an example URL request to the /get_files/search_files endpoint, searching for 16 files in the inbox with specific tags 'blue eyes', 'blonde hair', and 'кино'. This shows how to encode tags and system predicates in the URL. ```HTTP /get_files/search_files?tags=%5B%22blue%20eyes%22%2C%20%22blonde%20hair%22%2C%20%22%5Cu043a%5Cu0438%5Cu043d%5Cu043e%22%2C%20%22system%3Ainbox%22%2C%20%22system%3Alimit%3D16%22%5D ``` -------------------------------- ### Example Response: File Metadata JSON Structure Source: https://hydrusnetwork.github.io/hydrus/client_api.html/developer_api Provides a sample JSON response returned by the `/get_files/file_metadata` endpoint, detailing the comprehensive metadata fields for two example files, including service information, hashes, sizes, MIME types, dimensions, and various flags. ```JSON { "services" : "The Services Object", "metadata" : [ { "file_id" : 123, "hash" : "4c77267f93415de0bc33b7725b8c331a809a924084bee03ab2f5fae1c6019eb2", "size" : 63405, "mime" : "image/jpeg", "filetype_forced" : false, "filetype_human" : "jpeg", "filetype_enum" : 1, "ext" : ".jpg", "width" : 640, "height" : 480, "thumbnail_width" : 200, "thumbnail_height" : 150, "duration" : null, "time_modified" : null, "time_modified_details" : {}, "file_services" : { "current" : {}, "deleted" : {} }, "ipfs_multihashes" : {}, "has_audio" : false, "blurhash" : "U6PZfSi_.AyE_3t7t7R**0o#DgR4_3R*D%xt", "pixel_hash" : "2519e40f8105599fcb26187d39656b1b46f651786d0e32fff2dc5a9bc277b5bb", "num_frames" : null, "num_words" : null, "is_inbox" : false, "is_local" : false, "is_trashed" : false, "is_deleted" : false, "has_exif" : true, "has_human_readable_embedded_metadata" : true, "has_icc_profile" : true, "has_transparency" : false, "known_urls" : [], "ratings" : { "74d52c6238d25f846d579174c11856b1aaccdb04a185cb2c79f0d0e499284f2c" : null, "90769255dae5c205c975fc4ce2efff796b8be8a421f786c1737f87f98187ffaf" : null, "b474e0cbbab02ca1479c12ad985f1c680ea909a54eb028e3ad06750ea40d4106" : 0 }, "tags" : { "6c6f63616c2074616773" : { "storage_tags" : {}, "display_tags" : {} }, "37e3849bda234f53b0e9792a036d14d4f3a9a136d1cb939705dbcd5287941db4" : { "storage_tags" : {}, "display_tags" : {} }, "616c6c206b6e6f776e2074616773" : { "storage_tags" : {}, "display_tags" : {} } }, "file_viewing_statistics" : [ { "canvas_type" : 0, "canvas_type_pretty" : "media viewer", "views" : 0, "viewtime" : 0, "last_viewed_timestamp" : null }, { "canvas_type" : 1, "canvas_type_pretty" : "preview viewer", "views" : 0, "viewtime" : 0, "last_viewed_timestamp" : null }, { "canvas_type" : 4, "canvas_type_pretty" : "client api viewer", "views" : 0, "viewtime" : 0, "last_viewed_timestamp" : null } ] }, { "file_id" : 4567, "hash" : "3e7cb9044fe81bda0d7a84b5cb781cba4e255e4871cba6ae8ecd8207850d5b82", "size" : 199713, "mime" : "video/webm", "filetype_forced" : false, "filetype_human" : "webm", "filetype_enum" : 21, "ext" : ".webm", "width" : 1920, "height" : 1080, "thumbnail_width" : 200, "thumbnail_height" : 113, "duration" : 4040 ``` -------------------------------- ### Display Python Virtual Environment Help Source: https://hydrusnetwork.github.io/hydrus/client_api.html/running_from_source Shows the help message for the Python virtual environment module, useful for understanding its command-line options and usage for creating isolated Python environments. ```bash python3 -m venv --help ```