Merge pull request #980 from TeamNewPipe/fix/yt/unavailable
[YouTube] Fix extracting the detailed error message for unavailable streams
This commit is contained in:
commit
1da0190056
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue