final File file = new File(profile.getCommentProfile().getDir(), name);
final EnumSet<DownloadCommentType> commentSet = EnumSet.of(DownloadCommentType.OWNER);
- if(profile.getCommentProfile().isDisablePerMinComment()) {
+ if (profile.getCommentProfile().isDisablePerMinComment()) {
commentSet.add(DownloadCommentType.COMMENT_OLD);
} else {
commentSet.add(DownloadCommentType.COMMENT);
*/
private NicoHttpClient createClientAndLogin() throws IOException, InterruptedException {
final NicoHttpClient client = createClient(profile.getProxyProfile());
+ if (profile.getLoginProfile().needsLogin()) {
- final boolean hasLogin = client.login(profile.getLoginProfile().getMail(), profile.getLoginProfile().getPassword());
- if (!hasLogin) {
- throw new IOException("login fail");
+ final boolean hasLogin = client.login(profile.getLoginProfile().getMail(), profile.getLoginProfile().
+ getPassword());
+ if (!hasLogin) {
+ throw new IOException("login fail");
+ }
+ } else {
+ client.addCookie(profile.getLoginProfile().getCookies());
}
return client;