Skip to content

Commit

Permalink
fix: npm mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Feb 17, 2024
1 parent 2fe2c24 commit 77f764e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public object MiraiSeleniumPlugin : KotlinPlugin(

override fun PluginComponentStorage.onLoad() {
SeleniumLogger.level = Level.OFF
System.setProperty(CHROME_DRIVER_MIRRORS, "https://npm.taobao.org/mirrors/chromedriver")
System.setProperty(FIREFOX_DRIVER_MIRRORS, "https://npm.taobao.org/mirrors/geckodriver")
System.setProperty(CHROME_DRIVER_MIRRORS, "https://npmmirror.com/mirrors/chromedriver")
System.setProperty(FIREFOX_DRIVER_MIRRORS, "https://npmmirror.com/mirrors/geckodriver")
System.setProperty(SELENIUM_FOLDER, dataFolder.resolve("selenium").absolutePath)

if (System.getProperty("mirai.slider.captcha.supported").toBoolean()) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/xyz/cssxsh/selenium/SeleniumInit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ internal fun setupChromeDriver(folder: File, chromium: Boolean): RemoteWebDriver
val supplier = fetchChromeDriver(folder = folder, version = version0)
if (supplier != null) return supplier

// MIRRORS "https://npm.taobao.org/mirrors/chromedriver"
// MIRRORS "https://npmmirror.com/mirrors/chromedriver"
val base = System.getProperty(CHROME_DRIVER_MIRRORS, "https://chromedriver.storage.googleapis.com")

// 映射
Expand Down Expand Up @@ -630,7 +630,7 @@ internal fun setupFirefoxDriver(folder: File): RemoteWebDriverSupplier {
}
else -> throw UnsupportedOperationException("不受支持的平台 $platform")
}
// https://npm.taobao.org/mirrors/geckodriver/
// https://npmmirror.com/mirrors/geckodriver/
val base = System.getProperty(FIREFOX_DRIVER_MIRRORS, "https://github.com/mozilla/geckodriver/releases/download")
val file = download(
urlString = "$base/$version/$filename",
Expand Down
4 changes: 2 additions & 2 deletions src/test/kotlin/xyz/cssxsh/selenium/SeleniumTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ internal abstract class SeleniumTest {

init {
System.setProperty(SELENIUM_FOLDER, folder.resolve("selenium").apply { mkdirs() }.absolutePath)
System.setProperty(CHROME_DRIVER_MIRRORS, "https://npm.taobao.org/mirrors/chromedriver")
System.setProperty(FIREFOX_DRIVER_MIRRORS, "https://npm.taobao.org/mirrors/geckodriver")
System.setProperty(CHROME_DRIVER_MIRRORS, "https://npmmirror.com/mirrors/chromedriver")
System.setProperty(FIREFOX_DRIVER_MIRRORS, "https://npmmirror.com/mirrors/geckodriver")
// System.setProperty("selenium.webdriver.verbose", "true")
org.slf4j.bridge.SLF4JBridgeHandler.removeHandlersForRootLogger()
org.slf4j.bridge.SLF4JBridgeHandler.install()
Expand Down

0 comments on commit 77f764e

Please sign in to comment.