Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump org.nibor.autolink:autolink from 0.10.0 to 0.11.0 #34

Open
wants to merge 34 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
420620c
[YouTube] Make non-extraction of videoPrimaryInfoRenderer and/or vide…
AudricV Nov 4, 2022
684b6c1
[YouTube] Add a StreamExtractor test for a video without visual metadata
AudricV Nov 4, 2022
3972750
[YouTube] Add mocks for YoutubeStreamExtractorDefaultTest.NoVisualMet…
AudricV Nov 4, 2022
94ae596
[YouTube] Switch to new search suggestion domain and improve error ha…
AudricV Oct 3, 2022
51c2d2b
[YouTube] Improve YoutubeSuggestionExtractorTest
AudricV Oct 3, 2022
2981bef
Fallback to old search method if new one fails.
FireMasterK Nov 15, 2022
793b0c4
fix: support richGridRenderer on channel page
Theta-Dev Oct 12, 2022
5b1753f
feat: add tab support to channel extractor
Theta-Dev Oct 22, 2022
e2aab61
feat: add channel tabs
Theta-Dev Oct 23, 2022
963c5c6
fix: handle unsupported content, hide tab bar with < 2 tabs
Theta-Dev Oct 23, 2022
e8284e3
feat: prettier channel info page
Theta-Dev Oct 23, 2022
2a55931
feat: add album tab
Theta-Dev Oct 23, 2022
61a42c3
feat: add visitor data config option
Theta-Dev Oct 23, 2022
6285978
feat: add tab support for Peertube
Theta-Dev Oct 23, 2022
875fc6e
feat: add tab support for Soundcloud
Theta-Dev Oct 23, 2022
4a3f00e
fix: Peertube playlist urls
Theta-Dev Oct 23, 2022
23eac46
fix: checkstyle errors
Theta-Dev Oct 24, 2022
5e76f14
fix: store YouTube visitor data for channel tabs
Theta-Dev Oct 25, 2022
d5b438a
feat: add Bandcamp album tab
Theta-Dev Oct 25, 2022
1a07b38
test: add channel tab extractor tests
Theta-Dev Oct 25, 2022
6500e56
fix: change playlist tab parameter to include YTM albums
Theta-Dev Nov 2, 2022
eb88514
fix: NPE when extracting YT stream items without duration
Theta-Dev Nov 2, 2022
96e8daf
fix: channel shorts duration parsing
Theta-Dev Nov 2, 2022
66f884f
fix: channel short upload date parsing
Theta-Dev Nov 3, 2022
ac2a74e
refactor: API changes
Theta-Dev Nov 4, 2022
547e4d2
fix: support new PlaylistInfoItem interface
Theta-Dev Nov 4, 2022
de3b774
fix: rename channel tab LIVE to LIVESTREAMS
Theta-Dev Nov 4, 2022
7adec37
fix: link handler urls for tabs
Theta-Dev Nov 4, 2022
509edec
fix: update mock data
Theta-Dev Nov 4, 2022
50b438d
fix: some dead import errors from rebasing
FireMasterK Nov 15, 2022
b0e4bb4
Patch for Piped.
FireMasterK Mar 30, 2022
15f4524
Parallelize YouTubeStreamExtractor with a ExecutorService.
FireMasterK Sep 7, 2022
67d7323
Fixes for LazyString parsing.
FireMasterK Mar 17, 2023
bbb762a
build(deps): bump org.nibor.autolink:autolink from 0.10.0 to 0.11.0
dependabot[bot] Mar 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ allprojects {
}

