client = createClientAndLogin();
vi = client.getVideoInfo(videoId);
- final String name = profile.getVideoSetting().getFileName();
- final String replaceFrom = profile.getGeneralSetting().getReplaceFrom();
- final String replaceTo = profile.getGeneralSetting().getReplaceTo();
+ final String name = profile.getVideoProfile().getFileName();
+ final String replaceFrom = profile.getGeneralProfile().getReplaceFrom();
+ final String replaceTo = profile.getGeneralProfile().getReplaceTo();
videoNamePattern = new NamePattern(name, replaceFrom, replaceTo, vi.getTitleInWatchPage());
if (needsBackLog()) {
final String key = client.getWayBackKey(vi);
- wbi = new WayBackInfo(key, profile.getCommentSetting().getBackLogPoint());
+ wbi = new WayBackInfo(key, profile.getCommentProfile().getBackLogPoint());
}
}
checkStop();
File commentFile;
- if (profile.getCommentSetting().isDownload()) {
- final CommentProfile prof = profile.getCommentSetting();
- final GeneralProfile gene = profile.getGeneralSetting();
+ if (profile.getCommentProfile().isDownload()) {
+ final CommentProfile prof = profile.getCommentProfile();
+ final GeneralProfile gene = profile.getGeneralProfile();
final NamePattern pattern = new NamePattern(prof.getFileName(), gene.getReplaceFrom(), gene.getReplaceTo(),
vi.getTitleInWatchPage());
// TODO コメントファイルに{low}は使えないことをどこかに書くべきか
final String name = pattern.createFileName(videoId, true);
- final File file = new File(profile.getCommentSetting().getDir(), name);
+ final File file = new File(profile.getCommentProfile().getDir(), name);
- commentFile = client.getCommentFile(vi, file.getPath(), wbi, profile.getCommentSetting().
+ commentFile = client.getCommentFile(vi, file.getPath(), wbi, profile.getCommentProfile().
getLengthRelatedCommentSize(),
- profile.getCommentSetting().isDisablePerMinComment());
+ profile.getCommentProfile().isDisablePerMinComment());
} else {
- commentFile = profile.getCommentSetting().getLocalFile();
+ commentFile = profile.getCommentProfile().getLocalFile();
}
checkStop();
File videoFile;
GetFlvResult vf;
- if (profile.getVideoSetting().isDownload()) {
- vf = client.getFlvFile(vi, profile.getVideoSetting().getDir(), videoNamePattern,
+ if (profile.getVideoProfile().isDownload()) {
+ vf = client.getFlvFile(vi, profile.getVideoProfile().getDir(), videoNamePattern,
Status.GET_INFO, true, new ProgressListener() {
@Override
videoFile = vf.getFile();
} else {
- videoFile = profile.getVideoSetting().getLocalFile();
+ videoFile = profile.getVideoProfile().getLocalFile();
}
return new DownloadResult(true, videoFile, commentFile);
/** @return 何かダウンロードするものがあればtrue. */
private static boolean needsDownload(DownloadProfile profile) {
- return (profile.getVideoSetting().isDownload() || profile.getCommentSetting().isDownload());
+ return (profile.getVideoProfile().isDownload() || profile.getCommentProfile().isDownload());
}
// TODO どこかに処理を移す必要がある.
*/
// TODO HttpException を投げるのをやめたい. コンパイル時にHttpComponentが必要になるので.
private NicoHttpClient createClientAndLogin() throws IOException, InterruptedException, HttpException {
- final NicoHttpClient client = createClient(profile.getProxySetting());
+ final NicoHttpClient client = createClient(profile.getProxyProfile());
final boolean hasLogin;
try {
hasLogin = client.login(profile.getLoginInfo().getMail(), profile.getLoginInfo().getPassword());
/** @return ログインする必要があればtrue. */
private boolean needsLogin() {
- return profile.getVideoSetting().isDownload() || profile.getCommentSetting().isDownload();
+ return profile.getVideoProfile().isDownload() || profile.getCommentProfile().isDownload();
}
/** @return 過去ログ取得の必要があればtrue. */
private boolean needsBackLog() {
- return profile.getCommentSetting().getBackLogPoint() >= 0L;
+ return profile.getCommentProfile().getBackLogPoint() >= 0L;
}
private void checkStop() throws InterruptedException {