Skip to content

Commit

Permalink
[sankaku] fix error when no tags available (closes #259)
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
mikf committed May 14, 2019
1 parent 6764847 commit 0b4be57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gallery_dl/extractor/sankaku.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def get_post_data(self, post_id, extr=text.extract):
tags = collections.defaultdict(list)
tags_html = text.extract(page, '<ul id=tag-sidebar>', '</ul>')[0]
pattern = re.compile(r'tag-type-([^>]+)><a href="/\?tags=([^"]+)')
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():
data["tags_" + key] = " ".join(value)
Expand Down

0 comments on commit 0b4be57

Please sign in to comment.