Skip to content

Commit 578f4f0

Browse files
absurdlylongusernameStypox
authored andcommitted
Add error logging in StreamInfo.extractStreams
1 parent 072e977 commit 578f4f0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.schabi.newpipe.extractor.MetaInfo;
2727
import org.schabi.newpipe.extractor.NewPipe;
2828
import org.schabi.newpipe.extractor.StreamingService;
29-
import org.schabi.newpipe.extractor.StreamingServiceId;
3029
import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException;
3130
import org.schabi.newpipe.extractor.exceptions.ContentNotSupportedException;
3231
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
@@ -188,6 +187,18 @@ private static void extractStreams(final StreamInfo streamInfo,
188187
// Either audio or video has to be available, otherwise we didn't get a stream (since
189188
// videoOnly are optional, they don't count).
190189
if ((streamInfo.videoStreams.isEmpty()) && (streamInfo.audioStreams.isEmpty())) {
190+
final var errors = streamInfo.getErrors();
191+
final var url = streamInfo.getOriginalUrl();
192+
final var name = streamInfo.getName();
193+
if (errors.isEmpty()) {
194+
ExtractorLogger.e(TAG, "Error extracting " + name + " " + url
195+
+ "\nCould not get any stream and didn't catch any errors");
196+
} else {
197+
errors.forEach(m -> ExtractorLogger.e(TAG,
198+
"Error for " + streamInfo.getOriginalUrl(),
199+
m));
200+
}
201+
191202
throw new StreamExtractException(
192203
"Could not get any stream. See error variable to get further details.");
193204
}

0 commit comments

Comments
 (0)