Skip to content

Commit

Permalink
Merge pull request #146 from 8954sood/FIX/#145
Browse files Browse the repository at this point in the history
FIX/#145
  • Loading branch information
dongchandev authored Dec 21, 2024
2 parents 0fb1ed8 + 0badaca commit 925b0eb
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ static public YoutubeApiRes.Thumbnail getThumbnailUrl(YoutubeApiRes.Snippet snip

static public String getVideoId(String videoUrl){
try {
if (videoUrl.startsWith("https://youtu.be/")) {
return videoUrl.replace("https://youtu.be/", "").split("\\?si=")[0];
}
return videoUrl.split("/?v=")[1].split("&")[0];
} catch (IndexOutOfBoundsException e) {
throw new WakeupSongUrlMalformedException();
Expand Down

0 comments on commit 925b0eb

Please sign in to comment.