Skip to content

Commit 5fcd971

Browse files
absurdlylongusernameStypox
authored andcommitted
[SoundCloud] SoundCloudStreamExtractor.getTimeStamp return 0 if no timestamp in url
1 parent d9af459 commit 5fcd971

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamExtractor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ public long getLength() {
121121

122122
@Override
123123
public long getTimeStamp() throws ParsingException {
124-
return getTimestampSeconds("(#t=\\d{0,3}h?\\d{0,3}m?\\d{1,3}s?)");
124+
final var timestamp = getTimestampSeconds("(#t=\\d{0,3}h?\\d{0,3}m?\\d{1,3}s?)");
125+
return timestamp == -2 ? 0 : timestamp;
125126
}
126127

127128
@Override
@@ -170,7 +171,7 @@ public List<AudioStream> getAudioStreams() throws ExtractionException {
170171

171172
try {
172173
final JsonArray transcodings = track.getObject("media")
173-
.getArray("transcodings");
174+
.getArray("transcodings");
174175
if (!isNullOrEmpty(transcodings)) {
175176
// Get information about what stream formats are available
176177
extractAudioStreams(transcodings, audioStreams);

0 commit comments

Comments
 (0)