weppos / whois

An intelligent — pure Ruby — WHOIS client and parser.
https://whoisrb.org
MIT License
1.14k stars 283 forks source link

Whois Parser for .de (Germany) fails with Unexpected Token #655

Closed jensb closed 1 year ago

jensb commented 1 year ago

With .de domains, the parser (v5.1.0 gem) cannot handle the whois output format:

w = Whois::Client.new
w.lookup("google.de").parser.available?
/var/lib/gems/3.0.0/gems/whois-parser-2.0.0/lib/whois/scanners/base.rb:108:in `error!': Unexpected token: % Restricted rights. (Whois::ParserError)
% 
% Terms and Conditions of Use
% ...

It seems that the parser cannot handle lines beginning with "%". (which are supposed to be free-text comments) How can I fix thix? I tried adding this to base.rb, but this did have no effect:

      tokenizer :skip_comment do
        @input.skip(/^\%/)
      end
jensb commented 1 year ago

Moved to whois-parser. Sorry :)