mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-24 00:50:32 +00:00
fixed another pattern problem
This commit is contained in:
parent
11d3aeb0dd
commit
5decd55551
@ -53,7 +53,11 @@ public class YoutubeVideoUrlIdHandler implements VideoUrlIdHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(url.contains("youtu.be")) {
|
else if(url.contains("youtu.be")) {
|
||||||
id = Parser.matchGroup1("youtu\\.be/([a-zA-Z0-9_-]{11})", url);
|
if(url.contains("v=")) {
|
||||||
|
id = Parser.matchGroup1("v=([\\-a-zA-Z0-9_]{11})", url);
|
||||||
|
} else {
|
||||||
|
id = Parser.matchGroup1("youtu\\.be/([a-zA-Z0-9_-]{11})", url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new ParsingException("Error no suitable url: " + url);
|
throw new ParsingException("Error no suitable url: " + url);
|
||||||
@ -61,7 +65,6 @@ public class YoutubeVideoUrlIdHandler implements VideoUrlIdHandler {
|
|||||||
|
|
||||||
|
|
||||||
if(!id.isEmpty()){
|
if(!id.isEmpty()){
|
||||||
//Log.i(TAG, "string \""+url+"\" matches!");
|
|
||||||
return id;
|
return id;
|
||||||
} else {
|
} else {
|
||||||
throw new ParsingException("Error could not parse url: " + url);
|
throw new ParsingException("Error could not parse url: " + url);
|
||||||
|
Loading…
Reference in New Issue
Block a user