### Install aqtinstall and Qt on Linux Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/compilation.md Use pip to install the aqtinstall tool and then use it to download and install a specific version of Qt for Linux desktop development with the specified modules. ```bash pip install aqtinstall aqt install-qt linux desktop 6.6.3 gcc_64 -m qtmultimedia qtimageformats qtnetworkauth qtshadertools ``` -------------------------------- ### Install Grabber via Homebrew Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/install/macos.md Execute this command after adding the tap to install the Grabber application using Homebrew. ```bash brew install imgbrd-grabber ``` -------------------------------- ### Install Grabber via Flatpak Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/install/linux.md Install the Grabber application using Flatpak from the Flathub repository. ```bash flatpak install flathub org.bionus.Grabber ``` -------------------------------- ### Install Qt6 using Homebrew Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/compilation.md Installs the Qt6 framework using the Homebrew package manager on macOS. ```bash brew install qt6 ``` -------------------------------- ### Install Translation Files Source: https://github.com/bionus/imgbrd-grabber/blob/master/src/languages/CMakeLists.txt Installs the generated .qm translation files to the appropriate destination directory based on the operating system. For Apple/Unix systems, it installs into the application bundle; otherwise, it installs into a general share directory. ```cmake if(APPLE AND UNIX) install(FILES ${QM_FILES} DESTINATION Grabber.app/Contents/Resources/languages) else() install(FILES ${QM_FILES} DESTINATION share/Grabber/languages) endif() ``` -------------------------------- ### Install Build Tools on Fedora Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/compilation.md Installs the C++ compiler, CMake, and make utilities on Fedora using dnf. ```bash sudo dnf install -y "gcc-c++" "cmake" "make" --best ``` -------------------------------- ### Install Open Package for Browser Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/commands/danbooru.md Installs the 'open' Node.js package globally, required for opening new images in the browser. ```bash npm install -g open ``` -------------------------------- ### Initialize Blacklist and Cookie Setup Source: https://github.com/bionus/imgbrd-grabber/blob/master/src/lib/tests/resources/pages/idol.sankakucomplex.com/results.html Sets up blacklist options and initializes blacklisted items. Also sets up cookies. ```javascript Post.blacklist_options={replace:false};Post.init_blacklisted(); Cookie.setup() ``` -------------------------------- ### Install Homebrew and Dependencies on macOS Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/compilation.md Installs Homebrew, Qt6, and GCC compiler required for building the project on macOS. ```bash ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew install qt6 brew install gcc brew install cmake ``` -------------------------------- ### Install Database Support Packages Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/compilation.md Install necessary packages for database support on Debian-based systems like Raspbian. ```bash sudo apt install libqt5sql5-mysql sudo apt install libqt5sql5-odbc sudo apt install libqt5sql5-psql ``` -------------------------------- ### Token with Options Example Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/filename.md Demonstrates how to add options to a token, including setting a value and omitting it for a boolean option. ```text %token:option1=value1,option2% ``` -------------------------------- ### Project and Testing Setup Source: https://github.com/bionus/imgbrd-grabber/blob/master/src/gui/tests/CMakeLists.txt Initializes the CMake project for GUI tests and enables testing. Defines a general test macro. ```cmake project(gui-tests) # General enable_testing() add_definitions(-DTEST=1) ``` -------------------------------- ### Run Grabber via Flatpak Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/install/linux.md Launch the Grabber application after installing it with Flatpak. ```bash flatpak run org.bionus.Grabber ``` -------------------------------- ### Install Translation Files Source: https://github.com/bionus/imgbrd-grabber/blob/master/src/crash-reporter/languages/CMakeLists.txt Installs the generated QM translation files to the appropriate location based on the operating system. Use this to ensure translations are available at runtime. ```cmake if(APPLE AND UNIX) install(FILES ${QM_FILES} DESTINATION Grabber.app/Contents/Resources/crashreporter) else() install(FILES ${QM_FILES} DESTINATION share/Grabber/crashreporter) endif() ``` -------------------------------- ### Compile QScintilla on Linux Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/compilation.md Steps to compile and install QScintilla from source on Linux, including running qmake, make, and make install. ```bash cd src qmake qscintilla.pro make make install ``` -------------------------------- ### Install Build Tools on Debian/Ubuntu Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/compilation.md Installs the g++ compiler, CMake, and make utilities on Debian-based Linux distributions using apt. ```bash sudo apt install -y "g++" "cmake" "make" ``` -------------------------------- ### Compile QScintilla on Windows Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/compilation.md Steps to compile and install QScintilla from source on Windows using the Qt command prompt and nmake. ```bash cd src qmake qscintilla.pro nmake nmake install ``` -------------------------------- ### Set Runtime Output Directory and Install Target Source: https://github.com/bionus/imgbrd-grabber/blob/master/src/gui/CMakeLists.txt Configures the runtime output directory for non-Android builds and installs the target executable to the 'bin' directory on the system. ```cmake set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/gui/$<0:>" OUTPUT_NAME "Grabber") install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) ``` -------------------------------- ### Install NodeJS Global Packages Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/commands/danbooru.md Installs the axios and form-data Node.js packages globally. Ensure NODE_PATH is set correctly. ```bash npm install -g axios form-data ``` -------------------------------- ### HTML Form Example for POST Login Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/website-login.md This HTML form structure is used as an example to configure the 'POST' login method. It shows the typical fields required for a login submission. ```html
Name
Password
``` -------------------------------- ### Date Formatting Examples Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/filename.md Demonstrates various date and time format specifiers for filename customization. Ensure to avoid OS-forbidden characters in your format string. ```text dd.MM.yyyy 21.05.2001 ``` ```text ddd MMMM d yy Tue May 21 01 ``` ```text hh:mm:ss.zzz 14:13:09.042 ``` ```text h:m:s ap 2:13:9 pm ``` -------------------------------- ### Conditional Token Example - Artist Present Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/filename.md Example output when both 'artist' and 'character' tokens are present in the image data. ```text image - %artist% some text test %md5%.%ext% ``` -------------------------------- ### Install AUR Package on Arch Linux Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/install/linux.md Install an imgbrd-grabber package from the Arch User Repository (AUR) using paru. ```bash paru -Sy imgbrd-grabber-bin ``` -------------------------------- ### Date Formatting with Custom Format Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/filename.md Example of applying a specific date format string to the current date. ```text %date:format=yyyy-MM-dd% 2001-05-21 ``` -------------------------------- ### Install GCC Compiler using Homebrew Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/compilation.md Installs the GNU Compiler Collection (GCC) using Homebrew on macOS, which may be needed for compilation. ```bash brew install gcc ``` -------------------------------- ### Executable Files Location Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/portable-version.md This is the default directory where the program's executable files are installed. ```plaintext "C:/Program Files/Grabber" ``` -------------------------------- ### Add Homebrew Tap for Grabber Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/install/macos.md Use this command to add the necessary repository for installing Grabber via Homebrew. ```bash brew tap Bionus/imgbrd-grabber ``` -------------------------------- ### Tag Loader Log Example Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/tools/tag-loader.md This log indicates that the source might benefit from a pre-loaded tag database. It specifically points out issues with loading tags from filename tokens. ```text Not enough information to directly load the image (from blacklist: 0 / from file url: 0 / from filename tags: 1/1) ``` -------------------------------- ### Time Zone Override Examples Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/filename.md Illustrates how to specify different time zones for date formatting, including server, local, and IANA time zones. ```text %date% 05-18-2021 17.32 ``` ```text %date:timezone=server% 05-18-2021 17.32 ``` ```text %date:timezone=local% 05-18-2021 23.32 ``` ```text %date:timezone=UTC% 05-18-2021 22.32 ``` ```text %date:timezone=Europe/Paris% 05-18-2021 23.32 ``` -------------------------------- ### ExifTool Field Mappings (Configuration) Source: https://context7.com/bionus/imgbrd-grabber/llms.txt Example configuration for mapping Grabber metadata fields to ExifTool tags for embedding into image files. Shows sidecar file modes. ```text # Example Exiftool field mappings in Grabber settings: IPTC.Keywords → %all% XMP.Creator → %artist% XMP.Description → %copyright% %character% # Sidecar file modes: # - Disabled : never write .xmp sidecar ``` -------------------------------- ### Blacklist Syntax Example Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/search.md Illustrates how to define blacklist rules, where each line represents a condition for an image to be considered blacklisted. These rules use the same syntax as post-filters. ```plaintext tag1 tag2 tag3 tag4 rating:safe ``` -------------------------------- ### Enable Binary Logging for Gelbooru Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/commands/gelbooru.md This SQL command is required during the Gelbooru installation process to enable binary logging, which is necessary for certain database operations. ```sql SET GLOBAL log_bin_trust_function_creators = 1; ``` -------------------------------- ### CSS Stylesheet for UI Theming Source: https://context7.com/bionus/imgbrd-grabber/llms.txt Example Qt stylesheet for customizing the Grabber application's user interface. This allows for dark themes with light text and custom tab styling. Refer to the Qt stylesheet documentation for more options. ```css /* style.css example — dark background with light text */ QMainWindow { background-color: #1e1e1e; color: #d4d4d4; } QTabBar::tab:selected { background: #007acc; color: white; } /* Full Qt stylesheet reference: https://doc.qt.io/qt-5/stylesheet-reference.html */ ``` -------------------------------- ### XML Site Configuration Example Source: https://github.com/bionus/imgbrd-grabber/wiki/New-XML-source-(legacy) This XML structure defines the configuration for a website source, including its name, various API endpoints (XML, JSON, HTML), and regular expressions for parsing specific data like tags, images, and pagination. ```xml Danbooru /post/index.xml?login={pseudo}&password_hash={password}&limit={limit}&page={page}&tags={tags} /post/index.json?login={pseudo}&password_hash={password}&limit={limit}&page={page}&tags={tags} /post/index?login={pseudo}&password_hash={password}&limit={limit}&page={page}&tags={tags} /post/show/{id} <li class="tag-type-([^"]+)">.*<a href="[^"]+"[^>]*>([^< ]+)</a>.*<span class="post-count">(\\d+)</span>.*</li> <span class=".*" id="p(\\d*)">.*<a .*>.*(<img[ ]+class=".*" src="((?:.*)/data/preview/(.*).jpg)" title="(.+) rating:(.*) score:(.*) user:(.*)" alt=".*" width=.* height=.*>).*</a>.*</span> id|image|preview_url|md5|tags|rating|score|user <link href="/post\?limit=\\d*&page=(\\d*)&tags=[^"\"]*" rel="last" title="Last Page"> <div class="status-notice" id="pool\\d+">[^<]*Pool:[^<]*(?:<a href="/post/show/(\\d+)" >&lt;&lt;</a>)?[^<]*<a href="/pool/show/(\\d+)" >([^<]+)</a>[^<]*(?:<a href="/post/show/(\\d+)" >&gt;&gt;</a>)?[^<]*</div> <div id="sidebar-wiki"(?:[^>]+)>(.+)</div> rating:safe rating:questionable rating:explicit user: fav: fastfav: md5: source: id: width: height: score: mpixels: filesize: date: gentags: arttags: chartags: copytags: approver: parent: sub: status:any status:deleted status:active status:flagged status:pending order:id order:id_desc order:score order:score_asc order:mpixels order:mpixels_asc order:filesize order:landscape order:portrait order:favcount order:rank order:change order:change_desc parent:none unlocked:rating 1 ``` -------------------------------- ### Install Homebrew Package Manager Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/compilation.md Command to install Homebrew, a package manager for macOS, which is a prerequisite for installing other development tools. ```bash ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ``` -------------------------------- ### Build imgbrd-grabber Project Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/compilation.md Standard build process using CMake and Make. Ensure you are in the 'build' directory. ```bash mkdir build cd build cmake ../src make cd .. mv "build/gui/Grabber" "release/" touch "release/settings.ini" ``` -------------------------------- ### Conditional Token Example - Artist Absent Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/filename.md Example output when the 'artist' token is missing or empty in the image data. ```text image - %md5%.%ext% ``` -------------------------------- ### Set Up Android Package Directory and Assets Source: https://github.com/bionus/imgbrd-grabber/blob/master/src/gui/CMakeLists.txt Prepares the directory structure for the Android package and copies necessary assets, including sites and translations. It also removes unnecessary files like node_modules. ```cmake set(ANDROID_PACKAGE_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/android_package") file(REMOVE_RECURSE "${ANDROID_PACKAGE_SOURCES}") file(MAKE_DIRECTORY "${ANDROID_PACKAGE_SOURCES}") file(COPY "${CMAKE_CURRENT_LIST_DIR}/../dist/android/" DESTINATION "${ANDROID_PACKAGE_SOURCES}") file(COPY "${CMAKE_CURRENT_LIST_DIR}/../dist/common/" DESTINATION "${ANDROID_PACKAGE_SOURCES}/assets") ``` -------------------------------- ### CMakeLists.txt Configuration Source: https://github.com/bionus/imgbrd-grabber/blob/master/src/e2e/CMakeLists.txt Defines the project name, finds required Qt6 components, sets up source file discovery, and links libraries for the executable. ```cmake project(e2e) find_package(Qt6 COMPONENTS Core REQUIRED) set(QT_LIBRARIES Qt6::Core) file(GLOB_RECURSE SOURCES "src/*.cpp") include_directories("src/" "../lib/src/" "..") add_executable(${PROJECT_NAME} ${SOURCES}) target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${LIBS} lib) ``` -------------------------------- ### Initialize Blacklisted Options Source: https://github.com/bionus/imgbrd-grabber/blob/master/src/lib/tests/resources/pages/idol.sankakucomplex.com/results-animated.html Sets up post blacklist options, allowing for replacement of existing entries. This is called after post registration. ```javascript Post.blacklist_options={replace:false}; Post.init_blacklisted(); ``` -------------------------------- ### Configuration File and Directory Structure Source: https://context7.com/bionus/imgbrd-grabber/llms.txt Lists the key configuration files and directories used by Grabber on both Windows and Linux systems. Essential for managing settings, favorites, and plugins. ```text # Windows C:\Users\%USERNAME%\AppData\Local\Bionus\Grabber\ # Linux $HOME/.config/Bionus/Grabber/ Key files: settings.ini ← all GUI-configurable options favorites.json ← saved favorite tags with last-seen dates monitors.json ← periodic download monitors blacklist.txt ← blacklist rules (one per line) md5s.txt ← flat-file MD5 download history md5s.sqlite ← SQLite MD5 download history (beta) tabs.json ← currently open search tabs commands.log ← log of executed non-SQL commands commands.sql ← log of executed SQL commands main.log ← full session log Key directories: sites/ ← installed source plugins themes/ ← installed CSS themes thumbs/ ← cached favorite thumbnails cache/ ← HTTP response cache ``` -------------------------------- ### Project Configuration and Testing Source: https://github.com/bionus/imgbrd-grabber/blob/master/src/crash-reporter/tests/CMakeLists.txt Sets up the project name and enables testing. Defines a test compilation flag. ```cmake project(crash-reporter-tests) # General enable_testing() add_definitions(-DTEST=1) ``` -------------------------------- ### Set Source Hosts Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/cli.md Use the `-s` or `--sources` parameter to specify a list of hosts to connect to, separated by spaces. ```bash ./grabber -c -s "danbooru.donmai.us gelbooru.com" ``` -------------------------------- ### Get Property Safely Source: https://github.com/bionus/imgbrd-grabber/blob/master/src/sites/Danbooru (2.0)/resources/search.html Safely retrieves a property from an object, defining it if it doesn't exist. This is useful for ensuring properties are available before access. ```javascript function r(e,n,t){if(i.call(e,n))return e[n];var r=t();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!1}),r}catch(o){}return e[n]=r,r}var i=Object.prototype.hasOwnProperty ``` -------------------------------- ### Compile imgbrd-grabber on Raspberry Pi Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/compilation.md Execute the build script after navigating to the project directory. Assumes you have cloned the repository. ```bash cd imgbrd-grabber ./build.sh ``` -------------------------------- ### Retrieve a list of tags Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/cli.md Use the --return-pure-tags option to get a simple list of tags, each on a new line, along with their count and type. ```bash ./grabber -c -s "danbooru.donmai.us" -i 5 --return-pure-tags tsukimare_mitsuki 1 artist pukapukapukka2007 1 artist aria1211 1 artist ksnatc-t_am 1 artist joyacuson 1 artist ``` -------------------------------- ### Basic Source Structure Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/sites/source-example.md Defines the fundamental structure of a source with a name and an empty API object. This is the starting point for any new source implementation. ```typescript export const source: ISource = { name: "Danbooru", apis: {}, }; ``` -------------------------------- ### Make AppImage Executable Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/install/linux.md Use this command to grant execute permissions to the downloaded AppImage file. ```bash chmod +x Grabber_*-x86_64.AppImage ``` -------------------------------- ### Check Global Node Modules Path Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/commands/danbooru.md Prints the root path for globally installed Node.js modules. Useful for verifying the NODE_PATH environment variable. ```bash npm root -g ``` -------------------------------- ### Build imgbrd-grabber on macOS Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/compilation.md Build process for macOS using CMake and Make. This includes setting up the build directory and compiling the application. ```bash mkdir build cd build cmake .. make cd .. mv build/gui/gui.app release/Grabber.app cp -r ./release/* $appDir touch $appDir/settings.ini ``` -------------------------------- ### Configure New Relic Loader Source: https://github.com/bionus/imgbrd-grabber/blob/master/src/sites/Danbooru (2.0)/resources/tags.html Sets up the loader configuration for New Relic, specifying the license key and application ID. ```javascript window.NREUM||(NREUM={}).loader_config={licenseKey:"fa197ca248",applicationID:"71204"} ``` -------------------------------- ### Get Tags Source: https://github.com/bionus/imgbrd-grabber/blob/master/docs/docs/cli.md Use the `--return-tags` flag to retrieve tags associated with images. Each result is printed on a new line, with parts separated by a tab character. ```bash ./grabber -c -t "inugami_kira" -s "danbooru.donmai.us" --return-tags inugami_kira 288 artist highres 458000 general 1girl 1090000 general absurdres 87000 general thighhighs 257000 general ... ``` ```bash ./grabber -c -t "inugami_kira" -s "danbooru.donmai.us gelbooru.com" --return-tags inugami_kira 585 artist highres 1078790 general 1girl 1736509 general absurdres 203970 general thighhighs 613879 general ... ``` -------------------------------- ### Prepare Translation Files Source: https://github.com/bionus/imgbrd-grabber/blob/master/src/gui-qml/languages/CMakeLists.txt This section prepares lists of .ts files. One list specifically includes 'YourLanguage.ts', while another uses 'file(GLOB ...)' and 'listFilterRegex' to gather all other .ts files in the QM directory. ```cmake set(TS_FILES_FOR_TS "${CMAKE_CURRENT_SOURCE_DIR}/YourLanguage.ts") file(GLOB TS_FILES_FOR_QM "*.ts") include(ListFilterRegex) listFilterRegex(TS_FILES_FOR_QM "YourLanguage.ts$") ``` -------------------------------- ### HTML Link to Tag List Source: https://github.com/bionus/imgbrd-grabber/blob/master/src/lib/tests/resources/pages/gelbooru.com/tags.html An example of an HTML link to a specific tag's post list on Gelbooru. The URL structure indicates the page, action, and the tag parameter. ```html underwear ```