remove unused ExtractionExceptions
This commit is contained in:
parent
d812a114c5
commit
dc0ef3b89a
|
@ -36,7 +36,7 @@ public abstract class Extractor {
|
||||||
private boolean pageFetched = false;
|
private boolean pageFetched = false;
|
||||||
private final Downloader downloader;
|
private final Downloader downloader;
|
||||||
|
|
||||||
public Extractor(StreamingService service, String url) throws ExtractionException {
|
public Extractor(final StreamingService service, final String url) {
|
||||||
if(service == null) throw new NullPointerException("service is null");
|
if(service == null) throw new NullPointerException("service is null");
|
||||||
if(url == null) throw new NullPointerException("url is null");
|
if(url == null) throw new NullPointerException("url is null");
|
||||||
this.service = service;
|
this.service = service;
|
||||||
|
|
|
@ -14,7 +14,7 @@ public abstract class ListExtractor extends Extractor {
|
||||||
/**
|
/**
|
||||||
* Get a new ListExtractor with the given nextPageUrl set.
|
* Get a new ListExtractor with the given nextPageUrl set.
|
||||||
*/
|
*/
|
||||||
public ListExtractor(StreamingService service, String url) throws ExtractionException {
|
public ListExtractor(StreamingService service, String url) {
|
||||||
super(service, url);
|
super(service, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ import java.util.List;
|
||||||
* Provides access to streaming services supported by NewPipe.
|
* Provides access to streaming services supported by NewPipe.
|
||||||
*/
|
*/
|
||||||
public class NewPipe {
|
public class NewPipe {
|
||||||
private static final String TAG = NewPipe.class.toString();
|
|
||||||
private static Downloader downloader = null;
|
private static Downloader downloader = null;
|
||||||
|
|
||||||
private NewPipe() {
|
private NewPipe() {
|
||||||
|
|
|
@ -66,12 +66,13 @@ public abstract class StreamingService {
|
||||||
public abstract UrlIdHandler getStreamUrlIdHandler();
|
public abstract UrlIdHandler getStreamUrlIdHandler();
|
||||||
public abstract UrlIdHandler getChannelUrlIdHandler();
|
public abstract UrlIdHandler getChannelUrlIdHandler();
|
||||||
public abstract UrlIdHandler getPlaylistUrlIdHandler();
|
public abstract UrlIdHandler getPlaylistUrlIdHandler();
|
||||||
|
|
||||||
public abstract SearchEngine getSearchEngine();
|
public abstract SearchEngine getSearchEngine();
|
||||||
public abstract SuggestionExtractor getSuggestionExtractor();
|
public abstract SuggestionExtractor getSuggestionExtractor();
|
||||||
public abstract StreamExtractor getStreamExtractor(String url) throws ExtractionException;
|
public abstract StreamExtractor getStreamExtractor(String url);
|
||||||
public abstract KioskList getKioskList() throws ExtractionException;
|
public abstract KioskList getKioskList() throws ExtractionException;
|
||||||
public abstract ChannelExtractor getChannelExtractor(String url) throws ExtractionException;
|
public abstract ChannelExtractor getChannelExtractor(String url);
|
||||||
public abstract PlaylistExtractor getPlaylistExtractor(String url) throws ExtractionException;
|
public abstract PlaylistExtractor getPlaylistExtractor(String url);
|
||||||
public abstract SubscriptionExtractor getSubscriptionExtractor();
|
public abstract SubscriptionExtractor getSubscriptionExtractor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,8 +31,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
public abstract class ChannelExtractor extends ListExtractor {
|
public abstract class ChannelExtractor extends ListExtractor {
|
||||||
|
|
||||||
public ChannelExtractor(StreamingService service, String url)
|
public ChannelExtractor(StreamingService service, String url) {
|
||||||
throws ExtractionException {
|
|
||||||
super(service, url);
|
super(service, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
public abstract class PlaylistExtractor extends ListExtractor {
|
public abstract class PlaylistExtractor extends ListExtractor {
|
||||||
|
|
||||||
public PlaylistExtractor(StreamingService service, String url) throws ExtractionException {
|
public PlaylistExtractor(StreamingService service, String url) {
|
||||||
super(service, url);
|
super(service, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class SoundcloudChannelExtractor extends ChannelExtractor {
|
||||||
private StreamInfoItemsCollector streamInfoItemsCollector = null;
|
private StreamInfoItemsCollector streamInfoItemsCollector = null;
|
||||||
private String nextPageUrl = null;
|
private String nextPageUrl = null;
|
||||||
|
|
||||||
public SoundcloudChannelExtractor(StreamingService service, String url) throws ExtractionException {
|
public SoundcloudChannelExtractor(StreamingService service, String url) {
|
||||||
super(service, url);
|
super(service, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class SoundcloudPlaylistExtractor extends PlaylistExtractor {
|
||||||
private StreamInfoItemsCollector streamInfoItemsCollector = null;
|
private StreamInfoItemsCollector streamInfoItemsCollector = null;
|
||||||
private String nextPageUrl = null;
|
private String nextPageUrl = null;
|
||||||
|
|
||||||
public SoundcloudPlaylistExtractor(StreamingService service, String url) throws ExtractionException {
|
public SoundcloudPlaylistExtractor(StreamingService service, String url) {
|
||||||
super(service, url);
|
super(service, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,17 +45,17 @@ public class SoundcloudService extends StreamingService {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StreamExtractor getStreamExtractor(String url) throws ExtractionException {
|
public StreamExtractor getStreamExtractor(String url) {
|
||||||
return new SoundcloudStreamExtractor(this, url);
|
return new SoundcloudStreamExtractor(this, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ChannelExtractor getChannelExtractor(String url) throws ExtractionException {
|
public ChannelExtractor getChannelExtractor(String url) {
|
||||||
return new SoundcloudChannelExtractor(this, url);
|
return new SoundcloudChannelExtractor(this, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PlaylistExtractor getPlaylistExtractor(String url) throws ExtractionException {
|
public PlaylistExtractor getPlaylistExtractor(String url) {
|
||||||
return new SoundcloudPlaylistExtractor(this, url);
|
return new SoundcloudPlaylistExtractor(this, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ import java.util.*;
|
||||||
public class SoundcloudStreamExtractor extends StreamExtractor {
|
public class SoundcloudStreamExtractor extends StreamExtractor {
|
||||||
private JsonObject track;
|
private JsonObject track;
|
||||||
|
|
||||||
public SoundcloudStreamExtractor(StreamingService service, String url) throws ExtractionException {
|
public SoundcloudStreamExtractor(StreamingService service, String url) {
|
||||||
super(service, url);
|
super(service, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,10 +60,8 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
|
||||||
*/
|
*/
|
||||||
//private boolean fetchingNextStreams;
|
//private boolean fetchingNextStreams;
|
||||||
|
|
||||||
public YoutubeChannelExtractor(StreamingService service, String url) throws ExtractionException {
|
public YoutubeChannelExtractor(StreamingService service, String url) {
|
||||||
super(service, url);
|
super(service, url);
|
||||||
|
|
||||||
//fetchingNextStreams = nextPageUrl != null && !nextPageUrl.isEmpty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor {
|
||||||
*/
|
*/
|
||||||
private Document nextPageAjax;
|
private Document nextPageAjax;
|
||||||
|
|
||||||
public YoutubePlaylistExtractor(StreamingService service, String url) throws ExtractionException {
|
public YoutubePlaylistExtractor(StreamingService service, String url) {
|
||||||
super(service, url);
|
super(service, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,17 +65,17 @@ public class YoutubeService extends StreamingService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StreamExtractor getStreamExtractor(String url) throws ExtractionException {
|
public StreamExtractor getStreamExtractor(String url) {
|
||||||
return new YoutubeStreamExtractor(this, url);
|
return new YoutubeStreamExtractor(this, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ChannelExtractor getChannelExtractor(String url) throws ExtractionException {
|
public ChannelExtractor getChannelExtractor(String url) {
|
||||||
return new YoutubeChannelExtractor(this, url);
|
return new YoutubeChannelExtractor(this, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PlaylistExtractor getPlaylistExtractor(String url) throws ExtractionException {
|
public PlaylistExtractor getPlaylistExtractor(String url) {
|
||||||
return new YoutubePlaylistExtractor(this, url);
|
return new YoutubePlaylistExtractor(this, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
||||||
|
|
||||||
private boolean isAgeRestricted;
|
private boolean isAgeRestricted;
|
||||||
|
|
||||||
public YoutubeStreamExtractor(StreamingService service, String url) throws ExtractionException {
|
public YoutubeStreamExtractor(StreamingService service, String url) {
|
||||||
super(service, url);
|
super(service, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||||
|
|
||||||
public static final int NO_AGE_LIMIT = 0;
|
public static final int NO_AGE_LIMIT = 0;
|
||||||
|
|
||||||
public StreamExtractor(StreamingService service, String url) throws ExtractionException {
|
public StreamExtractor(StreamingService service, String url) {
|
||||||
super(service, url);
|
super(service, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
package org.schabi.newpipe.extractor.services.youtube;
|
|
||||||
|
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.schabi.newpipe.Downloader;
|
|
||||||
import org.schabi.newpipe.extractor.NewPipe;
|
|
||||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import static org.junit.Assert.fail;
|
|
||||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Created by Christian Schabesberger on 30.12.15.
|
|
||||||
*
|
|
||||||
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
|
|
||||||
* YoutubeVideoExtractorGema.java is part of NewPipe.
|
|
||||||
*
|
|
||||||
* NewPipe is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* NewPipe is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This exception is only thrown in Germany.
|
|
||||||
* <p>
|
|
||||||
* WARNING: Deactivate this Test Case before uploading it to Github, otherwise CI will fail.
|
|
||||||
*/
|
|
||||||
public class YoutubeStreamExtractorGemaTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Ignore
|
|
||||||
public void testGemaError() throws IOException, ExtractionException {
|
|
||||||
try {
|
|
||||||
NewPipe.init(Downloader.getInstance());
|
|
||||||
YouTube.getStreamExtractor("https://www.youtube.com/watch?v=3O1_3zBUKM8");
|
|
||||||
|
|
||||||
fail("GemaException should be thrown");
|
|
||||||
} catch (YoutubeStreamExtractor.GemaException ignored) {
|
|
||||||
// Exception was thrown, Gema error detection is working.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue