Skip to content

Commit 008fc2a

Browse files
authored
Merge pull request #141 from TeamLearningFlow/develop
Develop
2 parents 01895f6 + 2b67aa2 commit 008fc2a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/main/java/learningFlow/learningFlow_BE/service/embed/YoutubeUrlEmbedService.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)