diff --git a/app/logical/source/extractor/hentai_foundry.rb b/app/logical/source/extractor/hentai_foundry.rb index d3499ae14..a36aeeb99 100644 --- a/app/logical/source/extractor/hentai_foundry.rb +++ b/app/logical/source/extractor/hentai_foundry.rb @@ -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 diff --git a/test/unit/sources/hentai_foundry_test.rb b/test/unit/sources/hentai_foundry_test.rb index a761c524d..858c9ff9b 100644 --- a/test/unit/sources/hentai_foundry_test.rb +++ b/test/unit/sources/hentai_foundry_test.rb @@ -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