fix issue with originalUrl

This commit is contained in:
Christian Schabesberger 2018-12-23 21:52:40 +01:00
parent cf3ea22753
commit 50a17afc05
4 changed files with 22 additions and 2 deletions

View File

@ -27,7 +27,7 @@ public abstract class Info implements Serializable {
*
* @see Extractor#getOriginalUrl()
*/
private final String originalUrl;
private String originalUrl;
private final String name;
private final List<Throwable> errors = new ArrayList<>();
@ -62,6 +62,12 @@ public abstract class Info implements Serializable {
return getClass().getSimpleName() + "[url=\"" + url + "\"" + ifDifferentString + ", name=\"" + name + "\"]";
}
// if you use an api and want to handle the website url
// overriding original url is essential
public void setOriginalUrl(String url) {
originalUrl = url;
}
public int getServiceId() {
return serviceId;
}

View File

@ -61,7 +61,11 @@ public class ChannelInfo extends ListInfo<StreamInfoItem> {
extractor.getLinkHandler(),
extractor.getName());
try {
info.setOriginalUrl(extractor.getOriginalUrl());
} catch (Exception e) {
info.addError(e);
}
try {
info.setAvatarUrl(extractor.getAvatarUrl());
} catch (Exception e) {

View File

@ -47,6 +47,11 @@ public class PlaylistInfo extends ListInfo<StreamInfoItem> {
extractor.getLinkHandler(),
extractor.getName());
try {
info.setOriginalUrl(extractor.getOriginalUrl());
} catch (Exception e) {
info.addError(e);
}
try {
info.setStreamCount(extractor.getStreamCount());
} catch (Exception e) {

View File

@ -37,6 +37,11 @@ public class SearchInfo extends ListInfo<InfoItem> {
extractor.getLinkHandler(),
extractor.getSearchString());
try {
info.setOriginalUrl(extractor.getOriginalUrl());
} catch (Exception e) {
info.addError(e);
}
try {
info.searchSuggestion = extractor.getSearchSuggestion();
} catch (Exception e) {