Skip to content

Commit

Permalink
[sankaku] fix swf extraction (closes #52)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Dec 7, 2017
1 parent ebe9b0a commit a3924d2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions gallery_dl/extractor/sankaku.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,17 @@ def get_image_metadata(self, image_id):
"""Collect metadata for a single image"""
url = "https://chan.sankakucomplex.com/post/show/" + image_id
page = self.request(url, retries=10).text
image_url, pos = text.extract(page, '<li>Original: <a href="', '"')
width , pos = text.extract(page, '>', 'x', pos)
height , pos = text.extract(page, '', ' ', pos)
data = text.nameext_from_url(image_url, {
file_url, pos = text.extract(page, '<li>Original: <a href="', '"')
if file_url:
width , pos = text.extract(page, '>', 'x', pos)
height, pos = text.extract(page, '', ' ', pos)
else:
width , pos = text.extract(page, '<object width=', ' ', pos)
height, pos = text.extract(page, 'height=', '>', pos)
file_url = text.extract(page, '<embed src="', '"', pos)[0]
data = text.nameext_from_url(file_url, {
"id": util.safe_int(image_id),
"file_url": "https:" + text.unescape(image_url),
"file_url": "https:" + text.unescape(file_url),
"width": util.safe_int(width),
"height": util.safe_int(height),
})
Expand Down

0 comments on commit a3924d2

Please sign in to comment.