Skip to content

Commit aaccfec

Browse files
committed
[YouTube] Detect new account termination messages
1 parent 73f0c63 commit aaccfec

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,8 +1620,10 @@ public static void defaultAlertsCheck(@Nonnull final JsonObject initialData)
16201620
final String alertText = getTextFromObject(alertRenderer.getObject("text"));
16211621
final String alertType = alertRenderer.getString("type", "");
16221622
if (alertType.equalsIgnoreCase("ERROR")) {
1623-
if (alertText != null && alertText.contains("This account has been terminated")) {
1624-
if (alertText.contains("violation") || alertText.contains("violating")
1623+
if (alertText != null
1624+
&& (alertText.contains("This account has been terminated")
1625+
|| alertText.contains("This channel was removed"))) {
1626+
if (alertText.matches(".*violat(ed|ion|ing).*")
16251627
|| alertText.contains("infringement")) {
16261628
// Possible error messages:
16271629
// "This account has been terminated for a violation of YouTube's Terms of
@@ -1643,6 +1645,7 @@ public static void defaultAlertsCheck(@Nonnull final JsonObject initialData)
16431645
// the user posted."
16441646
// "This account has been terminated because it is linked to an account that
16451647
// received multiple third-party claims of copyright infringement."
1648+
// "This channel was removed because it violated our Community Guidelines."
16461649
throw new AccountTerminatedException(alertText,
16471650
AccountTerminatedException.Reason.VIOLATION);
16481651
} else {

0 commit comments

Comments
 (0)