private void ChannelConfigFileInitialize(string filePath) { string line; int counter = 0; List <ChannelConfigVO> channelConfigVOs = new List <ChannelConfigVO>(); StreamReader file = new StreamReader(filePath, Encoding.Default, true); while (((line = file.ReadLine()) != null && !file.Equals(""))) { ChannelConfigVO channelConfigVO = new ChannelConfigVO(); List <string> list = new List <string>(); string[] s = line.Split('/'); foreach (string item in s) { list.Add(item); } channelConfigVO.list = list; channelConfigVOs.Add(channelConfigVO); counter++; } file.Close(); this.channelConfigVOs = channelConfigVOs; }
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"])); } }