mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
f9563995a1
commit
7ad0956e6e
@ -30,8 +30,7 @@ class cishubase:
|
||||
except:
|
||||
self.needinit = True
|
||||
|
||||
if res is None or res == "":
|
||||
return
|
||||
if res and len(res):
|
||||
self.callback(res)
|
||||
except:
|
||||
pass
|
||||
|
@ -17,7 +17,7 @@ class goo(cishubase):
|
||||
xx = re.sub("<a([\\s\\S]*?)>", "", xx)
|
||||
|
||||
xx = re.sub("</a>", "", xx)
|
||||
|
||||
if len(xx):
|
||||
return (
|
||||
'<div style="text-align: center;"><a target="_blank" href="{}">link</a></div>'.format(
|
||||
url
|
||||
|
@ -25,7 +25,7 @@ class weblio(cishubase):
|
||||
_all.append(xx)
|
||||
|
||||
join = "<br>".join(_all)
|
||||
|
||||
if len(join):
|
||||
return (
|
||||
'<div style="text-align: center;"><a target="_blank" href="{}">link</a></div>'.format(
|
||||
url
|
||||
|
@ -25,6 +25,8 @@ class youdao(cishubase):
|
||||
proxies=getproxy(),
|
||||
).text
|
||||
fnd = re.findall('<section class="modules"(.*?)>([\\s\\S]*?)</section>', text)
|
||||
|
||||
if len(fnd[0][1]):
|
||||
return (
|
||||
'<div style="text-align: center;"><a target="_blank" href="{}">link</a></div><br>'.format(
|
||||
"https://dict.youdao.com/result?word={}&lang={}".format(
|
||||
|
Loading…
x
Reference in New Issue
Block a user