From 29695aed0a295f7bf84fea435a7dfd304989fcd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Rumi=C5=84ski?= Date: Fri, 23 Oct 2020 16:42:13 +0200 Subject: [PATCH] Small field refactor --- .../linkHandler/YoutubeChannelLinkHandlerFactory.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeChannelLinkHandlerFactory.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeChannelLinkHandlerFactory.java index af6bd12ca..2dc8fc427 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeChannelLinkHandlerFactory.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeChannelLinkHandlerFactory.java @@ -33,6 +33,9 @@ public class YoutubeChannelLinkHandlerFactory extends ListLinkHandlerFactory { private static final YoutubeChannelLinkHandlerFactory instance = new YoutubeChannelLinkHandlerFactory(); + private static final Pattern excludedSegments = + Pattern.compile("playlist|watch|attribution_link|watch_popup|embed|feed|select_site"); + public static YoutubeChannelLinkHandlerFactory getInstance() { return instance; } @@ -49,8 +52,7 @@ public class YoutubeChannelLinkHandlerFactory extends ListLinkHandlerFactory { public String getUrl(String id, List contentFilters, String searchFilter) { return "https://www.youtube.com/" + id; } - - + /** * Returns true if path conform to * custom short channel URLs like youtube.com/yourcustomname @@ -62,9 +64,6 @@ public class YoutubeChannelLinkHandlerFactory extends ListLinkHandlerFactory { return splitPath.length == 1 && !excludedSegments.matcher(splitPath[0]).matches(); } - private static final Pattern excludedSegments = - Pattern.compile("playlist|watch|attribution_link|watch_popup|embed|feed|select_site"); - @Override public String getId(String url) throws ParsingException { try {