Skip to content

Commit

Permalink
[booru] prevent crash when no tags are present (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed May 17, 2019
1 parent ca3bad1 commit a4ba34c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gallery_dl/extractor/booru.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def extended_tags(self, image, page=None):
tags = collections.defaultdict(list)
tags_html = text.extract(page, '<ul id="tag-', '</ul>')[0]
pattern = re.compile(r"tag-type-([^\"' ]+).*?[?;]tags=([^\"']+)", re.S)
for tag_type, tag_name in pattern.findall(tags_html):
for tag_type, tag_name in pattern.findall(tags_html or ""):
tags[tag_type].append(text.unquote(tag_name))
for key, value in tags.items():
image["tags_" + key] = " ".join(value)
Expand Down

0 comments on commit a4ba34c

Please sign in to comment.