Skip to content

Commit

Permalink
Fixes #81
Browse files Browse the repository at this point in the history
Command args are split by windows on & characters so we need to escape them to keep the entire string as a single command.
  • Loading branch information
laurencee committed Oct 17, 2024
1 parent dd55833 commit 10b5962
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("2.13.9.0")]
[assembly: AssemblyFileVersion("2.13.9.0")]
[assembly: AssemblyVersion("2.13.10.0")]
[assembly: AssemblyFileVersion("2.13.10.0")]
2 changes: 1 addition & 1 deletion Livestream.Monitor/Core/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Settings : PropertyChangedBase
public const int CurrentSettingsVersion = 2;

public const string CHAT_URL_REPLACEMENT_TOKEN = "{url}";
public const string CHROME_ARGS = "--app=" + CHAT_URL_REPLACEMENT_TOKEN + " --window-size=350 -height=760";
public const string CHROME_ARGS = "--app=" + CHAT_URL_REPLACEMENT_TOKEN + " --window-size=350,760";
public const string FIREFOX_ARGS = "-url " + CHAT_URL_REPLACEMENT_TOKEN;

private MetroThemeBaseColour? metroThemeBaseColour;
Expand Down
5 changes: 3 additions & 2 deletions Livestream.Monitor/Model/StreamLauncher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ await fromScreen.ShowMessageAsync("Missing url token in chat command",

var chatUrl = await livestreamModel.GetChatUrl;
var command = settingsHandler.Settings.ChatCommandLine.Replace(Settings.CHAT_URL_REPLACEMENT_TOKEN, chatUrl);
command = command.Replace("&", "^&");

await Task.Run(async () =>
{
Expand All @@ -76,12 +77,12 @@ await Task.Run(async () =>
StartInfo =
{
FileName = "cmd.exe",
Arguments = "/c " + command,
Arguments = $"/c \"{command}\"",
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
}
},
};
proc.Start();
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ If the username happens to start with "UC" or "HC" then it will fail to add the
**Q. Why do some youtube stream chats show an error page when launched from Livestream Monitor?**
A. Some YouTube streams have chat disabled (you can see this by visiting the stream page in your browser).
I don't believe the Youtube API provides that information right now... hopefully it's something google can add in the future.

**Q. My twitch auth token is invalid, how can I fix this?**

The easiest thing to do is open `settings.json` and delete your token.
Relaunch the app and you'll be asked to authenticate again which will generate a fresh auth token.

0 comments on commit 10b5962

Please sign in to comment.