NewPipeExtractor/extractor/src/main/java/org/schabi/newpipe/extractor/ServiceList.java

68 lines
2.4 KiB
Java
Raw Normal View History

2017-03-01 18:47:52 +01:00
package org.schabi.newpipe.extractor;
import org.schabi.newpipe.extractor.services.bandcamp.BandcampService;
2018-12-23 14:59:26 +01:00
import org.schabi.newpipe.extractor.services.media_ccc.MediaCCCService;
2018-10-11 21:10:22 +02:00
import org.schabi.newpipe.extractor.services.peertube.PeertubeService;
import org.schabi.newpipe.extractor.services.soundcloud.SoundcloudService;
2017-08-06 22:20:15 +02:00
import org.schabi.newpipe.extractor.services.youtube.YoutubeService;
2017-03-01 18:47:52 +01:00
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
2018-11-10 10:50:13 +01:00
/*
* Copyright (C) Christian Schabesberger 2018 <chris.schabesberger@mailbox.org>
* ServiceList.java is part of NewPipe.
*
* NewPipe is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NewPipe is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
*/
2017-08-06 22:20:15 +02:00
/**
* A list of supported services.
2017-03-01 18:47:52 +01:00
*/
@SuppressWarnings({"ConstantName", "InnerAssignment"}) // keep unusual names and inner assignments
public final class ServiceList {
private ServiceList() {
//no instance
2017-08-06 22:20:15 +02:00
}
2017-03-01 18:47:52 +01:00
public static final YoutubeService YouTube;
public static final SoundcloudService SoundCloud;
2018-12-23 14:59:26 +01:00
public static final MediaCCCService MediaCCC;
2019-03-23 14:42:26 +01:00
public static final PeertubeService PeerTube;
2020-04-20 21:55:35 +02:00
public static final BandcampService Bandcamp;
2018-11-10 10:50:13 +01:00
/**
* When creating a new service, put this service in the end of this list,
* and give it the next free id.
*/
2019-03-07 22:39:05 +01:00
private static final List<StreamingService> SERVICES = Collections.unmodifiableList(
Arrays.asList(
YouTube = new YoutubeService(0),
2018-10-11 21:10:22 +02:00
SoundCloud = new SoundcloudService(1),
2019-03-23 14:42:26 +01:00
MediaCCC = new MediaCCCService(2),
PeerTube = new PeertubeService(3),
2020-04-20 21:55:35 +02:00
Bandcamp = new BandcampService(4)
));
/**
* Get all the supported services.
*
* @return a unmodifiable list of all the supported services
*/
public static List<StreamingService> all() {
return SERVICES;
2017-08-06 22:20:15 +02:00
}
2017-03-01 18:47:52 +01:00
}