Merge pull request #980 from TeamNewPipe/fix/yt/unavailable
[YouTube] Fix extracting the detailed error message for unavailable streams
This commit is contained in:
@@ -943,7 +943,8 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status.equalsIgnoreCase("unplayable") && reason != null) {
|
if ((status.equalsIgnoreCase("unplayable") || status.equalsIgnoreCase("error"))
|
||||||
|
&& reason != null) {
|
||||||
if (reason.contains("Music Premium")) {
|
if (reason.contains("Music Premium")) {
|
||||||
throw new YoutubeMusicPremiumContentException();
|
throw new YoutubeMusicPremiumContentException();
|
||||||
}
|
}
|
||||||
@@ -963,6 +964,10 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||||||
if (detailedErrorMessage != null && detailedErrorMessage.contains("country")) {
|
if (detailedErrorMessage != null && detailedErrorMessage.contains("country")) {
|
||||||
throw new GeographicRestrictionException(
|
throw new GeographicRestrictionException(
|
||||||
"This video is not available in client's country.");
|
"This video is not available in client's country.");
|
||||||
|
} else if (detailedErrorMessage != null) {
|
||||||
|
throw new ContentNotAvailableException(detailedErrorMessage);
|
||||||
|
} else {
|
||||||
|
throw new ContentNotAvailableException(reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user