2017-08-12 17:29:28 +02:00
|
|
|
package org.schabi.newpipe.extractor.kiosk;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Created by Christian Schabesberger on 12.08.17.
|
|
|
|
*
|
|
|
|
* Copyright (C) Christian Schabesberger 2017 <chris.schabesberger@mailbox.org>
|
|
|
|
* KioskExtractor.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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import org.schabi.newpipe.extractor.ListExtractor;
|
|
|
|
import org.schabi.newpipe.extractor.StreamingService;
|
|
|
|
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
|
|
|
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
public abstract class KioskExtractor extends ListExtractor {
|
2017-08-14 12:48:51 +02:00
|
|
|
private String contentCountry = null;
|
2017-09-23 17:14:21 +02:00
|
|
|
private String type = null;
|
2017-08-14 12:48:51 +02:00
|
|
|
|
|
|
|
public KioskExtractor(StreamingService streamingService,
|
|
|
|
String url,
|
2017-09-23 17:14:21 +02:00
|
|
|
String nextStreamsUrl,
|
|
|
|
String type)
|
2017-08-12 17:29:28 +02:00
|
|
|
throws IOException, ExtractionException {
|
|
|
|
super(streamingService, url, nextStreamsUrl);
|
2017-08-14 12:48:51 +02:00
|
|
|
this.contentCountry = contentCountry;
|
2017-09-23 17:14:21 +02:00
|
|
|
this.type = type;
|
2017-08-14 12:48:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* For certain Websites the content of a kiosk will be different depending
|
|
|
|
* on the country you want to poen the website in. Therefore you should
|
|
|
|
* set the contentCountry.
|
|
|
|
* @param contentCountry Set the country decoded as Country Code: http://www.1728.org/countries.htm
|
|
|
|
*/
|
|
|
|
public void setContentCountry(String contentCountry) {
|
|
|
|
this.contentCountry = contentCountry;
|
2017-08-12 17:29:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the type of the kiosk.
|
|
|
|
* eg. Trending, Top & Hot, Top last 24 hours
|
|
|
|
* @return type of kiosk
|
|
|
|
*/
|
2017-09-23 17:14:21 +02:00
|
|
|
public String getType() throws ParsingException {
|
|
|
|
return type;
|
|
|
|
}
|
2017-08-12 17:29:28 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getId() throws ParsingException {
|
|
|
|
return getType();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getName() throws ParsingException {
|
|
|
|
return getType();
|
|
|
|
}
|
2017-08-14 12:48:51 +02:00
|
|
|
|
|
|
|
public String getContentCountry() {
|
|
|
|
return contentCountry;
|
|
|
|
}
|
2017-08-12 17:29:28 +02:00
|
|
|
}
|