<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>朝舞网</title><link>https://ii74.com/</link><description>哎哎启示</description><item><title>QT的MaintenanceTool经常下载失败，下载链接断开的解决方法</title><link>https://ii74.com/post/6444.html</link><description>&lt;p&gt;快捷方式增加命令&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://ii74.com/zb_users/upload/2025/04/202504181744959060194030.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;C:\Qt\MaintenanceTool.exe --start-package-manager --mirror https://mirrors.aliyun.com/qt&lt;/p&gt;</description><pubDate>Fri, 18 Apr 2025 14:50:28 +0800</pubDate></item><item><title>webui-forge 使用方法</title><link>https://ii74.com/post/6443.html</link><description>&lt;p&gt;下载地址：&lt;br/&gt;&lt;/p&gt;&lt;p&gt;stable-diffusion-webui-forge&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #FFFFFF; color: #4D4D4D; font-family: arial; font-size: 18px;&quot;&gt;中文插件：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #FFFFFF; color: #4D4D4D; font-family: arial; font-size: 18px;&quot;&gt;&lt;a href=&quot;https://github.com/hanamizuki-ai/stable-diffusion-webui-localization-zh_Hans&quot; _src=&quot;https://github.com/hanamizuki-ai/stable-diffusion-webui-localization-zh_Hans&quot;&gt;https://github.com/hanamizuki-ai/stable-diffusion-webui-localization-zh_Hans&lt;/a&gt; &lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;flux1.dev&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://huggingface.co/black-forest-labs/FLUX.1-dev&quot; _src=&quot;https://huggingface.co/black-forest-labs/FLUX.1-dev&quot;&gt;https://huggingface.co/black-forest-labs/FLUX.1-dev&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;### WebUI-Forge 一键包使用 Flux.1.dev 模型出图教程&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;WebUI-Forge 是一个基于 Stable Diffusion 的 Web 用户界面，允许用户通过简单的操作生成高质量的图像。Flux.1.dev 是一个基于 Stable Diffusion 的模型，能够生成具有艺术风格的图像。本教程将指导你如何使用 WebUI-Forge 一键包，并加载 Flux.1.dev 模型来生成图像。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#### 准备工作&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;1. **下载 WebUI-Forge 一键包**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 访问 WebUI-Forge 的 GitHub 页面或相关下载链接，下载最新的一键包。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 解压下载的文件到一个合适的目录。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2. **下载 Flux.1.dev 模型**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 访问 Flux.1.dev 的模型下载页面，下载模型文件（通常是一个 `.ckpt` 或 `.safetensors` 文件）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 将下载的模型文件放置在 WebUI-Forge 的 `models` 目录下。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#### 启动 WebUI-Forge&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;1. **运行启动脚本**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 进入解压后的 WebUI-Forge 目录，找到 `run.bat`（Windows）或 `run.sh`（Linux/macOS）文件。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 双击 `run.bat` 或运行 `./run.sh` 启动 WebUI-Forge。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2. **等待启动完成**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 启动脚本会自动安装所需的依赖并启动 WebUI-Forge。等待命令行窗口显示类似 `Running on local URL: http://127.0.0.1:7860` 的信息。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;3. **访问 WebUI**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 打开浏览器，访问 `http://127.0.0.1:7860`，进入 WebUI-Forge 的用户界面。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#### 加载 Flux.1.dev 模型&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;1. **选择模型**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 在 WebUI-Forge 的界面中，找到左上角的模型选择下拉菜单。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 点击下拉菜单，选择你之前下载并放置的 Flux.1.dev 模型。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2. **加载模型**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 选择模型后，WebUI-Forge 会自动加载模型。加载完成后，界面会显示模型已加载的提示。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#### 生成图像&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;1. **设置生成参数**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- **Prompt**：在 `Prompt` 输入框中输入你想要生成图像的描述。例如：“A beautiful landscape with mountains and a river”。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- **Negative Prompt**：在 `Negative Prompt` 输入框中输入你不希望在图像中出现的内容。例如：“blurry, low quality”。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- **Sampling Steps**：设置采样步数，通常 20-50 步之间可以获得较好的效果。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- **CFG Scale**：设置 CFG 值，控制生成图像与提示词的匹配程度。通常 7-12 之间较为合适。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- **Width/Height**：设置生成图像的宽度和高度，例如 512x512 或 768x768。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2. **生成图像**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 点击 `Generate` 按钮，WebUI-Forge 会开始生成图像。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 生成完成后，图像会显示在右侧的预览窗口中。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;3. **保存图像**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 如果对生成的图像满意，可以点击图像下方的 `Save` 按钮，将图像保存到本地。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#### 高级设置（可选）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;1. **使用不同的采样器**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 在 `Sampling Method` 下拉菜单中，可以选择不同的采样器，如 `Euler a`、`DDIM` 等，尝试不同的采样器可能会得到不同的效果。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2. **调整种子（Seed）**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 在 `Seed` 输入框中，可以设置一个固定的种子值，以便在相同的参数下生成相同的图像。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;3. **批量生成**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 在 `Batch Count` 和 `Batch Size` 中设置批量生成的参数，一次性生成多张图像。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#### 结束使用&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;1. **关闭 WebUI-Forge**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 在命令行窗口中按下 `Ctrl+C`，停止 WebUI-Forge 的运行。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2. **清理资源**：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 如果你不再使用 WebUI-Forge，可以关闭命令行窗口并删除相关文件以释放磁盘空间。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;### 总结&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;通过以上步骤，你已经成功使用 WebUI-Forge 一键包加载 Flux.1.dev 模型并生成了图像。你可以继续探索不同的参数设置和模型，以获得更多样化的图像生成效果。祝你玩得愉快！&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Thu, 13 Feb 2025 17:43:47 +0800</pubDate></item><item><title>vs2022使用c++ std::any_of 等 c++ 11 标准语言时，提示报错namespace &amp;quot;std&amp;quot; has no member &amp;quot;all_of&amp;quot;</title><link>https://ii74.com/post/6442.html</link><description>&lt;p&gt;vs2022使用c++ std::any_of 等 c++ 11 标准语言时，提示报错namespace &amp;quot;std&amp;quot; has no member &amp;quot;all_of&amp;quot; 时怎么办&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;在当前文件引入头&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-cpp&quot; style=&quot;margin-top: 0px; margin-bottom: calc(1.5em); padding: var(--su12); border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-stretch: inherit; line-height: var(--lh-md); font-family: var(--ff-mono); font-optical-sizing: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-size: var(--fs-body1); vertical-align: baseline; box-sizing: inherit; width: auto; max-height: 600px; overflow: auto; background-color: var(--highlight-bg); border-radius: var(--br-md); --_cb-line-numbers-bg: var(--black-150); color: rgb(12, 13, 14); overflow-wrap: normal; --theme-base-primary-color-h: 27; --theme-base-primary-color-s: 89%; --theme-base-primary-color-l: 48%; --theme-primary-custom-100: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + ((100% - var(--theme-base-primary-color-l)) * .9))); --theme-primary-custom-200: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + ((100% - var(--theme-base-primary-color-l)) * .75))); --theme-primary-custom-300: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + ((100% - var(--theme-base-primary-color-l)) * .5))); --theme-primary-custom-400: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), var(--theme-base-primary-color-l)); --theme-primary-custom-500: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + (var(--theme-base-primary-color-l) * -.3))); --theme-primary-custom-600: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + (var(--theme-base-primary-color-l) * -.6))); --theme-primary-custom: var(--theme-primary-custom-400); --theme-button-color: initial; --theme-button-hover-color: initial; --theme-button-hover-background-color: initial; --theme-button-active-background-color: initial; --theme-button-selected-color: initial; --theme-button-selected-background-color: initial; --theme-button-outlined-border-color: initial; --theme-button-outlined-selected-border-color: initial; --theme-button-primary-color: initial; --theme-button-primary-active-color: initial; --theme-button-primary-hover-color: initial; --theme-button-primary-selected-color: initial; --theme-button-primary-background-color: initial; --theme-button-primary-active-background-color: initial; --theme-button-primary-hover-background-color: initial; --theme-button-primary-selected-background-color: initial; --theme-background-color: var(--white); --theme-background-position: top left; --theme-background-repeat: repeat; --theme-background-size: auto; --theme-background-attachment: auto; --theme-content-background-color: var(--white); --theme-content-border-color: var(--black-225); --theme-header-background-color: var(--theme-primary); --theme-header-background-position: center left; --theme-header-background-repeat: repeat; --theme-header-background-size: auto; --theme-header-background-border-bottom: 0; --theme-header-link-color: var(--theme-primary); --theme-header-sponsored-color: hsla(0,0%,100%,0.4); --theme-header-foreground-color: transparent; --theme-header-foreground-position: bottom right; --theme-header-foreground-repeat: no-repeat; --theme-header-foreground-size: auto; --theme-footer-background-color: hsl(210,8%,5%); --theme-footer-background-position: top left; --theme-footer-background-repeat: no-repeat; --theme-footer-background-size: auto; --theme-footer-background-border-top: 0; --theme-footer-title-color: var(--black-250); --theme-footer-text-color: var(--black-300); --theme-footer-link-color: var(--black-300); --theme-footer-link-color-hover: var(--black-200); --theme-footer-divider-color: var(--black-500); --theme-footer-padding-top: 0; --theme-footer-padding-bottom: 0; --theme-link-color: initial; --theme-link-color-hover: initial; --theme-link-color-visited: initial; --theme-body-font-family: var(--ff-sans); --theme-body-font-color: var(--black-600); --theme-post-title-font-family: var(--ff-sans); --theme-post-title-color: var(--theme-link-color); --theme-post-title-color-hover: var(--theme-link-color-hover); --theme-post-title-color-visited: var(--theme-link-color-visited); --theme-post-body-font-family: var(--ff-sans); --theme-post-owner-background-color: var(--theme-secondary-100); --theme-post-owner-new-background-color: var(--theme-secondary-200); --theme-topbar-bottom-border: 1px solid var(--black-225);&quot;&gt;
#include&amp;nbsp;&amp;lt;algorithm&amp;gt;&lt;/pre&gt;</description><pubDate>Tue, 06 Aug 2024 14:23:40 +0800</pubDate></item><item><title>ChromeDriverManager 镜像地址</title><link>https://ii74.com/post/6441.html</link><description>今天运行了个浏览器的模拟python，但是提示 could not reach host. are you offline?
找到原因是浏览器更新了，驱动插件过期了，需要在线下载，以前可以通过本地代理下载，但是最近墙高了，所以找到个镜像下载的方法。
最后还是需要建议尽量用其他的库，国内网络环境不太好。

