Commit c97b0245 authored by Albert Yi's avatar Albert Yi

reduce expiry for cached pixiv tokens to 1 week, revert to old method for...

reduce expiry for cached pixiv tokens to 1 week, revert to old method for extracting image url from page (fixes #3722)
parent 01250faa
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment