Skip to content

Commit ee2012c

Browse files
committed
rename folder to subpath
1 parent 8db40db commit ee2012c

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeStreamLinkHandlerFactory.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class YoutubeStreamLinkHandlerFactory extends LinkHandlerFactory {
4040

4141
private static final Pattern YOUTUBE_VIDEO_ID_REGEX_PATTERN = Pattern.compile("^([a-zA-Z0-9_-]{11})");
4242
private static final YoutubeStreamLinkHandlerFactory instance = new YoutubeStreamLinkHandlerFactory();
43-
private static final List<String> folders = Arrays.asList("embed/", "shorts/", "watch/", "v/", "w/");
43+
private static final List<String> subpaths = Arrays.asList("embed/", "shorts/", "watch/", "v/", "w/");
4444

4545
private YoutubeStreamLinkHandlerFactory() {
4646
}
@@ -153,7 +153,7 @@ public String getId(String urlString) throws ParsingException, IllegalArgumentEx
153153
return assertIsId(viewQueryValue);
154154
}
155155

156-
String maybeId = getIdFromFoldersInPath(path);
156+
String maybeId = getIdFromSubpathsInPath(path);
157157
if (maybeId != null) return maybeId;
158158

159159
String viewQueryValue = Utils.getQueryValue(url, "v");
@@ -195,7 +195,7 @@ public String getId(String urlString) throws ParsingException, IllegalArgumentEx
195195
return assertIsId(viewQueryValue);
196196
}
197197
}
198-
String maybeId = getIdFromFoldersInPath(path);
198+
String maybeId = getIdFromSubpathsInPath(path);
199199
if (maybeId != null) return maybeId;
200200

201201
String viewQueryValue = Utils.getQueryValue(url, "v");
@@ -222,10 +222,10 @@ public boolean onAcceptUrl(final String url) throws FoundAdException {
222222
}
223223
}
224224

225-
private String getIdFromFoldersInPath(String path) throws ParsingException {
226-
for (final String folder : folders) {
227-
if (path.startsWith(folder)) {
228-
String id = path.substring(folder.length());
225+
private String getIdFromSubpathsInPath(String path) throws ParsingException {
226+
for (final String subpath : subpaths) {
227+
if (path.startsWith(subpath)) {
228+
String id = path.substring(subpath.length());
229229
return assertIsId(id);
230230
}
231231
}

0 commit comments

Comments
 (0)