mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-28 16:00:33 +05:30
Merge pull request #366 from wb9688/yt-timestamp-start
Support start= timestamps for YouTube
This commit is contained in:
commit
e5d23a89de
@ -240,7 +240,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public long getTimeStamp() throws ParsingException {
|
public long getTimeStamp() throws ParsingException {
|
||||||
return getTimestampSeconds("((#|&|\\?)t=\\d{0,3}h?\\d{0,3}m?\\d{1,3}s?)");
|
return getTimestampSeconds("((#|&|\\?)(t|start)=\\d{0,3}h?\\d{0,3}m?\\d{1,3}s?)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -48,6 +48,8 @@ public class YoutubeStreamExtractorAgeRestrictedTest {
|
|||||||
public void testGetValidTimeStamp() throws IOException, ExtractionException {
|
public void testGetValidTimeStamp() throws IOException, ExtractionException {
|
||||||
StreamExtractor extractor = YouTube.getStreamExtractor("https://youtu.be/FmG385_uUys?t=174");
|
StreamExtractor extractor = YouTube.getStreamExtractor("https://youtu.be/FmG385_uUys?t=174");
|
||||||
assertEquals(extractor.getTimeStamp() + "", "174");
|
assertEquals(extractor.getTimeStamp() + "", "174");
|
||||||
|
extractor = YouTube.getStreamExtractor("https://youtube.com/embed/FmG385_uUys?start=174");
|
||||||
|
assertEquals(extractor.getTimeStamp() + "", "174");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user