Skip to content

Commit

Permalink
TV: 시리즈가 검색에서 누락되던 문제 수정 (Fixes #12)
Browse files Browse the repository at this point in the history
  • Loading branch information
axfree committed Sep 18, 2018
1 parent 9930bdf commit 1009411
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ def searchDaumTV(results, media, lang):
year = Regex('(\d{4})\.\d+\.\d+~').search(tvp.xpath('//div[@class="head_cont"]//span[@class="txt_summary"][last()]')[0].text).group(1)
items.append({ 'id': id, 'title': title, 'year': year })

lis = tvp.xpath('//div[@id="tv_series"]//li')
for li in lis:
id = Regex('irk=(\d+)').search(li.xpath('./a/@href')[0]).group(1)
title = li.xpath('./a')[0].text
year = Regex('(\d{4})\.\d+').search(li.xpath('./span')[0].text).group(1)
items.append({ 'id': id, 'title': title, 'year': year })

spans = tvp.xpath(u'//div[contains(@class,"coll_etc")]//span[.="(동명프로그램)"]')
for span in spans:
year = Regex('(\d{4})').search(span.xpath('./preceding-sibling::span[1]')[0].text).group(1)
Expand Down

0 comments on commit 1009411

Please sign in to comment.