[YouTube] Return 0 when there is no timestamp, not -2, as per javadoc
This commit is contained in:
parent
7fb867c166
commit
7cd410f3fc
|
@ -253,7 +253,14 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public long getTimeStamp() throws ParsingException {
|
public long getTimeStamp() throws ParsingException {
|
||||||
return getTimestampSeconds("((#|&|\\?)(t|start)=\\d{0,3}h?\\d{0,3}m?\\d{1,3}s?)");
|
long timestamp = getTimestampSeconds("((#|&|\\?)t=\\d{0,3}h?\\d{0,3}m?\\d{1,3}s?)");
|
||||||
|
|
||||||
|
if (timestamp == -2) {
|
||||||
|
// regex for timestamp was not found
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return timestamp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue