Skip to content

Commit

Permalink
Fix: Youtube API로 유튜브 쇼츠 추출 방식 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
suminnnnn committed Oct 13, 2024
1 parent ac211b3 commit cb7ddf5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/cmc/blink/domain/link/business/LinkService.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ private String extractVideoId(String url) throws LinkException {
return url.substring(url.lastIndexOf("/") + 1).split("\\?")[0];
}

if (url.contains("youtube.com/shorts/")) {
return url.substring(url.indexOf("/shorts/") + 8).split("\\?")[0];
}

URL videoUrl = new URL(url);
String query = videoUrl.getQuery();

Expand Down

0 comments on commit cb7ddf5

Please sign in to comment.