From bad882396ab66992e056d2b690df77abc5b05c04 Mon Sep 17 00:00:00 2001 From: axfree Date: Fri, 5 Jun 2020 13:14:53 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=81=ED=99=94:=20=EB=8B=A4=EC=9D=8C=20?= =?UTF-8?q?=EC=98=81=ED=99=94=20=EC=82=AC=EC=9D=B4=ED=8A=B8=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Contents/Code/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Contents/Code/__init__.py b/Contents/Code/__init__.py index b377fec..8be26ed 100755 --- a/Contents/Code/__init__.py +++ b/Contents/Code/__init__.py @@ -130,8 +130,8 @@ def searchDaumMovie(results, media, lang): for id in media_ids: html = HTML.ElementFromURL(DAUM_MOVIE_DETAIL % id) - title, year = Regex('^(.*?)(?: \((\d{4})\))?$').search(html.xpath('//div[@class="subject_movie"]/strong')[0].text).group(1, 2) - original_title = html.xpath('//span[@class="txt_movie"]')[0].text or '' + title, year = Regex('^(.*?)(?:\((\d{4})\))?$').search(html.xpath('//strong[@class="tit_movie"]/span[@class="txt_name"]')[0].text).group(1, 2) + original_title = html.xpath('//span[@class="txt_origin"]')[0].text or '' score = int(max(levenshteinRatio(media_name, title), levenshteinRatio(media_name, original_title)) * 80) if media.year and year: score += (2 - min(2, abs(int(media.year) - int(year)))) * 10 @@ -212,12 +212,12 @@ def updateDaumMovie(metadata): try: html = HTML.ElementFromURL(DAUM_MOVIE_DETAIL % metadata.id) - match = Regex('^(.*?)(?: \((\d{4})\))?$').search(html.xpath('//div[@class="subject_movie"]/strong')[0].text) + match = Regex('^(.*?)(?:\((\d{4})\))?$').search(html.xpath('//strong[@class="tit_movie"]/span[@class="txt_name"]')[0].text) metadata.title = match.group(1) metadata.title_sort = unicodedata.normalize('NFKD' if Prefs['use_title_decomposition'] else 'NFKC', metadata.title) metadata.year = int(match.group(2)) if match.group(2) else None - metadata.original_title = html.xpath('//span[@class="txt_movie"]')[0].text - metadata.rating = float(html.xpath('//em[@class="emph_grade"]')[0].text) + metadata.original_title = html.xpath('//span[@class="txt_origin"]')[0].text + metadata.rating = float(''.join(html.xpath('//a[@class="wrap_grade"]/span[contains(@class,"num_grade")]/text()'))) # 장르 metadata.genres.clear() dds = html.xpath('//dl[contains(@class, "list_movie")]/dd')