-
Notifications
You must be signed in to change notification settings - Fork 25
Error While getting Youtube Data:java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase()' on a null object reference #20
Comments
Until the developer finds a real solution to this issue. There is a workaround you can use to fix it. In naveed > utils > Utils.java file on line 37 or 40 modify public static boolean isListContain(List<String> arraylist, String statement) {
for (String str : arraylist) {
if (statement != null && statement.toLowerCase().contains(str)) {
return true;
}
}
return false;
} Note this is just a workaround! Apparently, |
@KaustubhPatange Good job, thanks for quick workaround. |
Since the null check doesn't return true anyway, So I think it's almost the same as what I commented out. |
@hhyeok1026 Null check is in the for loop not outside, if you say if a string is null it skips the value and process further string. Notice arraylist is not null, its one of the item are null. The work around works successfully I can guarantee you that! Edit: I haven't tested player config this workaround will continue extraction that's it. |
My point is that the isListContain () method will always return false. This is because the current second argument is always null. |
@hhyeok1026 Yes there are side effects for sure. All we can do is wait for official developer to come up with a fix! |
I confirmed that it is not downloading today(05.15.2020.)
Then I checked the exception that caused the error.
The error stack is as follows.
When isListContain() was called, i checked that the second argument was null.
In the code of this "YoutubeStreamExtractor.java - parsePlayerConfig()"
RegexUtils.matchGroup(regexFindReason, body))
Its return value will be null.
Perhaps the structure of the body has changed, or the regular expression to be parsed has changed.
I lack the ability to analyze this.
So I just commented out the if statement in the code above,
I confirmed that the download worked fine.
However, it seems that a side effect has occurred.
Do you know what the problem is?
I would appreciate it if you could tell me how to fix it correctly.
The text was updated successfully, but these errors were encountered: