@@ -57,7 +57,15 @@ module Sources
|
||||
end
|
||||
|
||||
def get
|
||||
agent.get(URI.parse(normalized_url)) do |page|
|
||||
page = agent.get(URI.parse(normalized_url))
|
||||
|
||||
if page.search("body.not-logged-in").any?
|
||||
# Session cache is invalid, clear it and log in normally.
|
||||
Cache.delete("pixiv-phpsessid")
|
||||
@agent = nil
|
||||
page = agent.get(URI.parse(normalized_url))
|
||||
end
|
||||
|
||||
@artist_name, @profile_url = get_profile_from_page(page)
|
||||
@pixiv_moniker = get_moniker_from_page(page)
|
||||
@zip_url, @ugoira_frame_data, @ugoira_content_type = get_zip_url_from_page(page)
|
||||
@@ -71,7 +79,6 @@ module Sources
|
||||
@image_url = get_image_url_from_page(page, is_manga)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def rewrite_thumbnails(thumbnail_url, is_manga=nil)
|
||||
thumbnail_url = rewrite_new_medium_images(thumbnail_url)
|
||||
|
||||
Reference in New Issue
Block a user