use substring instead of split
This commit is contained in:
parent
81317cf6bc
commit
8db40db4de
1 changed files with 2 additions and 2 deletions
|
@ -127,7 +127,7 @@ public class YoutubeStreamLinkHandlerFactory extends LinkHandlerFactory {
|
||||||
switch (host.toUpperCase()) {
|
switch (host.toUpperCase()) {
|
||||||
case "WWW.YOUTUBE-NOCOOKIE.COM": {
|
case "WWW.YOUTUBE-NOCOOKIE.COM": {
|
||||||
if (path.startsWith("embed/")) {
|
if (path.startsWith("embed/")) {
|
||||||
String id = path.split("/")[1];
|
String id = path.substring(6); // embed/
|
||||||
|
|
||||||
return assertIsId(id);
|
return assertIsId(id);
|
||||||
}
|
}
|
||||||
|
@ -225,7 +225,7 @@ public class YoutubeStreamLinkHandlerFactory extends LinkHandlerFactory {
|
||||||
private String getIdFromFoldersInPath(String path) throws ParsingException {
|
private String getIdFromFoldersInPath(String path) throws ParsingException {
|
||||||
for (final String folder : folders) {
|
for (final String folder : folders) {
|
||||||
if (path.startsWith(folder)) {
|
if (path.startsWith(folder)) {
|
||||||
String id = path.split("/")[1];
|
String id = path.substring(folder.length());
|
||||||
return assertIsId(id);
|
return assertIsId(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue