sources: don't escape Unicode characters in tag search URLs.

Fix it so that Unicode characters aren't unnecessarily percent-encoded when generating tag search
URLs. For example, generate URLs like this:

* https://www.pixiv.net/tags/オリジナル/artworks

Not like this:

* https://www.pixiv.net/tags/%E3%82%AA%E3%83%AA%E3%82%B8%E3%83%8A%E3%83%AB/artworks
This commit is contained in:
evazion
2022-12-02 16:04:18 -06:00
parent 9e34f4c3ed
commit c19fc16885
12 changed files with 33 additions and 28 deletions

View File

@@ -28,7 +28,7 @@ module Source
def tags
page&.css("meta[name='keywords']")&.attr("content")&.value.to_s.split(/, /).compact.map do |tag|
[tag.tr(" ", "_"), "https://rule34.us/index.php?r=posts/index&q=#{CGI.escape(tag)}"]
[tag.tr(" ", "_"), "https://rule34.us/index.php?r=posts/index&q=#{Danbooru::URL.escape(tag)}"]
end
end