[YouTube] Move Trending kiosk to kiosk package, add deprecation comment

Trending is still working at the time this commit is made, it has been
just removed from the interface.

Also remove getInstance method of YoutubeTrendingLinkHandlerFactory to
make the INSTANCE static field public, for consistency with other
kiosks of the service.
pull/1354/head
AudricV 2025-07-26 23:39:10 +02:00
rodzic 21c3aad320
commit 9f7690823d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DA92EC7905614198
4 zmienionych plików z 7 dodań i 9 usunięć

Wyświetl plik

@ -35,7 +35,7 @@ import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeSearchExt
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor; import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor;
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeSubscriptionExtractor; import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeSubscriptionExtractor;
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeSuggestionExtractor; import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeSuggestionExtractor;
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeTrendingExtractor; import org.schabi.newpipe.extractor.services.youtube.extractors.kiosk.YoutubeTrendingExtractor;
import org.schabi.newpipe.extractor.services.youtube.extractors.kiosk.YoutubeLiveExtractor; import org.schabi.newpipe.extractor.services.youtube.extractors.kiosk.YoutubeLiveExtractor;
import org.schabi.newpipe.extractor.services.youtube.extractors.kiosk.YoutubeTrendingGamingVideosExtractor; import org.schabi.newpipe.extractor.services.youtube.extractors.kiosk.YoutubeTrendingGamingVideosExtractor;
import org.schabi.newpipe.extractor.services.youtube.extractors.kiosk.YoutubeTrendingMoviesAndShowsTrailersExtractor; import org.schabi.newpipe.extractor.services.youtube.extractors.kiosk.YoutubeTrendingMoviesAndShowsTrailersExtractor;
@ -164,7 +164,7 @@ public class YoutubeService extends StreamingService {
@Override @Override
public KioskList getKioskList() throws ExtractionException { public KioskList getKioskList() throws ExtractionException {
final KioskList list = new KioskList(this); final KioskList list = new KioskList(this);
final ListLinkHandlerFactory trendingLHF = YoutubeTrendingLinkHandlerFactory.getInstance(); final ListLinkHandlerFactory trendingLHF = YoutubeTrendingLinkHandlerFactory.INSTANCE;
final ListLinkHandlerFactory runningLivesLHF = final ListLinkHandlerFactory runningLivesLHF =
YoutubeLiveLinkHandlerFactory.INSTANCE; YoutubeLiveLinkHandlerFactory.INSTANCE;
final ListLinkHandlerFactory trendingPodcastsEpisodesLHF = final ListLinkHandlerFactory trendingPodcastsEpisodesLHF =
@ -218,6 +218,7 @@ public class YoutubeService extends StreamingService {
trendingMusicLHF, trendingMusicLHF,
YoutubeTrendingMusicLinkHandlerFactory.KIOSK_ID YoutubeTrendingMusicLinkHandlerFactory.KIOSK_ID
); );
// Deprecated (i.e. removed from the interface of YouTube) since July 21, 2025
list.addKioskEntry( list.addKioskEntry(
(streamingService, url, id) -> new YoutubeTrendingExtractor( (streamingService, url, id) -> new YoutubeTrendingExtractor(
YoutubeService.this, YoutubeService.this,

Wyświetl plik

@ -18,7 +18,7 @@
* along with NewPipe Extractor. If not, see <https://www.gnu.org/licenses/>. * along with NewPipe Extractor. If not, see <https://www.gnu.org/licenses/>.
*/ */
package org.schabi.newpipe.extractor.services.youtube.extractors; package org.schabi.newpipe.extractor.services.youtube.extractors.kiosk;
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getJsonPostResponse; import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getJsonPostResponse;
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getTextAtKey; import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getTextAtKey;
@ -36,6 +36,7 @@ import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.kiosk.KioskExtractor; import org.schabi.newpipe.extractor.kiosk.KioskExtractor;
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler; import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
import org.schabi.newpipe.extractor.localization.TimeAgoParser; import org.schabi.newpipe.extractor.localization.TimeAgoParser;
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamInfoItemExtractor;
import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector; import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector;

Wyświetl plik

@ -33,16 +33,12 @@ import java.util.List;
public final class YoutubeTrendingLinkHandlerFactory extends ListLinkHandlerFactory { public final class YoutubeTrendingLinkHandlerFactory extends ListLinkHandlerFactory {
private static final YoutubeTrendingLinkHandlerFactory INSTANCE = public static final YoutubeTrendingLinkHandlerFactory INSTANCE =
new YoutubeTrendingLinkHandlerFactory(); new YoutubeTrendingLinkHandlerFactory();
private YoutubeTrendingLinkHandlerFactory() { private YoutubeTrendingLinkHandlerFactory() {
} }
public static YoutubeTrendingLinkHandlerFactory getInstance() {
return INSTANCE;
}
public String getUrl(final String id, public String getUrl(final String id,
final List<String> contentFilters, final List<String> contentFilters,
final String sortFilter) final String sortFilter)

Wyświetl plik

@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test;
import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.services.BaseListExtractorTest; import org.schabi.newpipe.extractor.services.BaseListExtractorTest;
import org.schabi.newpipe.extractor.services.DefaultSimpleExtractorTest; import org.schabi.newpipe.extractor.services.DefaultSimpleExtractorTest;
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeTrendingExtractor; import org.schabi.newpipe.extractor.services.youtube.extractors.kiosk.YoutubeTrendingExtractor;
public class YoutubeKioskExtractorTest { public class YoutubeKioskExtractorTest {