import java.io.IOException;
import java.text.Normalizer;
+import org.apache.commons.lang.StringUtils;
import saccubus.ConvertStopFlag;
import saccubus.converter.profile.Proxy;
+import saccubus.net.CommentInfo;
import saccubus.net.NicoClient;
+import saccubus.net.NicoClientImpl;
import saccubus.net.VideoInfo;
+import saccubus.util.WayBackTimeParser;
/**
* 動画ファイル, コメントファイルなど必要なファイルのうち, 1つでもダウンロード処理を必要とする場合のインスタンス化クラス.
private final NicoClient client;
private final VideoInfo videoInfo;
+ private final CommentInfo commentInfo;
WebFileInstanciator(
ConvertStopFlag stopFlag,
host = null;
port = -1;
}
- client = new NicoClient(li.getMail(), li.getPass(), stopFlag, host, port);
+ // TODO Implを直接newしている
+ client = new NicoClientImpl(li.getMail(), li.getPass(), stopFlag, host, port) {
+ };
if (!client.isLoggedIn()) {
throw new IOException("ログインに失敗");
}
try {
- videoInfo = client.getVideoInfo(tag, time);
+ videoInfo = client.getVideoInfo(tag);
+ if (StringUtils.isNotBlank(time)) {
+ System.out.print("Setting wayback time...");
+ final String waybacktime = WayBackTimeParser.parse(time);
+ String waybackkey = client.getWayBackKey(videoInfo);
+ commentInfo = new CommentInfo(waybackkey, waybacktime);
+ }else{
+ commentInfo = CommentInfo.DEFAULT;
+ }
+
} catch (IOException ex) {
throw new IOException(tag + "の情報の取得に失敗", ex);
}
}
if (commentType.isDoanload()) {
- setCommentFileGetter(new CommentFileWebGetter(client, videoInfo, commentType.isAutoCommentNum(),
+ setCommentFileGetter(new CommentFileWebGetter(client, videoInfo, commentInfo, commentType.isAutoCommentNum(),
commentType.getBackComment()));
}