Fix throwing correct reason.

This commit is contained in:
Kavin 2022-11-26 21:09:08 +00:00
parent 4680df0bdf
commit 5abea22225
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
1 changed files with 2 additions and 0 deletions

View File

@ -964,6 +964,8 @@ public class YoutubeStreamExtractor extends StreamExtractor {
if (detailedErrorMessage != null && detailedErrorMessage.contains("country")) {
throw new GeographicRestrictionException(
"This video is not available in client's country.");
} else if (detailedErrorMessage != null) {
throw new ContentNotAvailableException(detailedErrorMessage);
} else {
throw new ContentNotAvailableException(reason);
}