&lt;pre class=&quot;prism-highlight prism-language-python&quot;&gt;import os
from typing import Optional
from packaging import version
from webdriver_manager.core.logger import log

from webdriver_manager.core.download_manager import DownloadManager
from webdriver_manager.core.driver_cache import DriverCacheManager
from webdriver_manager.core.manager import DriverManager
from webdriver_manager.core.os_manager import OperationSystemManager, ChromeType
from webdriver_manager.drivers.chrome import ChromeDriver


class ExtChromeDriver(ChromeDriver):
    def get_driver_download_url(self, os_type):
        driver_version_to_download = self.get_driver_version_to_download()
        # For Mac ARM CPUs after version 106.0.5249.61 the format of OS type changed
        # to more unified &amp;quot;mac_arm64&amp;quot;. For newer versions, it&amp;#39;ll be &amp;quot;mac_arm64&amp;quot;
        # by default, for lower versions we replace &amp;quot;mac_arm64&amp;quot; to old format - &amp;quot;mac64_m1&amp;quot;.
        if version.parse(driver_version_to_download) &amp;lt; version.parse(&amp;quot;106.0.5249.61&amp;quot;):
            os_type = os_type.replace(&amp;quot;mac_arm64&amp;quot;, &amp;quot;mac64_m1&amp;quot;)

        if version.parse(driver_version_to_download) &amp;gt;= version.parse(&amp;quot;115&amp;quot;):
            if os_type == &amp;quot;mac64&amp;quot;:
                os_type = &amp;quot;mac-x64&amp;quot;
            if os_type in [&amp;quot;mac_64&amp;quot;, &amp;quot;mac64_m1&amp;quot;, &amp;quot;mac_arm64&amp;quot;]:
                os_type = &amp;quot;mac-arm64&amp;quot;

            modern_version_url = self.get_url_for_version_and_platform(driver_version_to_download, os_type)
            log(f&amp;quot;Modern chrome version {modern_version_url}&amp;quot;)
            return modern_version_url

        return f&amp;quot;{self._url}/{driver_version_to_download}/{self.get_name()}_{os_type}.zip&amp;quot;

    def get_browser_type(self):
        return self._browser_type

    def get_latest_release_version(self):
        determined_browser_version = self.get_browser_version_from_os()
        log(f&amp;quot;Get LATEST {self._name} version for {self._browser_type}&amp;quot;)
        if determined_browser_version is not None and version.parse(determined_browser_version) &amp;gt;= version.parse(&amp;quot;115&amp;quot;):
            url = &amp;quot;https://registry.npmmirror.com/-/binary/chrome-for-testing&amp;quot;
            response = self._http_client.get(url)
            response_list = response.json()
            determined_browser_version = self.get_version_form_net(determined_browser_version, response_list)
            if determined_browser_version.endswith(&amp;quot;/&amp;quot;):
                determined_browser_version = determined_browser_version[:-1]
            return determined_browser_version
            # Remove the build version (the last segment) from determined_browser_version for version &amp;lt; 113
        determined_browser_version = &amp;quot;.&amp;quot;.join(determined_browser_version.split(&amp;quot;.&amp;quot;)[:3])
        latest_release_url = (
            self._latest_release_url
            if (determined_browser_version is None)
            else f&amp;quot;{self._latest_release_url}_{determined_browser_version}&amp;quot;
        )
        resp = self._http_client.get(url=latest_release_url)
        return resp.text.rstrip()

    def get_version_form_net(self, os_version, net_versions):
        for v in net_versions:
            if os_version in v[&amp;quot;name&amp;quot;]:
                return v[&amp;quot;name&amp;quot;]
        raise Exception(f&amp;quot;No such driver version {os_version} for {self._browser_type}&amp;quot;)

    def get_url_for_version_and_platform(self, browser_version, platform):
        base_url = f&amp;quot;https://registry.npmmirror.com/-/binary/chrome-for-testing/{browser_version}/&amp;quot;

        platform_path_map = {
            &amp;#39;linux64&amp;#39;: &amp;#39;linux64/chromedriver-linux64.zip&amp;#39;,
            &amp;#39;mac-x64&amp;#39;: &amp;#39;mac-x64/chromedriver-mac-x64.zip&amp;#39;,
            &amp;#39;mac-arm64&amp;#39;: &amp;#39;mac-arm64/chromedriver-mac-arm64.zip&amp;#39;,
            &amp;#39;win32&amp;#39;: &amp;#39;win32/chromedriver-win32.zip&amp;#39;,
            &amp;#39;win64&amp;#39;: &amp;#39;win64/chromedriver-win64.zip&amp;#39;,
        }

        download_url = base_url + platform_path_map[platform]
        return download_url


