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:
@@ -53,7 +53,7 @@ class PixivWebAgent
|
|||||||
if mech.current_page.body =~ /"error":false/
|
if mech.current_page.body =~ /"error":false/
|
||||||
cookie = mech.cookies.select {|x| x.name == SESSION_COOKIE_KEY}.first
|
cookie = mech.cookies.select {|x| x.name == SESSION_COOKIE_KEY}.first
|
||||||
if cookie
|
if cookie
|
||||||
Cache.put(SESSION_CACHE_KEY, cookie.value, 1.month)
|
Cache.put(SESSION_CACHE_KEY, cookie.value, 1.week)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ class PixivWebAgent
|
|||||||
mech.get("https://comic.pixiv.net") do |page|
|
mech.get("https://comic.pixiv.net") do |page|
|
||||||
cookie = mech.cookies.select {|x| x.name == COMIC_SESSION_COOKIE_KEY}.first
|
cookie = mech.cookies.select {|x| x.name == COMIC_SESSION_COOKIE_KEY}.first
|
||||||
if cookie
|
if cookie
|
||||||
Cache.put(COMIC_SESSION_CACHE_KEY, cookie.value, 1.month)
|
Cache.put(COMIC_SESSION_CACHE_KEY, cookie.value, 1.week)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue Net::HTTPServiceUnavailable
|
rescue Net::HTTPServiceUnavailable
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ module Sources
|
|||||||
is_manga = @page_count > 1
|
is_manga = @page_count > 1
|
||||||
|
|
||||||
if !@zip_url
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user