hentai foundry: update url for Hentai Foundry tags.

Change the URL used for Hentai Foundry tags from:

    https://www.hentai-foundry.com/search/index?query=elf&search_in=keywords

to:

    https://www.hentai-foundry.com/pictures/tagged/elf
This commit is contained in:
evazion
2022-08-23 22:31:14 -05:00
parent 2c36e02810
commit 09dfab1f0d
2 changed files with 4 additions and 4 deletions

View File

@@ -36,10 +36,10 @@ module Source
end
def tags
tags = page&.search(".boxbody [rel='tag']") || []
tags = page&.search(".boxbody [rel='tag']").to_a.map(&:text)
tags.map do |tag|
[tag.text, URI.join(page_url, tag.attr("href")).to_s]
[tag, "https://www.hentai-foundry.com/pictures/tagged/#{CGI.escape(tag)}"]
end
end

View File

@@ -39,8 +39,8 @@ module Sources
end
should "get the tags" do
assert_equal([["elf", "https://www.hentai-foundry.com/search/index?query=elf&search_in=keywords"]], @image_1.tags)
assert_equal([["elf", "https://www.hentai-foundry.com/search/index?query=elf&search_in=keywords"]], @image_2.tags)
assert_equal([["elf", "https://www.hentai-foundry.com/pictures/tagged/elf"]], @image_1.tags)
assert_equal([["elf", "https://www.hentai-foundry.com/pictures/tagged/elf"]], @image_2.tags)
end
should "find the correct artist" do