Skip to content

Commit

Permalink
优化输出
Browse files Browse the repository at this point in the history
  • Loading branch information
withsalt committed Sep 29, 2019
1 parent 09f2b0c commit 67ab5de
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/BilibiliLiveTools/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ static async Task Main(string[] args)
string usersFilePath;
Users users;

Console.Title = GetTitle();
GlobalSettings.Logger = Logger.Instance;
if (!BitConverter.IsLittleEndian)
{
Expand All @@ -38,15 +37,13 @@ static async Task Main(string[] args)
{
GlobalSettings.Logger.LogException(ex);
GlobalSettings.Logger.LogError($"缺失或无效配置文件,请检查是否添加\"{usersFilePath}\"");
Console.ReadKey(true);
return;
}
LoginApiExtensions.LoginDataUpdated += (sender, e) => File.WriteAllText(usersFilePath, users.ToJson());
User user = users[0];
if (!await user.Login())
{
GlobalSettings.Logger.LogError($"账号{user.Account}登录失败!");
Console.ReadKey(true);
return;
}
if (!await StartLive(user))
Expand Down Expand Up @@ -146,21 +143,21 @@ private static bool StartPublish(LiveSetting setting, string url)
{
while (!sr.EndOfStream)
{
Console.WriteLine(sr.ReadLine());
GlobalSettings.Logger.LogInfo(sr.ReadLine());
}

if (!proc.HasExited)
{
proc.Kill();
}
}
Console.WriteLine($"FFmpeg exited.");
GlobalSettings.Logger.LogInfo($"FFmpeg exited.");
}
return true;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
GlobalSettings.Logger.LogError(ex.Message);
return false;
}
}
Expand Down

0 comments on commit 67ab5de

Please sign in to comment.