Skip to content

Commit 95ea906

Browse files
absurdlylongusernameStypox
authored andcommitted
[SoundCloud] Add some logging to SoundcloudStreamExtractor
1 parent 1188011 commit 95ea906

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

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

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

0 commit comments

Comments
 (0)