nijie: fix failure to fetch source data due to change in login system.

Nijie changed their login system so that now there are two cookies that
need to be remembered: NIJIEIJIEID, and nijie_tok.
This commit is contained in:
evazion
2022-01-11 15:03:48 -06:00
parent 1518c3c4be
commit 17fb34922b
2 changed files with 5 additions and 4 deletions

View File

@@ -314,8 +314,8 @@ module Sources
should "clear the cached cookie after failing to fetch the data" do
site = Sources::Strategies.find("https://nijie.info/view.php?id=203688")
Cache.put("nijie-session-cookie", HTTP::Cookie.new(name: "NIJIEIJIEID", value: "fake", domain: "nijie.info", path: "/"))
assert_equal("fake", site.cached_session_cookie.value)
Cache.put("nijie-session-cookie", { "NIJIEIJIEID" => "fake", "nijie_tok" => "fake" })
assert_equal({ "NIJIEIJIEID" => "fake", "nijie_tok" => "fake" }, site.cached_session_cookie)
assert_equal([], site.image_urls)
assert_nil(Cache.get("nijie-session-cookie"))