reduce expiry for cached pixiv tokens to 1 week, revert to old method for extracting image url from page (fixes #3722)

This commit is contained in:
Albert Yi
2018-05-25 10:03:58 -07:00
parent 01250faaac
commit c97b0245d6
2 changed files with 4 additions and 3 deletions

View File

@@ -53,7 +53,7 @@ class PixivWebAgent
if mech.current_page.body =~ /"error":false/
cookie = mech.cookies.select {|x| x.name == SESSION_COOKIE_KEY}.first
if cookie
Cache.put(SESSION_CACHE_KEY, cookie.value, 1.month)
Cache.put(SESSION_CACHE_KEY, cookie.value, 1.week)
end
end
@@ -61,7 +61,7 @@ class PixivWebAgent
mech.get("https://comic.pixiv.net") do |page|
cookie = mech.cookies.select {|x| x.name == COMIC_SESSION_COOKIE_KEY}.first
if cookie
Cache.put(COMIC_SESSION_CACHE_KEY, cookie.value, 1.month)
Cache.put(COMIC_SESSION_CACHE_KEY, cookie.value, 1.week)
end
end
rescue Net::HTTPServiceUnavailable

View File

@@ -95,7 +95,8 @@ module Sources
is_manga = @page_count > 1
if !@zip_url
@image_url = image_urls.first
@image_url = get_image_url_from_page(page, @page_count > 1)
#@image_url = image_urls.first
end
end