private async Task ProfileModeProcessAsync() { await LoadPageAsync(browser, START_PAGE_URL); for (int i = 0; i < configVOs.Count; i++) { ConfigVO configVO = configVOs[i]; ProfileConfigVO profileConfigVO = profileConfigVOs[i]; // 프록시 서버 변경 ChangeProxServer(configVO.ip); await Task.Delay(Int32.Parse((String)programConfig["prox-change-delay"])); // 로그인 처리 await LoginYoutubeAsync(configVO.username, configVO.password, configVO.getMophnNo()); // 설정으로 페이지로 이동 await LoadPageAsync(browser, "https://aboutme.google.com/u/0/#name"); // 설정 변경 await ChangeYoutubeProfileAsync(profileConfigVO.lastName, profileConfigVO.firstName, profileConfigVO.nickName); // 쿠키 삭제 DeleteCookie(); await Task.Delay(Int32.Parse((String)programConfig["cookie-delete-delay"])); } }
private async Task ChannelModeProcessAsync() { await LoadPageAsync(browser, START_PAGE_URL); for (int i = 0; i < configVOs.Count; i++) { ConfigVO configVO = configVOs[i]; ChannelConfigVO channelVO = channelConfigVOs[i]; // 프록시 서버 변경 ChangeProxServer(configVO.ip); await Task.Delay(Int32.Parse((String)programConfig["prox-change-delay"])); // 로그인 처리 await LoginYoutubeAsync(configVO.username, configVO.password, configVO.getMophnNo()); // 채널 생성 루프 foreach (string name in channelVO.list) { // 채널 목록으로 이동 await LoadPageAsync(browser, "https://www.youtube.com/channel_switcher?feature=settings&next=%2Faccount"); // 채널 생성 await CreateChannel(name); } // 쿠키 삭제 DeleteCookie(); await Task.Delay(Int32.Parse((String)programConfig["cookie-delete-delay"])); } }
private void ConfigFileInitialize(string authFilePath, string commentFilePath, string urlFilePath) { string authLine, commentLine, urlLine; int counter = 0; StreamReader authFile = new StreamReader(authFilePath, Encoding.Default, true); StreamReader commentFile = new StreamReader(commentFilePath, Encoding.Default, true); StreamReader urlFile = new StreamReader(urlFilePath, Encoding.Default, true); List <ConfigVO> configVOs = new List <ConfigVO>(); while (((authLine = authFile.ReadLine()) != null && !authLine.Equals("")) && ((commentLine = commentFile.ReadLine()) != null && !commentLine.Equals("")) && ((urlLine = urlFile.ReadLine()) != null && !urlLine.Equals("")) ) { ConfigVO configVO = new ConfigVO(); string[] s = authLine.Split('/'); string comment = commentLine; string url = urlLine; configVO.ip = s[0]; configVO.username = s[1]; configVO.password = s[2]; configVO.nickname = s[3]; configVO.url = url; configVO.comment = comment; configVOs.Add(configVO); counter++; } authFile.Close(); commentFile.Close(); urlFile.Close(); this.configVOs = configVOs; }