3535import org .schabi .newpipe .extractor .stream .StreamInfoItemsCollector ;
3636import org .schabi .newpipe .extractor .stream .StreamType ;
3737import org .schabi .newpipe .extractor .stream .VideoStream ;
38+ import org .schabi .newpipe .extractor .utils .ExtractorLogger ;
3839import org .schabi .newpipe .extractor .utils .Utils ;
3940
4041import java .io .IOException ;
4647import javax .annotation .Nullable ;
4748
4849public 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