def url = "https://www.youtube.com/watch?v=_1nPS7qOLxQ" def start= "1:30" def end = "1:50" def toTime(String time){ def splitted = time.split(":") println(splitted[1]) return (splitted[0] as Integer)*60+(splitted[1] as Integer) } url.replace("watch?v=", "embed/") + "?start=${toTime(start)}&end=${toTime(end)}&autoplay=true"