|
@@ -8,9 +8,11 @@ public class MessageUtil {
|
|
|
|
|
|
public static Long getVideoId(String page) {
|
|
|
String translate = URLUtil.translate(page);
|
|
|
- String videoId = translate.split("id=")[1].split("&")[0];
|
|
|
- if (StringUtils.isNotEmpty(videoId) && StringUtils.isNumeric(videoId)) {
|
|
|
- return Long.parseLong(videoId);
|
|
|
+ if (translate.contains("id=")) {
|
|
|
+ String videoId = translate.split("id=")[1].split("&")[0];
|
|
|
+ if (StringUtils.isNotEmpty(videoId) && StringUtils.isNumeric(videoId)) {
|
|
|
+ return Long.parseLong(videoId);
|
|
|
+ }
|
|
|
}
|
|
|
return null;
|
|
|
}
|