Main now validates URLs and the discover helper correctly parses common words and custom auth flags