From d42c636bd36b8546816a632f208c9b1f2a935535 Mon Sep 17 00:00:00 2001 From: Klaus Hipp Date: Thu, 4 Jul 2024 21:50:21 +0200 Subject: [PATCH] baiduinput: update livecheck, use versioned url --- Casks/b/baiduinput.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Casks/b/baiduinput.rb b/Casks/b/baiduinput.rb index a4152328f4061..9b200288d3c22 100644 --- a/Casks/b/baiduinput.rb +++ b/Casks/b/baiduinput.rb @@ -1,15 +1,18 @@ cask "baiduinput" do - version "1.0" - sha256 :no_check + version "6.0.3.66,1000e" + sha256 "4d31a7a0dbf09d32eaecc1f0b778f27128707fbc31139fabdb0090a325393974" - url "https://srf.baidu.com/?c=j&e=d&platform=mac" + url "https://imeres.baidu.com/mac/baiduinput_mac_v#{version.csv.first}_#{version.csv.second}.dmg" name "Baidu Input" name "安装百度输入法" homepage "https://srf.baidu.com/input/mac.html" livecheck do - url :url - strategy :extract_plist + url "https://srf.baidu.com/?c=j&e=d&platform=mac" + regex(/baiduinput[._-]mac[._-]v?(\d+(?:\.\d+)+)[._-](\w+)\.dmg/i) + strategy :header_match do |headers, regex| + headers["location"].scan(regex).map { |match| "#{match[0]},#{match[1]}" } + end end installer manual: "安装百度输入法.app"