fix: 改用doc.selectFirst/el.text()直接调用,不依赖mediabot的ScriptUtils
This commit is contained in:
@@ -15,9 +15,9 @@ Map parse(String content, String url) {
|
|||||||
|
|
||||||
private Map parseUserInfo(doc) {
|
private Map parseUserInfo(doc) {
|
||||||
def fields = [:]
|
def fields = [:]
|
||||||
def el = utils.selectFirst(doc, '#info_block, td.bottom.clearfix, .userbar')
|
def el = doc.selectFirst('#info_block, td.bottom.clearfix, .userbar')
|
||||||
if (el) {
|
if (el) {
|
||||||
def t = utils.text(el)
|
def t = el.text()
|
||||||
def um = t =~ /上传[::]\s*([0-9.,]+)\s*(TB|GB|MB|KB|B)?/
|
def um = t =~ /上传[::]\s*([0-9.,]+)\s*(TB|GB|MB|KB|B)?/
|
||||||
def dm = t =~ /下载[::]\s*([0-9.,]+)\s*(TB|GB|MB|KB|B)?/
|
def dm = t =~ /下载[::]\s*([0-9.,]+)\s*(TB|GB|MB|KB|B)?/
|
||||||
def rm = t =~ /分享率[::]\s*([\d.,]+)/
|
def rm = t =~ /分享率[::]\s*([\d.,]+)/
|
||||||
@@ -119,9 +119,9 @@ Map sync(PluginContext ctx) {
|
|||||||
def url = ctx.siteUrl.replaceAll('/+\$', '') + '/index.php'
|
def url = ctx.siteUrl.replaceAll('/+\$', '') + '/index.php'
|
||||||
def body = http.get(url, ctx.auth)
|
def body = http.get(url, ctx.auth)
|
||||||
def doc = Jsoup.parse(body)
|
def doc = Jsoup.parse(body)
|
||||||
def el = utils.selectFirst(doc, '#info_block, td.bottom.clearfix, .userbar')
|
def el = doc.selectFirst('#info_block, td.bottom.clearfix, .userbar')
|
||||||
if (!el) { ctx.incomplete = true; return [message: '未找到用户信息'] }
|
if (!el) { ctx.incomplete = true; return [message: '未找到用户信息'] }
|
||||||
def t = utils.text(el)
|
def t = el.text()
|
||||||
def result = [:]
|
def result = [:]
|
||||||
def um = t =~ /上传[::]\s*([0-9.,]+)\s*(TB|GB|MB|KB|B)?/
|
def um = t =~ /上传[::]\s*([0-9.,]+)\s*(TB|GB|MB|KB|B)?/
|
||||||
def dm = t =~ /下载[::]\s*([0-9.,]+)\s*(TB|GB|MB|KB|B)?/
|
def dm = t =~ /下载[::]\s*([0-9.,]+)\s*(TB|GB|MB|KB|B)?/
|
||||||
|
|||||||
Reference in New Issue
Block a user