Delete all translate func in all WebCrawlers
This commit is contained in:
@@ -57,8 +57,8 @@ def getCover_small(html):
|
|||||||
result = str(html.xpath('//*[@id="waterfall"]/div/a/div[1]/img/@src')).strip(" ['']")
|
result = str(html.xpath('//*[@id="waterfall"]/div/a/div[1]/img/@src')).strip(" ['']")
|
||||||
return result
|
return result
|
||||||
def getTag(html):
|
def getTag(html):
|
||||||
x = html.xpath('/html/head/meta[@name="keywords"]/@content')[0].split(',')
|
result = html.xpath('/html/head/meta[@name="keywords"]/@content')[0].split(',')
|
||||||
return [translateTag_to_sc(i.strip()) for i in x[2:]] if len(x) > 2 else []
|
return result
|
||||||
def getSeries(html):
|
def getSeries(html):
|
||||||
try:
|
try:
|
||||||
result1 = str(html.xpath('//span[contains(text(),"系列:")]/../span[2]/text()')).strip(" ['']")
|
result1 = str(html.xpath('//span[contains(text(),"系列:")]/../span[2]/text()')).strip(" ['']")
|
||||||
|
|||||||
@@ -76,11 +76,8 @@ def get_actor(lx: html.HtmlElement):
|
|||||||
return r
|
return r
|
||||||
|
|
||||||
def get_tag(lx: html.HtmlElement) -> str:
|
def get_tag(lx: html.HtmlElement) -> str:
|
||||||
r = []
|
|
||||||
genres = lx.xpath("//span[@class='spec-content']/a[@itemprop='genre']/text()")
|
genres = lx.xpath("//span[@class='spec-content']/a[@itemprop='genre']/text()")
|
||||||
for g in genres:
|
return genres
|
||||||
r.append(translateTag_to_sc(str(g)))
|
|
||||||
return r
|
|
||||||
|
|
||||||
def get_extrafanart(lx: html.HtmlElement) -> str:
|
def get_extrafanart(lx: html.HtmlElement) -> str:
|
||||||
r = []
|
r = []
|
||||||
|
|||||||
@@ -123,25 +123,12 @@ def getTag(text):
|
|||||||
result = html.xpath(
|
result = html.xpath(
|
||||||
"//td[contains(text(),'ジャンル:')]/following-sibling::td/a/text()"
|
"//td[contains(text(),'ジャンル:')]/following-sibling::td/a/text()"
|
||||||
)
|
)
|
||||||
total = []
|
return result
|
||||||
for i in result:
|
|
||||||
try:
|
|
||||||
total.append(translateTag_to_sc(i))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return total
|
|
||||||
except:
|
except:
|
||||||
result = html.xpath(
|
result = html.xpath(
|
||||||
"//td[contains(text(),'ジャンル:')]/following-sibling::td/text()"
|
"//td[contains(text(),'ジャンル:')]/following-sibling::td/text()"
|
||||||
)
|
)
|
||||||
total = []
|
return result
|
||||||
for i in result:
|
|
||||||
try:
|
|
||||||
total.append(translateTag_to_sc(i))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return total
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
def getCover(text, number):
|
def getCover(text, number):
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ def getTitle_fc2com(htmlcode): #获取厂商
|
|||||||
return result
|
return result
|
||||||
def getActor_fc2com(htmlcode):
|
def getActor_fc2com(htmlcode):
|
||||||
try:
|
try:
|
||||||
html = etree.fromstring(htmlcode, etree.HTMLParser())
|
htmtml = etree.fromstring(htmlcode, etree.HTMLParser())
|
||||||
result = html.xpath('//*[@id="top"]/div[1]/section[1]/div/section/div[2]/ul/li[3]/a/text()')[0]
|
result = html.xpath('//*[@id="top"]/div[1]/section[1]/div/section/div[2]/ul/li[3]/a/text()')[0]
|
||||||
return result
|
return result
|
||||||
except:
|
except:
|
||||||
@@ -48,10 +48,7 @@ def getCover_fc2com(htmlcode2): #获取厂商 #
|
|||||||
# return result
|
# return result
|
||||||
def getTag_fc2com(lx):
|
def getTag_fc2com(lx):
|
||||||
result = lx.xpath("//a[@class='tag tagTag']/text()")
|
result = lx.xpath("//a[@class='tag tagTag']/text()")
|
||||||
tag = []
|
return result
|
||||||
for i in result:
|
|
||||||
tag.append(ADC_function.translateTag_to_sc(i))
|
|
||||||
return tag
|
|
||||||
def getYear_fc2com(release):
|
def getYear_fc2com(release):
|
||||||
try:
|
try:
|
||||||
result = re.search('\d{4}',release).group()
|
result = re.search('\d{4}',release).group()
|
||||||
|
|||||||
@@ -72,8 +72,7 @@ def getSerise(html): #获取系列
|
|||||||
return str(x[0]) if len(x) else ''
|
return str(x[0]) if len(x) else ''
|
||||||
def getTag(html): # 获取标签
|
def getTag(html): # 获取标签
|
||||||
klist = html.xpath('/html/head/meta[@name="keywords"]/@content')[0].split(',')
|
klist = html.xpath('/html/head/meta[@name="keywords"]/@content')[0].split(',')
|
||||||
taglist = [translateTag_to_sc(v) for v in klist[1:]]
|
return klist
|
||||||
return taglist
|
|
||||||
def getExtrafanart(htmlcode): # 获取剧照
|
def getExtrafanart(htmlcode): # 获取剧照
|
||||||
html_pather = re.compile(r'<div id=\"sample-waterfall\">[\s\S]*?</div></a>\s*?</div>')
|
html_pather = re.compile(r'<div id=\"sample-waterfall\">[\s\S]*?</div></a>\s*?</div>')
|
||||||
html = html_pather.search(htmlcode)
|
html = html_pather.search(htmlcode)
|
||||||
|
|||||||
@@ -108,23 +108,11 @@ def getRelease(a):
|
|||||||
def getTag(html):
|
def getTag(html):
|
||||||
try:
|
try:
|
||||||
result = html.xpath('//strong[contains(text(),"類別")]/../span/a/text()')
|
result = html.xpath('//strong[contains(text(),"類別")]/../span/a/text()')
|
||||||
total = []
|
return result
|
||||||
for i in result:
|
|
||||||
try:
|
|
||||||
total.append(translateTag_to_sc(i))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return total
|
|
||||||
|
|
||||||
except:
|
except:
|
||||||
result = html.xpath('//strong[contains(text(),"類別")]/../span/text()')
|
result = html.xpath('//strong[contains(text(),"類別")]/../span/text()')
|
||||||
total = []
|
return result
|
||||||
for i in result:
|
|
||||||
try:
|
|
||||||
total.append(translateTag_to_sc(i))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return total
|
|
||||||
|
|
||||||
def getCover_small(html, index=0):
|
def getCover_small(html, index=0):
|
||||||
# same issue mentioned below,
|
# same issue mentioned below,
|
||||||
|
|||||||
@@ -65,13 +65,7 @@ def getTag(a):
|
|||||||
result2 = str(html.xpath('//th[contains(text(),"ジャンル:")]/../td/text()')).strip(" ['']").strip('\\n ').strip(
|
result2 = str(html.xpath('//th[contains(text(),"ジャンル:")]/../td/text()')).strip(" ['']").strip('\\n ').strip(
|
||||||
'\\n')
|
'\\n')
|
||||||
result = str(result1 + result2).strip('+').replace("', '\\n",",").replace("', '","").replace('"','').replace(',,','').split(',')
|
result = str(result1 + result2).strip('+').replace("', '\\n",",").replace("', '","").replace('"','').replace(',,','').split(',')
|
||||||
total = []
|
return result
|
||||||
for i in result:
|
|
||||||
try:
|
|
||||||
total.append(translateTag_to_sc(i))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return total
|
|
||||||
def getCover(htmlcode):
|
def getCover(htmlcode):
|
||||||
html = etree.fromstring(htmlcode, etree.HTMLParser())
|
html = etree.fromstring(htmlcode, etree.HTMLParser())
|
||||||
result = str(html.xpath('//*[@id="EnlargeImage"]/@href')).strip(" ['']")
|
result = str(html.xpath('//*[@id="EnlargeImage"]/@href')).strip(" ['']")
|
||||||
|
|||||||
@@ -90,8 +90,11 @@ def getRelease(html):
|
|||||||
|
|
||||||
|
|
||||||
def getTag(html):
|
def getTag(html):
|
||||||
x = html.xpath('//span[@class="koumoku" and text()="ジャンル"]/../a[starts-with(@href,"/avod/genre/")]/text()')
|
result = html.xpath('//span[@class="koumoku" and text()="ジャンル"]/../a[starts-with(@href,"/avod/genre/")]/text()')
|
||||||
return [translateTag_to_sc(i.strip()) for i in x if len(i.strip())] if len(x) and len(x[0]) else []
|
total = []
|
||||||
|
for i in result:
|
||||||
|
total.append(i.replace("\n","").replace("\t",""))
|
||||||
|
return total
|
||||||
|
|
||||||
|
|
||||||
def getCover_small(html, index=0):
|
def getCover_small(html, index=0):
|
||||||
|
|||||||
Reference in New Issue
Block a user