mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-28 07:50:34 +05:30
[YouTube] Detect new account termination messages
This commit is contained in:
parent
73f0c63a9d
commit
aaccfecda8
@ -1620,8 +1620,10 @@ public final class YoutubeParsingHelper {
|
|||||||
final String alertText = getTextFromObject(alertRenderer.getObject("text"));
|
final String alertText = getTextFromObject(alertRenderer.getObject("text"));
|
||||||
final String alertType = alertRenderer.getString("type", "");
|
final String alertType = alertRenderer.getString("type", "");
|
||||||
if (alertType.equalsIgnoreCase("ERROR")) {
|
if (alertType.equalsIgnoreCase("ERROR")) {
|
||||||
if (alertText != null && alertText.contains("This account has been terminated")) {
|
if (alertText != null
|
||||||
if (alertText.contains("violation") || alertText.contains("violating")
|
&& (alertText.contains("This account has been terminated")
|
||||||
|
|| alertText.contains("This channel was removed"))) {
|
||||||
|
if (alertText.matches(".*violat(ed|ion|ing).*")
|
||||||
|| alertText.contains("infringement")) {
|
|| alertText.contains("infringement")) {
|
||||||
// Possible error messages:
|
// Possible error messages:
|
||||||
// "This account has been terminated for a violation of YouTube's Terms of
|
// "This account has been terminated for a violation of YouTube's Terms of
|
||||||
@ -1643,6 +1645,7 @@ public final class YoutubeParsingHelper {
|
|||||||
// the user posted."
|
// the user posted."
|
||||||
// "This account has been terminated because it is linked to an account that
|
// "This account has been terminated because it is linked to an account that
|
||||||
// received multiple third-party claims of copyright infringement."
|
// received multiple third-party claims of copyright infringement."
|
||||||
|
// "This channel was removed because it violated our Community Guidelines."
|
||||||
throw new AccountTerminatedException(alertText,
|
throw new AccountTerminatedException(alertText,
|
||||||
AccountTerminatedException.Reason.VIOLATION);
|
AccountTerminatedException.Reason.VIOLATION);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user