mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-27 23:40:36 +05:30
Improve code formatting and optimise imports
This commit is contained in:
parent
fc9f03178f
commit
030465b5d4
@ -1,10 +1,5 @@
|
||||
package org.schabi.newpipe.extractor;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
@ -13,6 +8,10 @@ import org.schabi.newpipe.extractor.localization.ContentCountry;
|
||||
import org.schabi.newpipe.extractor.localization.Localization;
|
||||
import org.schabi.newpipe.extractor.localization.TimeAgoParser;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.IOException;
|
||||
|
||||
public abstract class Extractor {
|
||||
/**
|
||||
* {@link StreamingService} currently related to this extractor.<br>
|
||||
@ -21,8 +20,10 @@ public abstract class Extractor{
|
||||
private final StreamingService service;
|
||||
private final LinkHandler linkHandler;
|
||||
|
||||
@Nullable private Localization forcedLocalization = null;
|
||||
@Nullable private ContentCountry forcedContentCountry = null;
|
||||
@Nullable
|
||||
private Localization forcedLocalization = null;
|
||||
@Nullable
|
||||
private ContentCountry forcedContentCountry = null;
|
||||
|
||||
private boolean pageFetched = false;
|
||||
private final Downloader downloader;
|
||||
@ -46,6 +47,7 @@ public abstract class Extractor{
|
||||
|
||||
/**
|
||||
* Fetch the current page.
|
||||
*
|
||||
* @throws IOException if the page can not be loaded
|
||||
* @throws ExtractionException if the pages content is not understood
|
||||
*/
|
||||
@ -65,6 +67,7 @@ public abstract class Extractor{
|
||||
|
||||
/**
|
||||
* Fetch the current page.
|
||||
*
|
||||
* @param downloader the download to use
|
||||
* @throws IOException if the page can not be loaded
|
||||
* @throws ExtractionException if the pages content is not understood
|
||||
@ -78,6 +81,7 @@ public abstract class Extractor{
|
||||
|
||||
/**
|
||||
* Get the name
|
||||
*
|
||||
* @return the name
|
||||
* @throws ParsingException if the name cannot be extracted
|
||||
*/
|
||||
|
@ -116,6 +116,7 @@ public enum MediaFormat {
|
||||
|
||||
/**
|
||||
* Get the media format by it's id.
|
||||
*
|
||||
* @param id the id
|
||||
* @return the id of the media format or null.
|
||||
*/
|
||||
@ -135,6 +136,7 @@ public enum MediaFormat {
|
||||
|
||||
/**
|
||||
* Get the name of the format
|
||||
*
|
||||
* @return the name of the format
|
||||
*/
|
||||
public String getName() {
|
||||
@ -143,6 +145,7 @@ public enum MediaFormat {
|
||||
|
||||
/**
|
||||
* Get the filename extension
|
||||
*
|
||||
* @return the filename extension
|
||||
*/
|
||||
public String getSuffix() {
|
||||
@ -151,6 +154,7 @@ public enum MediaFormat {
|
||||
|
||||
/**
|
||||
* Get the mime type
|
||||
*
|
||||
* @return the mime type
|
||||
*/
|
||||
public String getMimeType() {
|
||||
|
@ -1,14 +1,14 @@
|
||||
package org.schabi.newpipe.extractor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.schabi.newpipe.extractor.services.media_ccc.MediaCCCService;
|
||||
import org.schabi.newpipe.extractor.services.peertube.PeertubeService;
|
||||
import org.schabi.newpipe.extractor.services.soundcloud.SoundcloudService;
|
||||
import org.schabi.newpipe.extractor.services.youtube.YoutubeService;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* Copyright (C) Christian Schabesberger 2018 <chris.schabesberger@mailbox.org>
|
||||
* ServiceList.java is part of NewPipe.
|
||||
|
@ -1,20 +1,12 @@
|
||||
package org.schabi.newpipe.extractor;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
|
||||
import org.schabi.newpipe.extractor.comments.CommentsExtractor;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.feed.FeedExtractor;
|
||||
import org.schabi.newpipe.extractor.kiosk.KioskList;
|
||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandler;
|
||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandler;
|
||||
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.linkhandler.*;
|
||||
import org.schabi.newpipe.extractor.localization.ContentCountry;
|
||||
import org.schabi.newpipe.extractor.localization.Localization;
|
||||
import org.schabi.newpipe.extractor.localization.TimeAgoParser;
|
||||
@ -26,6 +18,8 @@ import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor;
|
||||
import org.schabi.newpipe.extractor.suggestion.SuggestionExtractor;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* Copyright (C) Christian Schabesberger 2018 <chris.schabesberger@mailbox.org>
|
||||
|
@ -1,7 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.comments;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.schabi.newpipe.extractor.ListExtractor.InfoItemsPage;
|
||||
import org.schabi.newpipe.extractor.ListInfo;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
@ -10,6 +8,8 @@ import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||
import org.schabi.newpipe.extractor.utils.ExtractorHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class CommentsInfo extends ListInfo<CommentsInfoItem> {
|
||||
|
||||
private CommentsInfo(int serviceId, ListLinkHandler listUrlIdHandler, String name) {
|
||||
|
@ -25,7 +25,6 @@ import org.schabi.newpipe.extractor.ListExtractor;
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
@ -26,14 +26,17 @@ public class KioskList {
|
||||
private final HashMap<String, KioskEntry> kioskList = new HashMap<>();
|
||||
private String defaultKiosk = null;
|
||||
|
||||
@Nullable private Localization forcedLocalization;
|
||||
@Nullable private ContentCountry forcedContentCountry;
|
||||
@Nullable
|
||||
private Localization forcedLocalization;
|
||||
@Nullable
|
||||
private ContentCountry forcedContentCountry;
|
||||
|
||||
private class KioskEntry {
|
||||
public KioskEntry(KioskExtractorFactory ef, ListLinkHandlerFactory h) {
|
||||
extractorFactory = ef;
|
||||
handlerFactory = h;
|
||||
}
|
||||
|
||||
final KioskExtractorFactory extractorFactory;
|
||||
final ListLinkHandlerFactory handlerFactory;
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
package org.schabi.newpipe.extractor.linkhandler;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.utils.Utils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class LinkHandler implements Serializable {
|
||||
protected final String originalUrl;
|
||||
protected final String url;
|
||||
|
@ -1,19 +1,25 @@
|
||||
package org.schabi.newpipe.extractor.linkhandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.utils.Utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ListLinkHandlerFactory extends LinkHandlerFactory {
|
||||
|
||||
///////////////////////////////////
|
||||
// To Override
|
||||
///////////////////////////////////
|
||||
|
||||
public List<String> getContentFilter(String url) throws ParsingException { return new ArrayList<>(0);}
|
||||
public String getSortFilter(String url) throws ParsingException {return ""; }
|
||||
public List<String> getContentFilter(String url) throws ParsingException {
|
||||
return new ArrayList<>(0);
|
||||
}
|
||||
|
||||
public String getSortFilter(String url) throws ParsingException {
|
||||
return "";
|
||||
}
|
||||
|
||||
public abstract String getUrl(String id, List<String> contentFilter, String sortFilter) throws ParsingException;
|
||||
|
||||
public String getUrl(String id, List<String> contentFilter, String sortFilter, String baseUrl) throws ParsingException {
|
||||
@ -65,6 +71,7 @@ public abstract class ListLinkHandlerFactory extends LinkHandlerFactory {
|
||||
/**
|
||||
* For makeing ListLinkHandlerFactory compatible with LinkHandlerFactory we need to override this,
|
||||
* however it should not be overridden by the actual implementation.
|
||||
*
|
||||
* @param id
|
||||
* @return the url coresponding to id without any filters applied
|
||||
*/
|
||||
|
@ -24,6 +24,7 @@ public class SearchQueryHandler extends ListLinkHandler {
|
||||
/**
|
||||
* Returns the search string. Since ListQIHandler is based on ListLinkHandler
|
||||
* getSearchString() is equivalent to calling getId().
|
||||
*
|
||||
* @return the search string
|
||||
*/
|
||||
public String getSearchString() {
|
||||
|
@ -13,14 +13,19 @@ public abstract class SearchQueryHandlerFactory extends ListLinkHandlerFactory {
|
||||
|
||||
@Override
|
||||
public abstract String getUrl(String querry, List<String> contentFilter, String sortFilter) throws ParsingException;
|
||||
public String getSearchString(String url) { return "";}
|
||||
|
||||
public String getSearchString(String url) {
|
||||
return "";
|
||||
}
|
||||
|
||||
///////////////////////////////////
|
||||
// Logic
|
||||
///////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getId(String url) { return getSearchString(url); }
|
||||
public String getId(String url) {
|
||||
return getSearchString(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SearchQueryHandler fromQuery(String querry,
|
||||
@ -35,9 +40,12 @@ public abstract class SearchQueryHandlerFactory extends ListLinkHandlerFactory {
|
||||
|
||||
/**
|
||||
* It's not mandatorry for NewPipe to handle the Url
|
||||
*
|
||||
* @param url
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean onAcceptUrl(String url) { return false; }
|
||||
public boolean onAcceptUrl(String url) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,10 @@ package org.schabi.newpipe.extractor.localization;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class Localization implements Serializable {
|
||||
public static final Localization DEFAULT = new Localization("en", "GB");
|
||||
|
@ -23,6 +23,7 @@ public class TimeAgoParser {
|
||||
* <p>
|
||||
* Instantiate a new {@link TimeAgoParser} every time you extract a new batch of items.
|
||||
* </p>
|
||||
*
|
||||
* @param patternsHolder An object that holds the "time ago" patterns, special cases, and the language word separator.
|
||||
*/
|
||||
public TimeAgoParser(PatternsHolder patternsHolder) {
|
||||
@ -164,6 +165,7 @@ public class TimeAgoParser {
|
||||
|
||||
/**
|
||||
* Marks the time as approximated by setting minutes, seconds and milliseconds to 0.
|
||||
*
|
||||
* @param calendarTime Time to be marked as approximated
|
||||
*/
|
||||
private void markApproximatedTime(Calendar calendarTime) {
|
||||
|
@ -5,7 +5,6 @@ import org.schabi.newpipe.extractor.InfoItemExtractor;
|
||||
import org.schabi.newpipe.extractor.InfoItemsCollector;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelInfoItemExtractor;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelInfoItemsCollector;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.playlist.PlaylistInfoItemExtractor;
|
||||
import org.schabi.newpipe.extractor.playlist.PlaylistInfoItemsCollector;
|
||||
@ -34,7 +33,7 @@ import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector;
|
||||
|
||||
/**
|
||||
* Collector for search results
|
||||
*
|
||||
* <p>
|
||||
* This collector can handle the following extractor types:
|
||||
* <ul>
|
||||
* <li>{@link StreamInfoItemExtractor}</li>
|
||||
|
@ -1,7 +1,6 @@
|
||||
package org.schabi.newpipe.extractor.services.media_ccc.linkHandler;
|
||||
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -1,7 +1,8 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import com.grack.nanojson.JsonParserException;
|
||||
import org.jsoup.helper.StringUtil;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
@ -10,9 +11,7 @@ import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ReCaptchaException;
|
||||
import org.schabi.newpipe.extractor.utils.JsonUtils;
|
||||
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import com.grack.nanojson.JsonParserException;
|
||||
import java.io.IOException;
|
||||
|
||||
public class PeertubeInstance {
|
||||
|
||||
|
@ -1,17 +1,16 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube;
|
||||
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import org.jsoup.helper.StringUtil;
|
||||
import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.jsoup.helper.StringUtil;
|
||||
import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
||||
import com.grack.nanojson.JsonObject;
|
||||
|
||||
public class PeertubeParsingHelper {
|
||||
|
||||
private PeertubeParsingHelper() {
|
||||
|
@ -1,38 +1,24 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.COMMENTS;
|
||||
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.VIDEO;
|
||||
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
|
||||
import org.schabi.newpipe.extractor.comments.CommentsExtractor;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.kiosk.KioskExtractor;
|
||||
import org.schabi.newpipe.extractor.kiosk.KioskList;
|
||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandler;
|
||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandler;
|
||||
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.linkhandler.*;
|
||||
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
||||
import org.schabi.newpipe.extractor.search.SearchExtractor;
|
||||
import org.schabi.newpipe.extractor.services.peertube.extractors.PeertubeChannelExtractor;
|
||||
import org.schabi.newpipe.extractor.services.peertube.extractors.PeertubeCommentsExtractor;
|
||||
import org.schabi.newpipe.extractor.services.peertube.extractors.PeertubeSearchExtractor;
|
||||
import org.schabi.newpipe.extractor.services.peertube.extractors.PeertubeStreamExtractor;
|
||||
import org.schabi.newpipe.extractor.services.peertube.extractors.PeertubeSuggestionExtractor;
|
||||
import org.schabi.newpipe.extractor.services.peertube.extractors.PeertubeTrendingExtractor;
|
||||
import org.schabi.newpipe.extractor.services.peertube.linkHandler.PeertubeChannelLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.services.peertube.linkHandler.PeertubeCommentsLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.services.peertube.linkHandler.PeertubeSearchQueryHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.services.peertube.linkHandler.PeertubeStreamLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.services.peertube.linkHandler.PeertubeTrendingLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.services.peertube.extractors.*;
|
||||
import org.schabi.newpipe.extractor.services.peertube.linkHandler.*;
|
||||
import org.schabi.newpipe.extractor.stream.StreamExtractor;
|
||||
import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor;
|
||||
import org.schabi.newpipe.extractor.suggestion.SuggestionExtractor;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.COMMENTS;
|
||||
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.VIDEO;
|
||||
|
||||
public class PeertubeService extends StreamingService {
|
||||
|
||||
private PeertubeInstance instance;
|
||||
|
@ -1,7 +1,9 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.extractors;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import com.grack.nanojson.JsonParserException;
|
||||
import org.jsoup.helper.StringUtil;
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
|
||||
@ -17,10 +19,7 @@ import org.schabi.newpipe.extractor.utils.JsonUtils;
|
||||
import org.schabi.newpipe.extractor.utils.Parser;
|
||||
import org.schabi.newpipe.extractor.utils.Parser.RegexException;
|
||||
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import com.grack.nanojson.JsonParserException;
|
||||
import java.io.IOException;
|
||||
|
||||
public class PeertubeChannelExtractor extends ChannelExtractor {
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.extractors;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import org.jsoup.helper.StringUtil;
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.comments.CommentsExtractor;
|
||||
@ -16,9 +17,7 @@ import org.schabi.newpipe.extractor.utils.JsonUtils;
|
||||
import org.schabi.newpipe.extractor.utils.Parser;
|
||||
import org.schabi.newpipe.extractor.utils.Parser.RegexException;
|
||||
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import java.io.IOException;
|
||||
|
||||
public class PeertubeCommentsExtractor extends CommentsExtractor {
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.extractors;
|
||||
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.schabi.newpipe.extractor.ServiceList;
|
||||
@ -9,8 +10,6 @@ import org.schabi.newpipe.extractor.localization.DateWrapper;
|
||||
import org.schabi.newpipe.extractor.services.peertube.PeertubeParsingHelper;
|
||||
import org.schabi.newpipe.extractor.utils.JsonUtils;
|
||||
|
||||
import com.grack.nanojson.JsonObject;
|
||||
|
||||
|
||||
public class PeertubeCommentsInfoItemExtractor implements CommentsInfoItemExtractor {
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.extractors;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
@ -10,6 +8,8 @@ import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class PeertubePlaylistExtractor extends PlaylistExtractor {
|
||||
|
||||
public PeertubePlaylistExtractor(StreamingService service, ListLinkHandler linkHandler) {
|
||||
|
@ -1,7 +1,8 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.extractors;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import org.jsoup.helper.StringUtil;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
import org.schabi.newpipe.extractor.InfoItemExtractor;
|
||||
@ -18,9 +19,7 @@ import org.schabi.newpipe.extractor.utils.JsonUtils;
|
||||
import org.schabi.newpipe.extractor.utils.Parser;
|
||||
import org.schabi.newpipe.extractor.utils.Parser.RegexException;
|
||||
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import java.io.IOException;
|
||||
|
||||
public class PeertubeSearchExtractor extends SearchExtractor {
|
||||
|
||||
|
@ -1,13 +1,9 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.extractors;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import com.grack.nanojson.JsonParserException;
|
||||
import org.jsoup.helper.StringUtil;
|
||||
import org.schabi.newpipe.extractor.MediaFormat;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
@ -24,12 +20,14 @@ import org.schabi.newpipe.extractor.services.peertube.linkHandler.PeertubeSearch
|
||||
import org.schabi.newpipe.extractor.stream.*;
|
||||
import org.schabi.newpipe.extractor.utils.JsonUtils;
|
||||
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import com.grack.nanojson.JsonParserException;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class PeertubeStreamExtractor extends StreamExtractor {
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.extractors;
|
||||
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import org.schabi.newpipe.extractor.ServiceList;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.localization.DateWrapper;
|
||||
@ -8,8 +9,6 @@ import org.schabi.newpipe.extractor.stream.StreamInfoItemExtractor;
|
||||
import org.schabi.newpipe.extractor.stream.StreamType;
|
||||
import org.schabi.newpipe.extractor.utils.JsonUtils;
|
||||
|
||||
import com.grack.nanojson.JsonObject;
|
||||
|
||||
public class PeertubeStreamInfoItemExtractor implements StreamInfoItemExtractor {
|
||||
|
||||
protected final JsonObject item;
|
||||
|
@ -1,10 +1,10 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.extractors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PeertubeSubscriptionExtractor extends SubscriptionExtractor {
|
||||
|
||||
public PeertubeSubscriptionExtractor(StreamingService service, List<ContentSource> supportedSources) {
|
||||
|
@ -1,13 +1,13 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.extractors;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.suggestion.SuggestionExtractor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class PeertubeSuggestionExtractor extends SuggestionExtractor {
|
||||
|
||||
public PeertubeSuggestionExtractor(StreamingService service) {
|
||||
|
@ -1,7 +1,8 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.extractors;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import org.jsoup.helper.StringUtil;
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
@ -16,9 +17,7 @@ import org.schabi.newpipe.extractor.utils.JsonUtils;
|
||||
import org.schabi.newpipe.extractor.utils.Parser;
|
||||
import org.schabi.newpipe.extractor.utils.Parser.RegexException;
|
||||
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import java.io.IOException;
|
||||
|
||||
public class PeertubeTrendingExtractor extends KioskExtractor<StreamInfoItem> {
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.linkHandler;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.schabi.newpipe.extractor.ServiceList;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.utils.Parser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PeertubeChannelLinkHandlerFactory extends ListLinkHandlerFactory {
|
||||
|
||||
private static final PeertubeChannelLinkHandlerFactory instance = new PeertubeChannelLinkHandlerFactory();
|
||||
|
@ -1,13 +1,13 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.linkHandler;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.schabi.newpipe.extractor.ServiceList;
|
||||
import org.schabi.newpipe.extractor.exceptions.FoundAdException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.utils.Parser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PeertubeCommentsLinkHandlerFactory extends ListLinkHandlerFactory {
|
||||
|
||||
private static final PeertubeCommentsLinkHandlerFactory instance = new PeertubeCommentsLinkHandlerFactory();
|
||||
|
@ -1,13 +1,13 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.linkHandler;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.schabi.newpipe.extractor.ServiceList;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.utils.Parser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PeertubePlaylistLinkHandlerFactory extends ListLinkHandlerFactory {
|
||||
|
||||
private static final PeertubePlaylistLinkHandlerFactory instance = new PeertubePlaylistLinkHandlerFactory();
|
||||
|
@ -1,13 +1,13 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.linkHandler;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
import org.schabi.newpipe.extractor.ServiceList;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandlerFactory;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
public class PeertubeSearchQueryHandlerFactory extends SearchQueryHandlerFactory {
|
||||
|
||||
public static final String CHARSET_UTF_8 = "UTF-8";
|
||||
|
@ -1,14 +1,14 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.linkHandler;
|
||||
|
||||
import org.schabi.newpipe.extractor.ServiceList;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.schabi.newpipe.extractor.ServiceList;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
|
||||
public class PeertubeTrendingLinkHandlerFactory extends ListLinkHandlerFactory {
|
||||
|
||||
|
||||
|
@ -4,9 +4,9 @@ import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import com.grack.nanojson.JsonParserException;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.schabi.newpipe.extractor.services.soundcloud;
|
||||
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.utils.Parser;
|
||||
import org.schabi.newpipe.extractor.utils.Utils;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.schabi.newpipe.extractor.services.soundcloud;
|
||||
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.kiosk.KioskExtractor;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||
|
@ -103,7 +103,7 @@ public class SoundcloudParsingHelper {
|
||||
|
||||
/**
|
||||
* Call the endpoint "/resolve" of the api.<p>
|
||||
*
|
||||
* <p>
|
||||
* See https://developers.soundcloud.com/docs/api/reference#resolve
|
||||
*/
|
||||
public static JsonObject resolveFor(Downloader downloader, String url) throws IOException, ExtractionException {
|
||||
|
@ -3,8 +3,8 @@ package org.schabi.newpipe.extractor.services.soundcloud;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import com.grack.nanojson.JsonParserException;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.schabi.newpipe.extractor.services.soundcloud;
|
||||
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.utils.Parser;
|
||||
import org.schabi.newpipe.extractor.utils.Utils;
|
||||
|
||||
|
@ -4,7 +4,10 @@ import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import com.grack.nanojson.JsonParserException;
|
||||
import org.schabi.newpipe.extractor.*;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
import org.schabi.newpipe.extractor.InfoItemExtractor;
|
||||
import org.schabi.newpipe.extractor.InfoItemsCollector;
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
@ -1,25 +1,20 @@
|
||||
package org.schabi.newpipe.extractor.services.soundcloud;
|
||||
|
||||
import static java.util.Collections.singletonList;
|
||||
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.AUDIO;
|
||||
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
|
||||
import org.schabi.newpipe.extractor.comments.CommentsExtractor;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.kiosk.KioskExtractor;
|
||||
import org.schabi.newpipe.extractor.kiosk.KioskList;
|
||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandler;
|
||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandler;
|
||||
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.linkhandler.*;
|
||||
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
||||
import org.schabi.newpipe.extractor.search.SearchExtractor;
|
||||
import org.schabi.newpipe.extractor.stream.StreamExtractor;
|
||||
import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor;
|
||||
|
||||
import static java.util.Collections.singletonList;
|
||||
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.AUDIO;
|
||||
|
||||
public class SoundcloudService extends StreamingService {
|
||||
|
||||
public SoundcloudService(int id) {
|
||||
|
@ -4,7 +4,9 @@ import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import com.grack.nanojson.JsonParserException;
|
||||
import org.schabi.newpipe.extractor.*;
|
||||
import org.schabi.newpipe.extractor.MediaFormat;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.schabi.newpipe.extractor.services.soundcloud;
|
||||
|
||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.utils.Parser;
|
||||
import org.schabi.newpipe.extractor.utils.Utils;
|
||||
|
||||
|
@ -4,9 +4,9 @@ import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import com.grack.nanojson.JsonParserException;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.suggestion.SuggestionExtractor;
|
||||
|
@ -1,13 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.youtube;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.AUDIO;
|
||||
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.COMMENTS;
|
||||
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.LIVE;
|
||||
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.VIDEO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
|
||||
import org.schabi.newpipe.extractor.comments.CommentsExtractor;
|
||||
@ -15,28 +7,22 @@ import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.feed.FeedExtractor;
|
||||
import org.schabi.newpipe.extractor.kiosk.KioskExtractor;
|
||||
import org.schabi.newpipe.extractor.kiosk.KioskList;
|
||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandler;
|
||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandler;
|
||||
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.linkhandler.*;
|
||||
import org.schabi.newpipe.extractor.localization.ContentCountry;
|
||||
import org.schabi.newpipe.extractor.localization.Localization;
|
||||
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
||||
import org.schabi.newpipe.extractor.search.SearchExtractor;
|
||||
import org.schabi.newpipe.extractor.services.youtube.extractors.*;
|
||||
import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeChannelLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeCommentsLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubePlaylistLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeSearchQueryHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeStreamLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeTrendingLinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.services.youtube.linkHandler.*;
|
||||
import org.schabi.newpipe.extractor.stream.StreamExtractor;
|
||||
import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor;
|
||||
import org.schabi.newpipe.extractor.suggestion.SuggestionExtractor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.*;
|
||||
|
||||
/*
|
||||
* Created by Christian Schabesberger on 23.08.15.
|
||||
|
@ -3,7 +3,6 @@ package org.schabi.newpipe.extractor.services.youtube.extractors;
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.comments.CommentsExtractor;
|
||||
import org.schabi.newpipe.extractor.comments.CommentsInfoItem;
|
||||
@ -22,7 +21,9 @@ import javax.annotation.Nonnull;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static java.util.Collections.singletonList;
|
||||
|
@ -4,8 +4,8 @@ import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import org.schabi.newpipe.extractor.comments.CommentsInfoItemExtractor;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.localization.TimeAgoParser;
|
||||
import org.schabi.newpipe.extractor.localization.DateWrapper;
|
||||
import org.schabi.newpipe.extractor.localization.TimeAgoParser;
|
||||
import org.schabi.newpipe.extractor.utils.JsonUtils;
|
||||
import org.schabi.newpipe.extractor.utils.Utils;
|
||||
|
||||
|
@ -284,6 +284,7 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor {
|
||||
|
||||
/**
|
||||
* Check if the playlist item is deleted
|
||||
*
|
||||
* @param li the list item
|
||||
* @return true if the item is deleted
|
||||
*/
|
||||
|
@ -114,7 +114,8 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
||||
String name = null;
|
||||
try {
|
||||
name = doc.select("meta[name=title]").attr(CONTENT);
|
||||
} catch (Exception ignored) {}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (name == null) {
|
||||
throw new ParsingException("Could not get name", e);
|
||||
@ -135,7 +136,8 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
||||
String uploadDate = null;
|
||||
try {
|
||||
uploadDate = doc.select("meta[itemprop=datePublished]").attr(CONTENT);
|
||||
} catch (Exception ignored) {}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (uploadDate == null) {
|
||||
throw new ParsingException("Could not get upload date", e);
|
||||
|
@ -3,8 +3,8 @@ package org.schabi.newpipe.extractor.services.youtube.extractors;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.localization.TimeAgoParser;
|
||||
import org.schabi.newpipe.extractor.localization.DateWrapper;
|
||||
import org.schabi.newpipe.extractor.localization.TimeAgoParser;
|
||||
import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeParsingHelper;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItemExtractor;
|
||||
import org.schabi.newpipe.extractor.stream.StreamType;
|
||||
@ -42,6 +42,7 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor {
|
||||
|
||||
/**
|
||||
* Creates an extractor of StreamInfoItems from a YouTube page.
|
||||
*
|
||||
* @param item The page element
|
||||
* @param timeAgoParser A parser of the textual dates or {@code null}.
|
||||
*/
|
||||
|
@ -3,9 +3,9 @@ package org.schabi.newpipe.extractor.services.youtube.extractors;
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import com.grack.nanojson.JsonParserException;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.StreamingService;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.suggestion.SuggestionExtractor;
|
||||
|
@ -1,7 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.stream;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public final class Frameset {
|
||||
|
@ -1,10 +1,10 @@
|
||||
package org.schabi.newpipe.extractor.stream;
|
||||
|
||||
import org.schabi.newpipe.extractor.MediaFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.schabi.newpipe.extractor.MediaFormat;
|
||||
|
||||
/**
|
||||
* Creates a stream object from url, format and optional torrent url
|
||||
*/
|
||||
|
@ -27,7 +27,6 @@ import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandler;
|
||||
import org.schabi.newpipe.extractor.localization.DateWrapper;
|
||||
import org.schabi.newpipe.extractor.utils.JsonUtils;
|
||||
import org.schabi.newpipe.extractor.utils.Parser;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@ -77,6 +76,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
|
||||
/**
|
||||
* This will return the url to the thumbnail of the stream. Try to return the medium resolution here.
|
||||
*
|
||||
* @return The url of the thumbnail.
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -85,6 +85,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
|
||||
/**
|
||||
* This is the stream description.
|
||||
*
|
||||
* @return The description of the stream/video or Description.emptyDescription if the description is empty.
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -93,6 +94,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
|
||||
/**
|
||||
* Get the age limit.
|
||||
*
|
||||
* @return The age which limits the content or {@value NO_AGE_LIMIT} if there is no limit
|
||||
* @throws ParsingException if an error occurs while parsing
|
||||
*/
|
||||
@ -100,6 +102,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
|
||||
/**
|
||||
* This should return the length of a video in seconds.
|
||||
*
|
||||
* @return The length of the stream in seconds.
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -109,6 +112,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
* If the url you are currently handling contains a time stamp/seek, you can return the
|
||||
* position it represents here.
|
||||
* If the url has no time stamp simply return zero.
|
||||
*
|
||||
* @return the timestamp in seconds
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -117,6 +121,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
/**
|
||||
* The count of how many people have watched the video/listened to the audio stream.
|
||||
* If the current stream has no view count or its not available simply return -1
|
||||
*
|
||||
* @return amount of views.
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -125,6 +130,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
/**
|
||||
* The Amount of likes a video/audio stream got.
|
||||
* If the current stream has no likes or its not available simply return -1
|
||||
*
|
||||
* @return the amount of likes the stream got
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -133,6 +139,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
/**
|
||||
* The Amount of dislikes a video/audio stream got.
|
||||
* If the current stream has no dislikes or its not available simply return -1
|
||||
*
|
||||
* @return the amount of likes the stream got
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -144,6 +151,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
* <a href="https://teamnewpipe.github.io/documentation/03_Implement_a_service/#channel">ChannelExtractor</a>,
|
||||
* so be sure to implement that one before you return a value here, otherwise NewPipe will crash if one selects
|
||||
* this url.
|
||||
*
|
||||
* @return the url to the page of the creator/uploader of the stream or an empty String
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -153,6 +161,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
/**
|
||||
* The name of the creator/uploader of the stream.
|
||||
* If the name is not available you can simply return an empty string.
|
||||
*
|
||||
* @return the name of the creator/uploader of the stream or an empty String
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -162,6 +171,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
/**
|
||||
* The url to the image file/profile picture/avatar of the creator/uploader of the stream.
|
||||
* If the url is not available you can return an empty String.
|
||||
*
|
||||
* @return The url of the image file of the uploader or an empty String
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -171,20 +181,24 @@ public abstract class StreamExtractor extends Extractor {
|
||||
/**
|
||||
* Get the dash mpd url. If you don't know what a dash MPD is you can read about it
|
||||
* <a href="https://www.brendanlong.com/the-structure-of-an-mpeg-dash-mpd.html">here</a>.
|
||||
*
|
||||
* @return the url as a string or an empty string
|
||||
* @throws ParsingException if an error occurs while reading
|
||||
*/
|
||||
@Nonnull public abstract String getDashMpdUrl() throws ParsingException;
|
||||
@Nonnull
|
||||
public abstract String getDashMpdUrl() throws ParsingException;
|
||||
|
||||
/**
|
||||
* I am not sure if this is in use, and how this is used. However the frontend is missing support
|
||||
* for HLS streams. Prove me if I am wrong. Please open an
|
||||
* <a href="https://github.com/teamnewpipe/newpipe/issues">issue</a>,
|
||||
* or fix this description if you know whats up with this.
|
||||
*
|
||||
* @return The Url to the hls stream.
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@Nonnull public abstract String getHlsUrl() throws ParsingException;
|
||||
@Nonnull
|
||||
public abstract String getHlsUrl() throws ParsingException;
|
||||
|
||||
/**
|
||||
* This should return a list of available
|
||||
@ -192,6 +206,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
* You can also return null or an empty list, however be aware that if you don't return anything
|
||||
* in getVideoStreams(), getVideoOnlyStreams() and getDashMpdUrl() either the Collector will handle this as
|
||||
* a failed extraction procedure.
|
||||
*
|
||||
* @return a list of audio only streams in the format of AudioStream
|
||||
* @throws IOException
|
||||
* @throws ExtractionException
|
||||
@ -205,6 +220,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
* You can also return null or an empty list, however be aware that if you don't return anything
|
||||
* in getAudioStreams(), getVideoOnlyStreams() and getDashMpdUrl() either the Collector will handle this as
|
||||
* a failed extraction procedure.
|
||||
*
|
||||
* @return a list of combined video and streams in the format of AudioStream
|
||||
* @throws IOException
|
||||
* @throws ExtractionException
|
||||
@ -218,6 +234,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
* You can also return null or an empty list, however be aware that if you don't return anything
|
||||
* in getAudioStreams(), getVideoStreams() and getDashMpdUrl() either the Collector will handle this as
|
||||
* a failed extraction procedure.
|
||||
*
|
||||
* @return a list of video and streams in the format of AudioStream
|
||||
* @throws IOException
|
||||
* @throws ExtractionException
|
||||
@ -228,6 +245,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
* This will return a list of available
|
||||
* <a href="https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/stream/Subtitles.html">Subtitles</a>s.
|
||||
* If no subtitles are available an empty list can returned.
|
||||
*
|
||||
* @return a list of available subtitles or an empty list
|
||||
* @throws IOException
|
||||
* @throws ExtractionException
|
||||
@ -240,6 +258,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
* <a href="https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/stream/Subtitles.html">Subtitles</a>s.
|
||||
* given by a specific type.
|
||||
* If no subtitles in that specific format are available an empty list can returned.
|
||||
*
|
||||
* @param format the media format by which the subtitles should be filtered
|
||||
* @return a list of available subtitles or an empty list
|
||||
* @throws IOException
|
||||
@ -250,6 +269,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
|
||||
/**
|
||||
* Get the <a href="https://teamnewpipe.github.io/NewPipeExtractor/javadoc/">StreamType</a>.
|
||||
*
|
||||
* @return the type of the stream
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -259,6 +279,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
* should return the url of the next stream. NewPipe will automatically play
|
||||
* the next stream if the user wants that.
|
||||
* If the next stream is is not available simply return null
|
||||
*
|
||||
* @return the InfoItem of the next stream
|
||||
* @throws IOException
|
||||
* @throws ExtractionException
|
||||
@ -271,6 +292,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
* be disabled by the user later in the frontend.
|
||||
* This list MUST NOT contain the next available video as this should be return through getNextStream()
|
||||
* If is is not available simply return null
|
||||
*
|
||||
* @return a list of InfoItems showing the related videos/streams
|
||||
* @throws IOException
|
||||
* @throws ExtractionException
|
||||
@ -279,6 +301,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
|
||||
/**
|
||||
* Should return a list of Frameset object that contains preview of stream frames
|
||||
*
|
||||
* @return list of preview frames or empty list if frames preview is not supported or not found for specified stream
|
||||
* @throws IOException
|
||||
* @throws ExtractionException
|
||||
@ -302,6 +325,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
/**
|
||||
* Override this function if the format of time stamp in the url is not the same format as that form youtube.
|
||||
* Honestly I don't even know the time stamp fromat of youtube.
|
||||
*
|
||||
* @param regexPattern
|
||||
* @return the sime stamp/seek for the video in seconds
|
||||
* @throws ParsingException
|
||||
@ -357,6 +381,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
* If the host is not available, or if the service doesn't use
|
||||
* a federated system, but a centralised system,
|
||||
* you can simply return an empty string.
|
||||
*
|
||||
* @return the host of the stream or an empty String.
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -366,6 +391,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
/**
|
||||
* The privacy of the stream (Eg. Public, Private, Unlisted…).
|
||||
* If the privacy is not available you can simply return an empty string.
|
||||
*
|
||||
* @return the privacy of the stream or an empty String.
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -375,6 +401,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
/**
|
||||
* The name of the category of the stream.
|
||||
* If the category is not available you can simply return an empty string.
|
||||
*
|
||||
* @return the category of the stream or an empty String.
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -384,6 +411,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
/**
|
||||
* The name of the licence of the stream.
|
||||
* If the licence is not available you can simply return an empty string.
|
||||
*
|
||||
* @return the licence of the stream or an empty String.
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -395,6 +423,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
* If the language is not available you can simply return null.
|
||||
* If the language is provided by a language code, you can return
|
||||
* new Locale(language_code);
|
||||
*
|
||||
* @return the locale language of the stream or null.
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -404,6 +433,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
/**
|
||||
* The list of tags of the stream.
|
||||
* If the tag list is not available you can simply return an empty list.
|
||||
*
|
||||
* @return the list of tags of the stream or an empty list.
|
||||
* @throws ParsingException
|
||||
*/
|
||||
@ -416,6 +446,7 @@ public abstract class StreamExtractor extends Extractor {
|
||||
* (support button).
|
||||
* If the support information are not available,
|
||||
* you can simply return an empty String.
|
||||
*
|
||||
* @return the support information of the stream or an empty String.
|
||||
* @throws ParsingException
|
||||
*/
|
||||
|
@ -31,6 +31,7 @@ public interface StreamInfoItemExtractor extends InfoItemExtractor {
|
||||
|
||||
/**
|
||||
* Get the stream type
|
||||
*
|
||||
* @return the stream type
|
||||
* @throws ParsingException thrown if there is an error in the extraction
|
||||
*/
|
||||
@ -38,6 +39,7 @@ public interface StreamInfoItemExtractor extends InfoItemExtractor {
|
||||
|
||||
/**
|
||||
* Check if the stream is an ad.
|
||||
*
|
||||
* @return {@code true} if the stream is an ad.
|
||||
* @throws ParsingException thrown if there is an error in the extraction
|
||||
*/
|
||||
@ -45,6 +47,7 @@ public interface StreamInfoItemExtractor extends InfoItemExtractor {
|
||||
|
||||
/**
|
||||
* Get the stream duration in seconds
|
||||
*
|
||||
* @return the stream duration in seconds
|
||||
* @throws ParsingException thrown if there is an error in the extraction
|
||||
*/
|
||||
@ -52,6 +55,7 @@ public interface StreamInfoItemExtractor extends InfoItemExtractor {
|
||||
|
||||
/**
|
||||
* Parses the number of views
|
||||
*
|
||||
* @return the number of views or -1 for live streams
|
||||
* @throws ParsingException thrown if there is an error in the extraction
|
||||
*/
|
||||
@ -59,6 +63,7 @@ public interface StreamInfoItemExtractor extends InfoItemExtractor {
|
||||
|
||||
/**
|
||||
* Get the uploader name
|
||||
*
|
||||
* @return the uploader name
|
||||
* @throws ParsingException if parsing fails
|
||||
*/
|
||||
|
@ -56,6 +56,7 @@ public class VideoStream extends Stream {
|
||||
|
||||
/**
|
||||
* Get the video resolution
|
||||
*
|
||||
* @return the video resolution
|
||||
*/
|
||||
public String getResolution() {
|
||||
@ -64,8 +65,9 @@ public class VideoStream extends Stream {
|
||||
|
||||
/**
|
||||
* Check if the video is video only.
|
||||
*
|
||||
* <p>
|
||||
* Video only streams have no audio
|
||||
*
|
||||
* @return {@code true} if this stream is vid
|
||||
*/
|
||||
public boolean isVideoOnly() {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package org.schabi.newpipe.extractor.utils;
|
||||
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.MediaFormat;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ReCaptchaException;
|
||||
import org.schabi.newpipe.extractor.services.youtube.ItagItem;
|
||||
@ -109,11 +109,11 @@ public class DashMpdParser {
|
||||
* <p>
|
||||
* It has video, video only and audio streams and will only add to the list if it don't
|
||||
* find a similar stream in the respective lists (calling {@link Stream#equalStats}).
|
||||
*
|
||||
* <p>
|
||||
* Info about dash MPD can be found here
|
||||
* @see <a href="https://www.brendanlong.com/the-structure-of-an-mpeg-dash-mpd.html">www.brendanlog.com</a>
|
||||
*
|
||||
* @param streamInfo where the parsed streams will be added
|
||||
* @see <a href="https://www.brendanlong.com/the-structure-of-an-mpeg-dash-mpd.html">www.brendanlog.com</a>
|
||||
*/
|
||||
public static ParserResult getStreams(final StreamInfo streamInfo)
|
||||
throws DashMpdParsingException, ReCaptchaException {
|
||||
|
@ -5,7 +5,6 @@ import org.schabi.newpipe.extractor.InfoItem;
|
||||
import org.schabi.newpipe.extractor.InfoItemsCollector;
|
||||
import org.schabi.newpipe.extractor.ListExtractor;
|
||||
import org.schabi.newpipe.extractor.ListExtractor.InfoItemsPage;
|
||||
import org.schabi.newpipe.extractor.comments.CommentsInfo;
|
||||
import org.schabi.newpipe.extractor.stream.StreamExtractor;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfo;
|
||||
|
||||
|
@ -1,16 +1,14 @@
|
||||
package org.schabi.newpipe.extractor.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class JsonUtils {
|
||||
|
||||
|
@ -1,5 +1,10 @@
|
||||
package org.schabi.newpipe.extractor.utils;
|
||||
|
||||
import org.nibor.autolink.LinkExtractor;
|
||||
import org.nibor.autolink.LinkSpan;
|
||||
import org.nibor.autolink.LinkType;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.ArrayList;
|
||||
@ -9,11 +14,6 @@ import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.nibor.autolink.LinkExtractor;
|
||||
import org.nibor.autolink.LinkSpan;
|
||||
import org.nibor.autolink.LinkType;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
||||
/*
|
||||
* Created by Christian Schabesberger on 02.02.16.
|
||||
*
|
||||
|
@ -1,13 +1,13 @@
|
||||
package org.schabi.newpipe.extractor.utils;
|
||||
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.List;
|
||||
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
||||
public class Utils {
|
||||
|
||||
private Utils() {
|
||||
@ -35,6 +35,7 @@ public class Utils {
|
||||
* <li>1.23K -> 1230</li>
|
||||
* <li>1.23M -> 1230000</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param numberWord string to be converted to a long
|
||||
* @return a long
|
||||
* @throws NumberFormatException
|
||||
|
@ -1,15 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmpty;
|
||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestGetPageInNewExtractor;
|
||||
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestMoreItems;
|
||||
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestRelatedItems;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
@ -20,6 +10,12 @@ import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.services.BaseChannelExtractorTest;
|
||||
import org.schabi.newpipe.extractor.services.peertube.extractors.PeertubeChannelExtractor;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmpty;
|
||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
import static org.schabi.newpipe.extractor.services.DefaultTests.*;
|
||||
|
||||
/**
|
||||
* Test for {@link PeertubeChannelExtractor}
|
||||
*/
|
||||
|
@ -1,8 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.DownloaderTestImpl;
|
||||
@ -10,6 +7,9 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.services.peertube.linkHandler.PeertubeChannelLinkHandlerFactory;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Test for {@link PeertubeChannelLinkHandlerFactory}
|
||||
*/
|
||||
|
@ -1,12 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.jsoup.helper.StringUtil;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
@ -18,6 +11,13 @@ import org.schabi.newpipe.extractor.comments.CommentsInfoItem;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.services.peertube.extractors.PeertubeCommentsExtractor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
|
||||
public class PeertubeCommentsExtractorTest {
|
||||
|
||||
private static PeertubeCommentsExtractor extractor;
|
||||
|
@ -1,8 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.DownloaderTestImpl;
|
||||
@ -10,6 +7,9 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.services.peertube.linkHandler.PeertubeCommentsLinkHandlerFactory;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Test for {@link PeertubeCommentsLinkHandlerFactory}
|
||||
*/
|
||||
|
@ -1,8 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.DownloaderTestImpl;
|
||||
@ -10,6 +7,9 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.services.peertube.linkHandler.PeertubePlaylistLinkHandlerFactory;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Test for {@link PeertubePlaylistLinkHandlerFactory}
|
||||
*/
|
||||
|
@ -1,19 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube;
|
||||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
@ -26,6 +12,18 @@ import org.schabi.newpipe.extractor.stream.StreamExtractor;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector;
|
||||
import org.schabi.newpipe.extractor.stream.StreamType;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
|
||||
/**
|
||||
* Test for {@link StreamExtractor}
|
||||
*/
|
||||
|
@ -1,8 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.DownloaderTestImpl;
|
||||
@ -10,6 +7,9 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.services.peertube.linkHandler.PeertubeStreamLinkHandlerFactory;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Test for {@link PeertubeStreamLinkHandlerFactory}
|
||||
*/
|
||||
|
@ -1,13 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.DownloaderTestImpl;
|
||||
@ -17,6 +9,11 @@ import org.schabi.newpipe.extractor.kiosk.KioskExtractor;
|
||||
import org.schabi.newpipe.extractor.services.peertube.extractors.PeertubeTrendingExtractor;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
|
||||
/**
|
||||
* Test for {@link PeertubeTrendingExtractor}
|
||||
*/
|
||||
|
@ -1,9 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.DownloaderTestImpl;
|
||||
@ -12,6 +8,10 @@ import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
|
||||
import org.schabi.newpipe.extractor.services.peertube.linkHandler.PeertubeTrendingLinkHandlerFactory;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
|
||||
/**
|
||||
* Test for {@link PeertubeTrendingLinkHandlerFactory}
|
||||
*/
|
||||
|
@ -1,12 +1,12 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.search;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
import org.schabi.newpipe.extractor.ListExtractor;
|
||||
import org.schabi.newpipe.extractor.services.peertube.extractors.PeertubeSearchExtractor;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Test for {@link PeertubeSearchExtractor}
|
||||
*/
|
||||
|
@ -1,10 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.search;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.DownloaderTestImpl;
|
||||
@ -15,6 +10,9 @@ import org.schabi.newpipe.extractor.services.peertube.PeertubeInstance;
|
||||
import org.schabi.newpipe.extractor.services.peertube.extractors.PeertubeSearchExtractor;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
|
||||
/**
|
||||
* Test for {@link PeertubeSearchExtractor}
|
||||
*/
|
||||
|
@ -1,12 +1,12 @@
|
||||
package org.schabi.newpipe.extractor.services.peertube.search;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.extractor.services.peertube.PeertubeInstance;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
|
||||
|
||||
public class PeertubeSearchQHTest {
|
||||
|
||||
@BeforeClass
|
||||
|
@ -1,7 +1,6 @@
|
||||
package org.schabi.newpipe.extractor.services.soundcloud;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.DownloaderTestImpl;
|
||||
import org.schabi.newpipe.extractor.ListExtractor;
|
||||
|
@ -1,10 +1,12 @@
|
||||
package org.schabi.newpipe.extractor.services.soundcloud;
|
||||
|
||||
import org.junit.*;
|
||||
import org.junit.Assert;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.DownloaderTestImpl;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class SoundcloudParsingHelperTest {
|
||||
@BeforeClass
|
||||
|
@ -1,14 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.youtube;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestGetPageInNewExtractor;
|
||||
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestMoreItems;
|
||||
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestRelatedItems;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.DownloaderTestImpl;
|
||||
@ -16,10 +7,14 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.ServiceList;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.localization.Localization;
|
||||
import org.schabi.newpipe.extractor.services.BaseChannelExtractorTest;
|
||||
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeChannelExtractor;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||
import static org.schabi.newpipe.extractor.services.DefaultTests.*;
|
||||
|
||||
/**
|
||||
* Test for {@link ChannelExtractor}
|
||||
*/
|
||||
@ -489,7 +484,6 @@ public class YoutubeChannelExtractorTest {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static class RandomChannel implements BaseChannelExtractorTest {
|
||||
private static YoutubeChannelExtractor extractor;
|
||||
|
||||
|
@ -3,10 +3,8 @@ package org.schabi.newpipe.extractor.services.youtube.search;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
import org.schabi.newpipe.extractor.ListExtractor;
|
||||
import org.schabi.newpipe.extractor.services.BaseListExtractorTest;
|
||||
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeSearchExtractor;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
||||
|
@ -6,7 +6,6 @@ import org.schabi.newpipe.DownloaderTestImpl;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
import org.schabi.newpipe.extractor.ListExtractor;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelInfoItem;
|
||||
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeSearchExtractor;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||
|
@ -1,15 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.services.youtube.search;
|
||||
|
||||
import static java.util.Collections.singletonList;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.DownloaderTestImpl;
|
||||
@ -19,6 +9,14 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeSearchExtractor;
|
||||
import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeSearchQueryHandlerFactory;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static java.util.Collections.singletonList;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||
|
||||
public class YoutubeSearchPagingTest {
|
||||
private static ListExtractor.InfoItemsPage<InfoItem> page1;
|
||||
private static ListExtractor.InfoItemsPage<InfoItem> page2;
|
||||
|
@ -1,14 +1,11 @@
|
||||
package org.schabi.newpipe.extractor.services.youtube.search;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeSearchQueryHandlerFactory;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||
import static org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeSearchQueryHandlerFactory.CHANNELS;
|
||||
import static org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeSearchQueryHandlerFactory.PLAYLISTS;
|
||||
import static org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeSearchQueryHandlerFactory.VIDEOS;
|
||||
import static org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeSearchQueryHandlerFactory.*;
|
||||
|
||||
public class YoutubeSearchQHTest {
|
||||
|
||||
|
@ -19,7 +19,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import static java.util.Objects.*;
|
||||
import static java.util.Objects.requireNonNull;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||
|
@ -1,17 +1,16 @@
|
||||
package org.schabi.newpipe.extractor.utils;
|
||||
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import com.grack.nanojson.JsonParser;
|
||||
import com.grack.nanojson.JsonParserException;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
||||
public class JsonUtilsTest {
|
||||
|
Loading…
x
Reference in New Issue
Block a user