Fixed improper handling of playlist deep links
This commit is contained in:
parent
dcca11fbeb
commit
a9ce0b29d0
1 changed files with 6 additions and 2 deletions
|
@ -63,7 +63,9 @@ public class YoutubeStreamLinkHandlerFactory extends LinkHandlerFactory {
|
||||||
String id;
|
String id;
|
||||||
String lowercaseUrl = url.toLowerCase();
|
String lowercaseUrl = url.toLowerCase();
|
||||||
if (lowercaseUrl.contains("youtube")) {
|
if (lowercaseUrl.contains("youtube")) {
|
||||||
if (url.contains("attribution_link")) {
|
if (lowercaseUrl.contains("list=")) {
|
||||||
|
throw new ParsingException("Error no suitable url: " + url);
|
||||||
|
} else if (url.contains("attribution_link")) {
|
||||||
try {
|
try {
|
||||||
String escapedQuery = Parser.matchGroup1("u=(.[^&|$]*)", url);
|
String escapedQuery = Parser.matchGroup1("u=(.[^&|$]*)", url);
|
||||||
String query = URLDecoder.decode(escapedQuery, "UTF-8");
|
String query = URLDecoder.decode(escapedQuery, "UTF-8");
|
||||||
|
@ -83,7 +85,9 @@ public class YoutubeStreamLinkHandlerFactory extends LinkHandlerFactory {
|
||||||
id = Parser.matchGroup1("[?&]v=" + ID_PATTERN, url);
|
id = Parser.matchGroup1("[?&]v=" + ID_PATTERN, url);
|
||||||
}
|
}
|
||||||
} else if (lowercaseUrl.contains("youtu.be")) {
|
} else if (lowercaseUrl.contains("youtu.be")) {
|
||||||
if (url.contains("v=")) {
|
if (lowercaseUrl.contains("list=")) {
|
||||||
|
throw new ParsingException("Error no suitable url: " + url);
|
||||||
|
} else if (url.contains("v=")) {
|
||||||
id = Parser.matchGroup1("v=" + ID_PATTERN, url);
|
id = Parser.matchGroup1("v=" + ID_PATTERN, url);
|
||||||
} else {
|
} else {
|
||||||
id = Parser.matchGroup1("[Yy][Oo][Uu][Tt][Uu]\\.[Bb][Ee]/" + ID_PATTERN, url);
|
id = Parser.matchGroup1("[Yy][Oo][Uu][Tt][Uu]\\.[Bb][Ee]/" + ID_PATTERN, url);
|
||||||
|
|
Loading…
Reference in a new issue