madou.py:fix get title for MD0140-2
This commit is contained in:
@@ -16,12 +16,10 @@ def getActorPhoto(html):
|
|||||||
|
|
||||||
|
|
||||||
def getTitle(html, number): # 获取标题
|
def getTitle(html, number): # 获取标题
|
||||||
title = str(html.xpath('//h1[@class="article-title"]/text()')[0])
|
# <title>MD0140-2 / 家有性事EP2 爱在身边-麻豆社</title>
|
||||||
try:
|
browser_title = str(html.xpath("/html/head/title/text()")[0])
|
||||||
result = str(re.split(r'[/|/|-]', title)[1])
|
browser_title = browser_title[browser_title.find('/ ') + 2:].strip()
|
||||||
return result.strip()
|
return browser_title[:browser_title.find('-麻豆社')].strip()
|
||||||
except:
|
|
||||||
return title.replace(number.upper(), '').strip()
|
|
||||||
|
|
||||||
|
|
||||||
def getStudio(html): # 获取厂商 已修改
|
def getStudio(html): # 获取厂商 已修改
|
||||||
@@ -161,5 +159,5 @@ def main(number):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print(main('MD0094'))
|
|
||||||
print(main('MD0222'))
|
print(main('MD0222'))
|
||||||
|
print(main('MD0140-2'))
|
||||||
|
|||||||
Reference in New Issue
Block a user