[imagetwist] fix site access

This commit is contained in:
Mike Fährmann
2017-02-08 22:59:00 +01:00
parent 2f6e3874a7
commit 0af02007a9

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Mike Fährmann
# Copyright 2016-2017 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -10,6 +10,7 @@
from .common import Extractor, Message
from .. import text, exception
from ..cache import cache
from os.path import splitext
from urllib.parse import urljoin
@@ -240,6 +241,11 @@ class ImagetwistImageExtractor(ImagehostImageExtractor):
})]
params = None
@property
@cache(maxage=3*60*60)
def cookies(self):
return self.request(self.url).cookies
def get_info(self, page):
url , pos = text.extract(page, 'center;"><img src="', '"')
filename, pos = text.extract(page, ' alt="', '"', pos)