fix issue with originalUrl
This commit is contained in:
parent
cf3ea22753
commit
50a17afc05
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue