From 281c7e4bf751fe45b5fa1197721b1a8bef965b75 Mon Sep 17 00:00:00 2001 From: Toks Date: Wed, 30 Apr 2014 14:32:14 -0400 Subject: [PATCH] Seiga: fix getting tags --- app/logical/sources/strategies/nico_seiga.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/logical/sources/strategies/nico_seiga.rb b/app/logical/sources/strategies/nico_seiga.rb index a77bfe739..4beb05c3e 100644 --- a/app/logical/sources/strategies/nico_seiga.rb +++ b/app/logical/sources/strategies/nico_seiga.rb @@ -18,6 +18,13 @@ module Sources agent.get(normalized_url) do |page| @artist_name, @profile_url = get_profile_from_page(page) @image_url = get_image_url_from_page(page) + end + + # Log out before getting the tags. + # The reason for this is that if you're logged in and viewing a non-adult-rated work, the tags will be added with javascript after the page has loaded meaning we can't extract them easily. + # This does not apply if you're logged out (or if you're viewing an adult-rated work). + agent.cookie_jar.clear! + agent.get(normalized_url) do |page| @tags = get_tags_from_page(page) end end