@Override public YouTubeSearchResult fromMatcher(SearchMatcher matcher) { String link = matcher.group("link"); String title = HtmlManipulator.replaceHtmlEntities(matcher.group("title")); String duration = matcher.group("duration"); String user = matcher.group("user"); return new YouTubeSearchResult(link, title, duration, user); }
public TorrentsfmSearchResult(String domainName, String detailsUrl, SearchMatcher matcher) { this.detailsUrl = detailsUrl; this.filename = matcher.group(1); // parseFileName(matcher.group(1), FilenameUtils.getBaseName(detailsUrl)); this.size = parseSize(matcher.group(2)); this.creationTime = parseCreationTime(matcher.group(4)); this.seeds = parseSeeds(matcher.group(3)); // a magnet this.torrentUrl = matcher.group(5); // "http://" + domainName + "/tor/" + matcher.group(5) + ".torrent"; this.displayName = matcher.group( 1); // HtmlManipulator.replaceHtmlEntities(FilenameUtils.getBaseName(filename)); this.infoHash = parseInfoHash(torrentUrl); }