String id;
String clip;
{
id = extractId(info.getWeb());
if (id == null) {
throw new DownloadError("unknown url");
}
clip = "http://vimeo.com/m/" + id;
}
URL url = new URL(clip);
String html = WGet.getHtml(url, new HtmlLoader() {
@Override
public void notifyRetry(int delay, Throwable e) {
info.setDelay(delay, e);
notify.run();
}
@Override
public void notifyDownloading() {
info.setState(States.EXTRACTING);
notify.run();
}
@Override
public void notifyMoved() {
info.setState(States.RETRYING);
notify.run();
}
}, stop);
String config;
{
Pattern u = Pattern.compile("data-config-url=\"([^\"]+)\"");
Matcher um = u.matcher(html);
if (!um.find()) {
throw new DownloadError("unknown config vimeo respond");
}
config = um.group(1);
}
config = StringEscapeUtils.unescapeHtml4(config);