zhangjinli 3 years ago
parent 667244bba4
commit 3c12340715

@ -257,7 +257,7 @@ public class UtilsController {
} }
public static void main(String[] args) { public static void main(String[] args) {
String url = "0.79 NjP:/ 测试1 https://v.douyin.com/FuhWaKvhkhkhttps://v.douyin.com/FuhWaKvhkh复制admin复制此链接打开Dou音搜索直接观看视频https://v.douyin.com/FuhWaKvhkhhttps://v.douyin.com/FuhWaKvhkhhttps://v.douyin.com/FuhWaKvhkh"; String url = "0.79 NjP:/ 测试1 https://v.douyin.com/FuhWaKvhkhkhttps://v.douyin.com/FuhWaKvhkh";
System.out.println( RegexUtils.get("(http|https)://[A-Za-z0-9_\\-\\+.:?&@=/%#,;]*",url,0)); System.out.println( RegexUtils.get("(http|https)://[A-Za-z0-9_\\-\\+.:?&@=/%#,;]*",url,0));
// String a = m.find() ? m.group(1) : url; // String a = m.find() ? m.group(1) : url;
// System.out.println(a); // System.out.println(a);

@ -98,7 +98,7 @@ public class VideoUController {
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "已提交过该平台视频"); return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "已提交过该平台视频");
} }
// 校验并提取链接 // 校验并提取链接
String s = RegexUtils.get("(http|https)://[A-Za-z0-9_\\\\-\\\\+.:?&@=/%#,;]*\"",param.getUrl(),0); String s = RegexUtils.get("(http|https)://[A-Za-z0-9_\\-\\+.:?&@=/%#,;]*",param.getUrl(),0);
if(null == s){ if(null == s){
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "视频链接有误"); return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "视频链接有误");
}else if(param.getType() == 1&&0==StringUtils.countOccurrencesOf(s,"https://v.douyin")){ }else if(param.getType() == 1&&0==StringUtils.countOccurrencesOf(s,"https://v.douyin")){

Loading…
Cancel
Save