}
public Map<String, String> getCaptions(String videoId) {
String feedUrl = String.format(CAPTION_FEED_URL_FORMAT, videoId);
try {
CaptionTrackFeed captionTrackFeed = service.getFeed(new URL(feedUrl), CaptionTrackFeed.class);
HashMap<String, String> languageToUrl = new HashMap<String, String>();
for (CaptionTrackEntry captionTrackEntry : captionTrackFeed.getEntries()) {
String languageCode = captionTrackEntry.getLanguageCode();
Link link = captionTrackEntry.getLink("edit-media", "application/vnd.youtube.timedtext");
if (link != null) {
languageToUrl.put(languageCode, link.getHref());
}