class ChromeDriverManager(DriverManager):
    def __init__(
        self,
        driver_version: Optional[str] = None,
        name: str = &amp;quot;chromedriver&amp;quot;,
        url: str = &amp;quot;https://registry.npmmirror.com/-/binary/chromedriver&amp;quot;,
        latest_release_url: str = &amp;quot;https://registry.npmmirror.com/-/binary/chromedriver/LATEST_RELEASE&amp;quot;,
        chrome_type: str = ChromeType.GOOGLE,
        download_manager: Optional[DownloadManager] = None,
        cache_manager: Optional[DriverCacheManager] = None,
        os_system_manager: Optional[OperationSystemManager] = None

    ):
        super().__init__(
            download_manager=download_manager,
            cache_manager=cache_manager,
            os_system_manager=os_system_manager
        )

        self.driver = ExtChromeDriver(
            name=name,
            driver_version=driver_version,
            url=url,
            latest_release_url=latest_release_url,
            chrome_type=chrome_type,
            http_client=self.http_client,
            os_system_manager=os_system_manager
        )

    def install(self) -&amp;gt; str:
        driver_path = self._get_driver_binary_path(self.driver)
        os.chmod(driver_path, 0o755)
        return driver_path&lt;/pre&gt;
&lt;p&gt;
    &lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
    在启动chrome.option中中ChromeDriverManager重新import一下就可以了
