Skip to content

Commit cf1ae71

Browse files
[SoundCloud] Add some logging to SoundcloudStreamExtractor
1 parent 345494f commit cf1ae71

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector;
3636
import org.schabi.newpipe.extractor.stream.StreamType;
3737
import org.schabi.newpipe.extractor.stream.VideoStream;
38+
import org.schabi.newpipe.extractor.utils.ExtractorLogger;
3839
import org.schabi.newpipe.extractor.utils.Utils;
3940

4041
import java.io.IOException;
@@ -46,6 +47,7 @@
4647
import javax.annotation.Nullable;
4748

4849
public class SoundcloudStreamExtractor extends StreamExtractor {
50+
public static final String TAG = SoundcloudStreamExtractor.class.getSimpleName();
4951
private JsonObject track;
5052
private boolean isAvailable = true;
5153

@@ -57,9 +59,12 @@ public SoundcloudStreamExtractor(final StreamingService service,
5759
@Override
5860
public void onFetchPage(@Nonnull final Downloader downloader) throws IOException,
5961
ExtractionException {
60-
track = SoundcloudParsingHelper.resolveFor(downloader, getUrl());
62+
final var url = getUrl();
63+
ExtractorLogger.d(TAG, "onFetchPage(" + url + ")");
64+
track = SoundcloudParsingHelper.resolveFor(downloader, url);
6165

6266
final String policy = track.getString("policy", "");
67+
ExtractorLogger.d(TAG, "policy is: " + policy);
6368
if (!policy.equals("ALLOW") && !policy.equals("MONETIZE")) {
6469
isAvailable = false;
6570

@@ -165,6 +170,7 @@ public List<AudioStream> getAudioStreams() throws ExtractionException {
165170
// For playing the track, it is only necessary to have a streamable track.
166171
// If this is not the case, this track might not be published yet.
167172
if (!track.getBoolean("streamable") || !isAvailable) {
173+
ExtractorLogger.d(TAG, "Not streamable track: " + getUrl());
168174
return audioStreams;
169175
}
170176

@@ -173,6 +179,7 @@ public List<AudioStream> getAudioStreams() throws ExtractionException {
173179
.getArray("transcodings");
174180
if (!isNullOrEmpty(transcodings)) {
175181
// Get information about what stream formats are available
182+
ExtractorLogger.d(TAG, "Extracting audio streams for " + getName());
176183
extractAudioStreams(transcodings, audioStreams);
177184
}
178185
} catch (final NullPointerException e) {

0 commit comments

Comments
 (0)