Allow PlayLists with missing uploader
This supports PR 2724 in NewPipe
This commit is contained in:
parent
43b54ccc3c
commit
cdf41b868c
|
@ -45,6 +45,9 @@ public class PlaylistInfo extends ListInfo<StreamInfoItem> {
|
||||||
extractor.getServiceId(),
|
extractor.getServiceId(),
|
||||||
extractor.getLinkHandler(),
|
extractor.getLinkHandler(),
|
||||||
extractor.getName());
|
extractor.getName());
|
||||||
|
// collect uploader extraction failures until we are sure this is not
|
||||||
|
// just a playlist without an uploader
|
||||||
|
List<Throwable> uploaderParsingErros = new ArrayList<Throwable>(3);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
info.setOriginalUrl(extractor.getOriginalUrl());
|
info.setOriginalUrl(extractor.getOriginalUrl());
|
||||||
|
@ -64,23 +67,31 @@ public class PlaylistInfo extends ListInfo<StreamInfoItem> {
|
||||||
try {
|
try {
|
||||||
info.setUploaderUrl(extractor.getUploaderUrl());
|
info.setUploaderUrl(extractor.getUploaderUrl());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
info.addError(e);
|
info.setUploaderUrl("");
|
||||||
|
uploaderParsingErros.add(e);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
info.setUploaderName(extractor.getUploaderName());
|
info.setUploaderName(extractor.getUploaderName());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
info.addError(e);
|
info.setUploaderName("");
|
||||||
|
uploaderParsingErros.add(e);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
info.setUploaderAvatarUrl(extractor.getUploaderAvatarUrl());
|
info.setUploaderAvatarUrl(extractor.getUploaderAvatarUrl());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
info.addError(e);
|
info.setUploaderAvatarUrl("");
|
||||||
|
uploaderParsingErros.add(e);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
info.setBannerUrl(extractor.getBannerUrl());
|
info.setBannerUrl(extractor.getBannerUrl());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
info.addError(e);
|
info.addError(e);
|
||||||
}
|
}
|
||||||
|
// do not fail if everything but the uploader infos could be collected
|
||||||
|
if (uploaderParsingErros.size() > 0 &&
|
||||||
|
(!info.getErrors().isEmpty() || uploaderParsingErros.size() < 3)) {
|
||||||
|
info.addAllErrors(uploaderParsingErros);
|
||||||
|
}
|
||||||
|
|
||||||
final InfoItemsPage<StreamInfoItem> itemsPage = ExtractorHelper.getItemsPageOrLogError(info, extractor);
|
final InfoItemsPage<StreamInfoItem> itemsPage = ExtractorHelper.getItemsPageOrLogError(info, extractor);
|
||||||
info.setRelatedItems(itemsPage.getItems());
|
info.setRelatedItems(itemsPage.getItems());
|
||||||
|
|
Loading…
Reference in New Issue