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
@@ -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