&lt;/p&gt;</description><pubDate>Mon, 01 Jul 2024 12:04:14 +0800</pubDate></item><item><title>安卓模拟器最简单ssl证书安装</title><link>https://ii74.com/post/6440.html</link><description>&lt;p&gt;使用nox模拟器&lt;/p&gt;&lt;p&gt;复制这个目录的文件到&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://ii74.com/zb_users/upload/2024/05/202405111715392003316809.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;这个目录就行&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://ii74.com/zb_users/upload/2024/05/202405111715392036796026.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;</description><pubDate>Sat, 11 May 2024 09:45:52 +0800</pubDate></item><item><title>Thingsboard 设置搜索关键字的方法</title><link>https://ii74.com/post/6439.html</link><description>&lt;p&gt;thingsboard 中，默认的搜索只搜索名字（name），有些时候，我们还添加了标签 （label），此时需要通过label去搜索对应的设备。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;分析源码后找到&amp;nbsp;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-java&quot;&gt;AbstractDeviceEntity&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;只需要修改&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-java&quot;&gt;@Override
public&amp;nbsp;String&amp;nbsp;getSearchTextSource()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;name&amp;nbsp;+&amp;nbsp;label;
}&lt;/pre&gt;&lt;p&gt;即可&lt;/p&gt;</description><pubDate>Fri, 29 Mar 2024 09:12:01 +0800</pubDate></item><item><title>某东云彩屏版4G随身wifi替换图片的方法</title><link>https://ii74.com/post/6438.html</link><description>&lt;p&gt;前段时间买了个彩屏随身wifi&lt;/p&gt;&lt;p&gt;记录一下如何替换图片的过程&lt;/p&gt;&lt;p&gt;1：开启adb&lt;/p&gt;&lt;p&gt;2：使用 adb pull /etc_ro/mmi ./&amp;nbsp; 将图片下载到本地&lt;/p&gt;&lt;p&gt;3：打开mmi目录会发现，所有图片都是PNG格式，我们只需要替换相应的图片，即可实现图片替换效果，注意分辨率必须一致，否则加载不出来&lt;/p&gt;</description><pubDate>Fri, 15 Mar 2024 15:35:25 +0800</pubDate></item><item><title>某东云R106 切sim卡方式</title><link>https://ii74.com/post/6437.html</link><description>&lt;p&gt;最近买了个某东云的5G随身WIFI&amp;nbsp; r106的板子，跟长城那些是一套东西。 代工厂是品速&lt;/p&gt;&lt;p&gt;实际上就是品速M2的换壳&lt;/p&gt;&lt;p&gt;所以我们只需要使用常规操作，进行破解就行了。&lt;/p&gt;&lt;p&gt;破解过程自行研究&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;下面说一下切卡怎么切&lt;/p&gt;&lt;p&gt;登录到后台页面 也就是&lt;a href=&quot;http://192.168.1.1&quot; _src=&quot;http://192.168.1.1&quot;&gt;http://192.168.1.1&lt;/a&gt; &lt;/p&gt;&lt;p&gt;按F12找到控制台，输入g_disable = &amp;quot;enable&amp;quot;&lt;/p&gt;&lt;p&gt;解除限制后，访问 #cardmode模式就可以进入到切卡页面了。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Fri, 15 Mar 2024 15:31:58 +0800</pubDate></item><item><title>VIA 在线网站</title><link>https://ii74.com/post/6436.html</link><description>&lt;p&gt;众所周知,via是客制化键盘中不可缺少的一个配置软件&lt;/p&gt;&lt;p&gt;现在the-via官方开放了app的源码,大家可以自行部署到自己的服务器中. 自定义添加各种键盘的json&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;本站也上线了这个功能&amp;nbsp;&lt;/p&gt;&lt;p&gt;访问 &lt;a href=&quot;https://via.ii74.com&quot; _src=&quot;https://via.ii74.com&quot;&gt;https://via.ii74.com&lt;/a&gt;&amp;nbsp; 体验吧.&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://via.ii74.com/images/chippy.png&quot;/&gt;&lt;/p&gt;</description><pubDate>Mon, 17 Oct 2022 13:41:52 +0800</pubDate></item><item><title>ReactNative 填坑  通过 ScrollView的refreshControl 进行刷新页面数据</title><link>https://ii74.com/post/6435.html</link><description>&lt;p&gt;效果预览&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://ii74.com/zb_users/upload/2018/01/201801171516171295897931.gif&quot; title=&quot;20180117143818.gif&quot; alt=&quot;20180117143818.gif&quot; width=&quot;167&quot; height=&quot;318&quot; style=&quot;width: 167px; height: 318px;&quot;/&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;方法:&lt;/p&gt;&lt;p&gt;1:在构造函数中添加一个 状态属性&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://ii74.com/zb_users/upload/2018/01/201801171516171379198180.png&quot; title=&quot;添加构造函数.png&quot; alt=&quot;添加构造函数.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;2:在你的 ScrollView 中添加刷新控件,并绑定刷新事件函数&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://ii74.com/zb_users/upload/2018/01/201801171516171426851866.png&quot; title=&quot;添加刷新控件.png&quot; alt=&quot;添加刷新控件.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;3:编写刷新事件函数&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://ii74.com/zb_users/upload/2018/01/201801171516171464418645.png&quot; title=&quot;刷新事件函数.png&quot; alt=&quot;刷新事件函数.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;注意此处代码中 先将 isRefreshing 与 goodsData 进行了数据设置,这样可以使ui主动清空,&lt;/p&gt;&lt;p&gt;然后在定时器到了之后,发送一个请求,刷新页面中的内容,并重设了 goodsData&lt;/p&gt;&lt;p&gt;如果在此处 没有清空 goodsData的话,页面将可能不会刷新数据.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 17 Jan 2018 14:34:03 +0800</pubDate></item></channel></rss>