1111import org .schabi .newpipe .extractor .StreamingService ;
1212import org .schabi .newpipe .extractor .downloader .Downloader ;
1313import org .schabi .newpipe .extractor .exceptions .ContentNotAvailableException ;
14- import org .schabi .newpipe .extractor .exceptions .ContentNotSupportedException ;
1514import org .schabi .newpipe .extractor .exceptions .ExtractionException ;
15+ import org .schabi .newpipe .extractor .exceptions .GeographicRestrictionException ;
1616import org .schabi .newpipe .extractor .exceptions .ParsingException ;
17+ import org .schabi .newpipe .extractor .exceptions .SoundCloudGoPlusException ;
1718import org .schabi .newpipe .extractor .linkhandler .LinkHandler ;
1819import org .schabi .newpipe .extractor .localization .DateWrapper ;
1920import org .schabi .newpipe .extractor .services .soundcloud .SoundcloudParsingHelper ;
3839import javax .annotation .Nullable ;
3940
4041import static org .schabi .newpipe .extractor .utils .JsonUtils .EMPTY_STRING ;
42+ import static org .schabi .newpipe .extractor .utils .Utils .HTTPS ;
4143import static org .schabi .newpipe .extractor .utils .Utils .isNullOrEmpty ;
4244
4345public class SoundcloudStreamExtractor extends StreamExtractor {
@@ -53,6 +55,12 @@ public void onFetchPage(@Nonnull Downloader downloader) throws IOException, Extr
5355
5456 String policy = track .getString ("policy" , EMPTY_STRING );
5557 if (!policy .equals ("ALLOW" ) && !policy .equals ("MONETIZE" )) {
58+ if (policy .equals ("SNIP" )) {
59+ throw new SoundCloudGoPlusException ();
60+ }
61+ if (policy .equals ("BLOCK" )) {
62+ throw new GeographicRestrictionException ("This track is not available in user's country" );
63+ }
5664 throw new ContentNotAvailableException ("Content not available: policy " + policy );
5765 }
5866 }
0 commit comments