File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
src/main/java/learningFlow/learningFlow_BE/service/embed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -41,27 +41,25 @@ public String EmbedUrl(String youtubeUrl){
4141 String host = uri .getHost ();
4242 String query = uri .getQuery ();
4343 String path = uri .getPath ();
44+ String adExistUrl = null ;
4445 // 기본 형식: https://www.youtube.com/watch?v=<videoId>
4546 if (host .contains ("youtube.com" ) && query != null && query .contains ("v=" )){
4647 String [] params = query .split ("&" );
4748 for (String param : params ) {
4849 if (param .startsWith ("v=" )){
4950 String videoId = param .substring (2 );
50- return "https://www.youtube.com/embed/ " + videoId ;
51+ return "https:/// www.youtube-nocookie .com/embed" + videoId ;
5152 }
5253 }
5354 }
5455 // 축약형: https://youtu.be/<videoId>
5556 if (host .contains ("youtube.be" ) && path != null && path .length () > 1 ) {
5657 String videoId = path .substring (1 ); // 맨 앞 "/" 제거
57- return "https://youtu.be /embed/" + videoId ;
58+ return "https:///www.youtube-nocookie.com /embed/" + videoId ;
5859 }
59-
6060 throw new ResourceHandler (ErrorStatus .YOUTUBE_URI_SYNTAX_ERROR );
6161 } catch (URISyntaxException e ) {
6262 throw new ResourceHandler (ErrorStatus .URI_SYNTAX_ERROR );
6363 }
6464 }
65-
66-
6765}
You can’t perform that action at this time.
0 commit comments