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,9 +30,8 @@ class cishubase:
|
|||||||
except:
|
except:
|
||||||
self.needinit = True
|
self.needinit = True
|
||||||
|
|
||||||
if res is None or res == "":
|
if res and len(res):
|
||||||
return
|
self.callback(res)
|
||||||
self.callback(res)
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -17,10 +17,10 @@ class goo(cishubase):
|
|||||||
xx = re.sub("<a([\\s\\S]*?)>", "", xx)
|
xx = re.sub("<a([\\s\\S]*?)>", "", xx)
|
||||||
|
|
||||||
xx = re.sub("</a>", "", xx)
|
xx = re.sub("</a>", "", xx)
|
||||||
|
if len(xx):
|
||||||
return (
|
return (
|
||||||
'<div style="text-align: center;"><a target="_blank" href="{}">link</a></div>'.format(
|
'<div style="text-align: center;"><a target="_blank" href="{}">link</a></div>'.format(
|
||||||
url
|
url
|
||||||
|
)
|
||||||
|
+ xx
|
||||||
)
|
)
|
||||||
+ xx
|
|
||||||
)
|
|
||||||
|
@ -25,10 +25,10 @@ class weblio(cishubase):
|
|||||||
_all.append(xx)
|
_all.append(xx)
|
||||||
|
|
||||||
join = "<br>".join(_all)
|
join = "<br>".join(_all)
|
||||||
|
if len(join):
|
||||||
return (
|
return (
|
||||||
'<div style="text-align: center;"><a target="_blank" href="{}">link</a></div>'.format(
|
'<div style="text-align: center;"><a target="_blank" href="{}">link</a></div>'.format(
|
||||||
url
|
url
|
||||||
|
)
|
||||||
|
+ join
|
||||||
)
|
)
|
||||||
+ join
|
|
||||||
)
|
|
||||||
|
@ -25,11 +25,13 @@ class youdao(cishubase):
|
|||||||
proxies=getproxy(),
|
proxies=getproxy(),
|
||||||
).text
|
).text
|
||||||
fnd = re.findall('<section class="modules"(.*?)>([\\s\\S]*?)</section>', text)
|
fnd = re.findall('<section class="modules"(.*?)>([\\s\\S]*?)</section>', text)
|
||||||
return (
|
|
||||||
'<div style="text-align: center;"><a target="_blank" href="{}">link</a></div><br>'.format(
|
if len(fnd[0][1]):
|
||||||
"https://dict.youdao.com/result?word={}&lang={}".format(
|
return (
|
||||||
quote(word), self.srclang
|
'<div style="text-align: center;"><a target="_blank" href="{}">link</a></div><br>'.format(
|
||||||
|
"https://dict.youdao.com/result?word={}&lang={}".format(
|
||||||
|
quote(word), self.srclang
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
+ fnd[0][1]
|
||||||
)
|
)
|
||||||
+ fnd[0][1]
|
|
||||||
)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user