ext {
nanojsonVersion = "1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751"
nanojsonVersion = "01934924442edda6952f3bedf80ba9e969cba8bc"
spotbugsVersion = "4.7.3"
junitVersion = "5.9.1"
checkstyleVersion = "9.3" // do not use latest version (10.0) as it requires compile JDK 11
Expand Down
4 changes: 2 additions & 2 deletions extractor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ checkstyleTest {
dependencies {
implementation project(':timeago-parser')

implementation "com.github.TeamNewPipe:nanojson:$nanojsonVersion"
implementation "com.github.FireMasterK:nanojson:$nanojsonVersion"
implementation 'org.jsoup:jsoup:1.15.3'
implementation "com.github.spotbugs:spotbugs-annotations:$spotbugsVersion"
implementation 'org.nibor.autolink:autolink:0.10.0'
implementation 'org.nibor.autolink:autolink:0.11.0'

// do not upgrade to 1.7.14, since in 1.7.14 Rhino uses the `SourceVersion` class, which is not
// available on Android (even when using desugaring), and `NoClassDefFoundError` is thrown
Expand Down
19 changes: 19 additions & 0 deletions extractor/src/main/java/org/schabi/newpipe/extractor/NewPipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import org.schabi.newpipe.extractor.localization.Localization;

import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand All @@ -38,6 +40,8 @@ public final class NewPipe {
private static Localization preferredLocalization;
private static ContentCountry preferredContentCountry;

private static ExecutorService executorService;

private NewPipe() {
}

Expand All @@ -51,9 +55,15 @@ public static void init(final Downloader d, final Localization l) {
}

public static void init(final Downloader d, final Localization l, final ContentCountry c) {
init(d, l, c, Executors.newCachedThreadPool());
}

public static void init(final Downloader d, final Localization l, final ContentCountry c,
final ExecutorService e) {
downloader = d;
preferredLocalization = l;
preferredContentCountry = c;
executorService = e;
}

public static Downloader getDownloader() {
Expand Down Expand Up @@ -132,4 +142,13 @@ public static ContentCountry getPreferredContentCountry() {
public static void setPreferredContentCountry(final ContentCountry preferredContentCountry) {
NewPipe.preferredContentCountry = preferredContentCountry;
}

@Nonnull
public static ExecutorService getExecutorService() {
return executorService;
}

public static void setExecutorService(final ExecutorService executorService) {
NewPipe.executorService = executorService;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.schabi.newpipe.extractor;

import org.schabi.newpipe.extractor.channel.ChannelExtractor;
import org.schabi.newpipe.extractor.channel.ChannelTabExtractor;
import org.schabi.newpipe.extractor.comments.CommentsExtractor;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.exceptions.ParsingException;
Expand Down Expand Up @@ -57,7 +58,8 @@ public static class ServiceInfo {

/**
* Creates a new instance of a ServiceInfo
* @param name the name of the service
*
* @param name the name of the service
* @param mediaCapabilities the type of media this service can handle
*/
public ServiceInfo(final String name, final List<MediaCapability> mediaCapabilities) {
Expand Down Expand Up @@ -97,8 +99,9 @@ public enum LinkType {
* If you Implement one do not set id within your implementation of this extractor, instead
* set the id when you put the extractor into {@link ServiceList}
* All other parameters can be set directly from the overriding constructor.
* @param id the number of the service to identify him within the NewPipe frontend
* @param name the name of the service
*
* @param id the number of the service to identify him within the NewPipe frontend
* @param name the name of the service
* @param capabilities the type of media this service can handle
*/
public StreamingService(final int id,
Expand Down Expand Up @@ -129,29 +132,42 @@ public String toString() {

/**
* Must return a new instance of an implementation of LinkHandlerFactory for streams.
*
* @return an instance of a LinkHandlerFactory for streams
*/
public abstract LinkHandlerFactory getStreamLHFactory();

/**
* Must return a new instance of an implementation of ListLinkHandlerFactory for channels.
* If support for channels is not given null must be returned.
*
* @return an instance of a ListLinkHandlerFactory for channels or null
*/
public abstract ListLinkHandlerFactory getChannelLHFactory();

/**
* Must return a new instance of an implementation of ListLinkHandlerFactory for channel tabs.
* If support for channel tabs is not given null must be returned.
*
* @return an instance of a ListLinkHandlerFactory for channels or null
*/
public abstract ListLinkHandlerFactory getChannelTabLHFactory();

/**
* Must return a new instance of an implementation of ListLinkHandlerFactory for playlists.
* If support for playlists is not given null must be returned.
*
* @return an instance of a ListLinkHandlerFactory for playlists or null
*/
public abstract ListLinkHandlerFactory getPlaylistLHFactory();

/**
* Must return an instance of an implementation of SearchQueryHandlerFactory.
*
* @return an instance of a SearchQueryHandlerFactory
*/
public abstract SearchQueryHandlerFactory getSearchQHFactory();

public abstract ListLinkHandlerFactory getCommentsLHFactory();

/*//////////////////////////////////////////////////////////////////////////
Expand All @@ -160,19 +176,22 @@ public String toString() {

/**
* Must create a new instance of a SearchExtractor implementation.
*
* @param queryHandler specifies the keyword lock for, and the filters which should be applied.
* @return a new SearchExtractor instance
*/
public abstract SearchExtractor getSearchExtractor(SearchQueryHandler queryHandler);

/**
* Must create a new instance of a SuggestionExtractor implementation.
*
* @return a new SuggestionExtractor instance
*/
public abstract SuggestionExtractor getSuggestionExtractor();

/**
* Outdated or obsolete. null can be returned.
*
* @return just null
*/
public abstract SubscriptionExtractor getSubscriptionExtractor();
Expand All @@ -192,20 +211,32 @@ public FeedExtractor getFeedExtractor(final String url) throws ExtractionExcepti

/**
* Must create a new instance of a KioskList implementation.
*
* @return a new KioskList instance
*/
public abstract KioskList getKioskList() throws ExtractionException;

/**
* Must create a new instance of a ChannelExtractor implementation.
*
* @param linkHandler is pointing to the channel which should be handled by this new instance.
* @return a new ChannelExtractor
*/
public abstract ChannelExtractor getChannelExtractor(ListLinkHandler linkHandler)
throws ExtractionException;

/**
* Must create a new instance of a ChannelTabExtractor implementation.
*
* @param linkHandler is pointing to the channel which should be handled by this new instance.
* @return a new ChannelTabExtractor
*/
public abstract ChannelTabExtractor getChannelTabExtractor(ListLinkHandler linkHandler)
throws ExtractionException;

/**
* Must crete a new instance of a PlaylistExtractor implementation.
*
* @param linkHandler is pointing to the playlist which should be handled by this new instance.
* @return a new PlaylistExtractor
*/
Expand All @@ -214,6 +245,7 @@ public abstract PlaylistExtractor getPlaylistExtractor(ListLinkHandler linkHandl

/**
* Must create a new instance of a StreamExtractor implementation.
*
* @param linkHandler is pointing to the stream which should be handled by this new instance.
* @return a new StreamExtractor
*/
Expand Down Expand Up @@ -242,6 +274,19 @@ public ChannelExtractor getChannelExtractor(final String id,
.fromQuery(id, contentFilter, sortFilter));
}

public ChannelTabExtractor getChannelTabExtractorFromId(final String id, final String tab)
throws ExtractionException {
return getChannelTabExtractor(getChannelTabLHFactory().fromQuery(
id, Collections.singletonList(tab), ""));
}

public ChannelTabExtractor getChannelTabExtractorFromId(final String id, final String tab,
final String baseUrl)
throws ExtractionException {
return getChannelTabExtractor(getChannelTabLHFactory().fromQuery(
id, Collections.singletonList(tab), "", baseUrl));
}

public PlaylistExtractor getPlaylistExtractor(final String id,
final List<String> contentFilter,
final String sortFilter)
Expand Down Expand Up @@ -284,6 +329,7 @@ public CommentsExtractor getCommentsExtractor(final String url) throws Extractio

/**
* Figures out where the link is pointing to (a channel, a video, a playlist, etc.)
*
* @param url the url on which it should be decided of which link type it is
* @return the link type of url
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
import org.schabi.newpipe.extractor.stream.StreamInfoItem;

import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;

/*
* Created by Christian Schabesberger on 25.07.16.
*
Expand Down Expand Up @@ -43,5 +47,12 @@ public ChannelExtractor(final StreamingService service, final ListLinkHandler li
public abstract String getParentChannelUrl() throws ParsingException;
public abstract String getParentChannelAvatarUrl() throws ParsingException;
public abstract boolean isVerified() throws ParsingException;

@Nonnull
public List<ListLinkHandler> getTabs() throws ParsingException {
return Collections.emptyList();
}
@Nonnull
public List<String> getTags() throws ParsingException {
return Collections.emptyList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import org.schabi.newpipe.extractor.utils.ExtractorHelper;

import javax.annotation.Nonnull;
import java.io.IOException;
import java.util.Collections;
import java.util.List;

/*
* Created by Christian Schabesberger on 31.07.16.
Expand Down Expand Up @@ -130,6 +133,17 @@ public static ChannelInfo getInfo(final ChannelExtractor extractor)
info.addError(e);
}

try {
info.setTabs(extractor.getTabs());
} catch (final Exception e) {
info.addError(e);
}
try {
info.setTags(extractor.getTags());
} catch (final Exception e) {
info.addError(e);
}

return info;
}

Expand All @@ -144,6 +158,10 @@ public static ChannelInfo getInfo(final ChannelExtractor extractor)
private String[] donationLinks;
private boolean verified;

private List<ListLinkHandler> tabs = Collections.emptyList();

private List<String> tags = Collections.emptyList();

public String getParentChannelName() {
return parentChannelName;
}
Expand Down Expand Up @@ -223,4 +241,22 @@ public boolean isVerified() {
public void setVerified(final boolean verified) {
this.verified = verified;
}

@Nonnull
public List<ListLinkHandler> getTabs() {
return tabs;
}

public void setTabs(@Nonnull final List<ListLinkHandler> tabs) {
this.tabs = tabs;
}

@Nonnull
public List<String> getTags() {
return tags;
}

public void setTags(@Nonnull final List<String> tags) {
this.tags = tags;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.schabi.newpipe.extractor.channel;

import org.schabi.newpipe.extractor.InfoItem;
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 javax.annotation.Nonnull;

public abstract class ChannelTabExtractor extends ListExtractor<InfoItem> {

public ChannelTabExtractor(final StreamingService service,
final ListLinkHandler linkHandler) {
super(service, linkHandler);
}

public String getTab() {
return getLinkHandler().getContentFilters().get(0);
}

@Nonnull
@Override
public String getName() throws ParsingException {
return getTab();
}
}
Loading