Skip to content

Commit

Permalink
fix bugs for some metadata not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
driftcrow committed Dec 25, 2021
1 parent 5a20e41 commit df1e56b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions douban/douban.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,13 @@ def to_metadata(self, browser, log, entry_, timeout): # {{{
if result:
mi.subtitle = result.group(1).strip()

authors = authors(extra)[0]
authors = authors(extra)
if not authors:
authors = [('Unknown')]
else:
authors = authors[0].split('、') # TODO:: others split char

mi.authors = authors.split('、') # TODO:: others split char
mi.authors = authors

cover_url = cover(extra)[0]

Expand Down Expand Up @@ -165,7 +167,7 @@ def to_metadata(self, browser, log, entry_, timeout): # {{{
mi.tags = tags

# pubdate

pubdate = ''
result = re.compile(r'出版年:</span>(.*?)<', re.M).search(info)
if result:
pubdate = result.group(1)
Expand Down

0 comments on commit df1e56b

Please sign in to comment.