diff --git a/README.md b/README.md index 888585b..c530e67 100644 --- a/README.md +++ b/README.md @@ -10,15 +10,13 @@ To make TTVST unique for your streaming needs it's possible to create your own o The TTVStreamerTool is developed and tested on an Windows 10 x64 system. I guess everything >= Windows 8 should work. -Linux or MacOS are **not** supported. *You could download the source code and tweak it here and there to make it work though...* +Linux or MacOS are **not** supported. (And propably never will be.) ### Download & Install -Download the zip in the v0.1.2 release and unpack it somewhere you don't need elevated writing rights. This is because the auto updater needs to overwrite some files there. You could start the program as an administrator but this is not recommended. +Download the Setup.exe of the latest release and execute it. The application will install and create a few shortcuts. From then on the application should keep itself updated. Since I don't have the time or money for an code signing certificate the Setup.exe might be blocked from executing. It's up to you to trust this application. Do not install a Setup.exe that was not downloaded from the releases page of this project. Stay safe! -After unpacking start the tool by double clicking the `ttv-streamertool.exe`. - -» [Version 0.1.2 release](https://github.com/PakL/TTVStreamerTool/releases/tag/v0.1.2) +» [Find tha latest release](https://github.com/PakL/TTVStreamerTool/releases/) ### Screenshot diff --git a/docs/Addons.html b/docs/Addons.html index d47e1a9..4f5da00 100644 --- a/docs/Addons.html +++ b/docs/Addons.html @@ -39,7 +39,7 @@

TTVST

- +
@@ -73,7 +73,7 @@

lib/addons.js, - line 11 + line 12

@@ -226,7 +226,7 @@ @@ -315,7 +315,7 @@

lib/addons.js, - line 104 + line 105

@@ -475,7 +475,7 @@

lib/addons.js, - line 130 + line 131

@@ -640,7 +640,7 @@

lib/addons.js, - line 117 + line 118

diff --git a/docs/Channel.html b/docs/Channel.html index fd83b96..dd75f8e 100644 --- a/docs/Channel.html +++ b/docs/Channel.html @@ -39,7 +39,7 @@

TTVST

- +
diff --git a/docs/Chat.html b/docs/Chat.html index dd43c12..da5d680 100644 --- a/docs/Chat.html +++ b/docs/Chat.html @@ -39,7 +39,7 @@

TTVST

- +
diff --git a/docs/Cockpit.html b/docs/Cockpit.html index 19c7838..7d430d9 100644 --- a/docs/Cockpit.html +++ b/docs/Cockpit.html @@ -39,7 +39,7 @@

TTVST

- +
@@ -762,7 +762,7 @@

lib/cockpit.js, - line 442 + line 462

@@ -853,7 +853,7 @@

lib/cockpit.js, - line 343 + line 363

@@ -1090,7 +1090,7 @@

lib/cockpit.js, - line 382 + line 402

@@ -1236,7 +1236,7 @@

lib/cockpit.js, - line 480 + line 500

@@ -1406,7 +1406,7 @@

lib/cockpit.js, - line 461 + line 481

@@ -1497,7 +1497,7 @@

lib/cockpit.js, - line 417 + line 437

diff --git a/docs/Follows.html b/docs/Follows.html index efffd32..b6dfbf2 100644 --- a/docs/Follows.html +++ b/docs/Follows.html @@ -39,7 +39,7 @@

TTVST

- +
diff --git a/docs/Overlays.html b/docs/Overlays.html index 80eee70..69d6e04 100644 --- a/docs/Overlays.html +++ b/docs/Overlays.html @@ -39,7 +39,7 @@

TTVST

- +
diff --git a/docs/TTVLogin.html b/docs/TTVLogin.html index 0e94cd8..99c2737 100644 --- a/docs/TTVLogin.html +++ b/docs/TTVLogin.html @@ -39,7 +39,7 @@

TTVST

- +
diff --git a/docs/TTVTool.html b/docs/TTVTool.html index f148118..bfdf514 100644 --- a/docs/TTVTool.html +++ b/docs/TTVTool.html @@ -39,7 +39,7 @@

TTVST

- +
@@ -194,7 +194,7 @@

mod/tool.js, - line 230 + line 237

@@ -273,7 +273,7 @@

mod/tool.js, - line 159 + line 166

@@ -352,7 +352,7 @@

mod/tool.js, - line 199 + line 206

@@ -431,7 +431,7 @@

mod/tool.js, - line 169 + line 176

@@ -510,7 +510,7 @@

mod/tool.js, - line 179 + line 186

@@ -589,7 +589,7 @@

mod/tool.js, - line 209 + line 216

@@ -668,7 +668,7 @@

mod/tool.js, - line 129 + line 136

@@ -754,7 +754,7 @@

mod/tool.js, - line 189 + line 196

@@ -833,7 +833,7 @@

mod/tool.js, - line 139 + line 146

@@ -912,7 +912,7 @@

mod/tool.js, - line 220 + line 227

@@ -993,7 +993,7 @@

mod/tool.js, - line 149 + line 156

@@ -1072,7 +1072,7 @@

mod/tool.js, - line 118 + line 125

@@ -1165,7 +1165,7 @@

mod/tool.js, - line 99 + line 106

@@ -1256,7 +1256,7 @@

mod/tool.js, - line 89 + line 96

diff --git a/docs/ToolSettings.html b/docs/ToolSettings.html index ad1338a..5d64e0a 100644 --- a/docs/ToolSettings.html +++ b/docs/ToolSettings.html @@ -39,7 +39,7 @@

TTVST

- +
@@ -278,6 +278,85 @@
Type:
+ + + + + + + + + + + + + + + + + + + + + +
+

+ readonly flashActions :Boolean + + + +

+ + +
+
+ +
+ Loads and returns weither or not to animate actions in the action bar +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -305,7 +384,7 @@

@@ -436,6 +515,85 @@
Type:
+ + + + + + + + + + +
+ + + + + +
+ + + + +
+

+ readonly lightDesignMode :Boolean + + + +

+ + +
+
+ +
+ Loads and returns weither or not to invert the application's colors +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -463,7 +621,7 @@ @@ -537,12 +695,12 @@
Type:
-

- readonly showLocalizedNames :Boolean +

+ readonly showBanAlert :Boolean

@@ -552,7 +710,560 @@

- Loads and returns weither or not localized names should be displayed. + Loads and returns weither or not to show ban alerts +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + +
+

+ readonly showFollowAlert :Boolean + + + +

+ + +
+
+ +
+ Loads and returns weither or not to show follow alerts +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + +
+

+ readonly showHostAlert :Boolean + + + +

+ + +
+
+ +
+ Loads and returns weither or not to show host alerts +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + +
+

+ readonly showLocalizedNames :Boolean + + + +

+ + +
+
+ +
+ Loads and returns weither or not localized names should be displayed. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + +
+

+ readonly showRaidAlert :Boolean + + + +

+ + +
+
+ +
+ Loads and returns weither or not to show raid alerts +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + +
+

+ readonly showSubscriptionAlert :Boolean + + + +

+ + +
+
+ +
+ Loads and returns weither or not to show subscription alerts +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + +
+

+ readonly showTimeoutAlert :Boolean + + + +

+ + +
+
+ +
+ Loads and returns weither or not to show timeout alerts +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + +
+

+ readonly showViewerList :Boolean + + + +

+ + +
+
+ +
+ Loads and returns weither or not to show the viewers list
@@ -631,7 +1342,7 @@

@@ -722,7 +1433,7 @@

@@ -886,7 +1597,7 @@

@@ -1050,7 +1761,7 @@

@@ -1214,7 +1925,7 @@

@@ -1378,7 +2089,7 @@

@@ -1542,7 +2253,7 @@

@@ -1683,7 +2394,7 @@

diff --git a/docs/ToolUI.html b/docs/ToolUI.html index f45ccb4..c935f1f 100644 --- a/docs/ToolUI.html +++ b/docs/ToolUI.html @@ -39,7 +39,7 @@

TTVST

- +
@@ -552,7 +552,7 @@

@@ -693,7 +693,7 @@

@@ -834,7 +834,7 @@

@@ -997,7 +997,7 @@

@@ -1205,7 +1205,7 @@

@@ -1346,7 +1346,7 @@

@@ -1561,7 +1561,7 @@

@@ -1652,7 +1652,7 @@

diff --git a/docs/TwitchChat.html b/docs/TwitchChat.html index cce200b..8d63adb 100644 --- a/docs/TwitchChat.html +++ b/docs/TwitchChat.html @@ -39,7 +39,7 @@

TTVST

- +
diff --git a/docs/TwitchTv.html b/docs/TwitchTv.html index 94c07a1..a46944e 100644 --- a/docs/TwitchTv.html +++ b/docs/TwitchTv.html @@ -39,7 +39,7 @@

TTVST

- +
@@ -921,7 +921,7 @@

@@ -1031,7 +1031,7 @@

@@ -1141,7 +1141,7 @@

@@ -1335,7 +1335,7 @@

@@ -1715,7 +1715,7 @@

@@ -2053,12 +2053,12 @@
Properties
-

- async getChatBadgesByChannel(channelid, callback) +

+ async getChannelVideos(channelid, options, callback)

@@ -2071,7 +2071,7 @@

- Loads channel badges. It's incomplete. If you want better badges use TwitchTv#getChatBadgeSetsByChannel. + Gets a list of VODs (Video on Demand) from a specified channel.
@@ -2126,7 +2126,1105 @@

Parameters:
- Channel id of the channel you want the badges of. + Channel id of the channel you want the subscriber of. + + + + + + + options + + + + + +Object + + + + + + + + + + Options to control direction of the result. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
limit + + +Number + + + + + + <optional>
+ + + + + +
+ + 25 + + Maximum number of objects to return. Maximum: 100.
offset + + +Number + + + + + + <optional>
+ + + + + +
+ + 0 + + Object offset for pagination of results.
broadcast_type + + +String + + + + + + <optional>
+ + + + + +
+ + 'archive,highlight,upload' + + Constrains the type of videos returned. Valid values: (any combination of) archive, highlight, upload.
language + + +String + + + + + + <optional>
+ + + + + +
+ + Constrains the language of the videos that are returned; for example, en,es. Default: all languages.
sort + + +String + + + + + + <optional>
+ + + + + +
+ + 'time' + + Sorting order of the returned objects. Valid values: views, time.
+ + + + + + + + + callback + + + + + +TwitchTv~requestCallback + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + +
+ + + + +
+ + + + +

+ async getChatBadgesByChannel(channelid, callback) + + + +

+ + + + +
+
+ + +
+ Loads channel badges. It's incomplete. If you want better badges use TwitchTv#getChatBadgeSetsByChannel. +
+ + + + + + + + + +
+
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
channelid + + +String +| + +Number + + + + Channel id of the channel you want the badges of.
callback + + +TwitchTv~requestCallback + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + +
+ + + + +
+ + + + +

+ async getChatBadgeSetsByChannel(channelid, callback) + + + +

+ + + + +
+
+ + +
+ A more detailed alternative to TwitchTv#getChatBadgesByChannel. There is no official documentation and is now official api endpoint. See example for an example response. +
+ + + + + + + + + +
+
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
channelid + + +String +| + +Number + + + + Channel id of the channel you want the badges of.
callback + + +TwitchTv~requestCallback + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Example
+ +
// Example response:
{
  "badge_sets": {
    "subscriber": {
      "versions": {
        "0": {
          "image_url_1x": "https://static-cdn.jtvnw.net/badges/v1/7821fdef-7fd6-4085-a9b0-eae8952ce299/1",
          "image_url_2x": "https://static-cdn.jtvnw.net/badges/v1/7821fdef-7fd6-4085-a9b0-eae8952ce299/2",
          "image_url_4x": "https://static-cdn.jtvnw.net/badges/v1/7821fdef-7fd6-4085-a9b0-eae8952ce299/3",
          "description": "Subscriber",
          "title": "Subscriber",
          "click_action": "subscribe_to_channel",
          "click_url": ""
        }
      }
    }
  }
}
+ + + +
+ + + + +
+ + + + +

+ async getChatEmoticonsBySet(emotesets, callback) + + + +

+ + + + +
+
+ + +
+ Get emote sets. +
+ + + + + + + + + +
+
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
emotesets + + +String + + + + Comma seperated list of emote set ids.
callback + + +TwitchTv~requestCallback + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + +
+ + + + +
+ + + + +

+ getCollectionsByChannel(channelid, options, callback) + + + +

+ + + + +
+
+ + +
+ Gets collections to a specified channel +
+ + + + + + + + + +
+
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2206,7 +3304,7 @@
Parameters:
See:
@@ -2227,12 +3325,12 @@
Parameters:
-

- async getChatBadgeSetsByChannel(channelid, callback) +

+ async getStreamByUser(channelid, options, callback)

@@ -2245,7 +3343,7 @@

- A more detailed alternative to TwitchTv#getChatBadgesByChannel. There is no official documentation and is now official api endpoint. See example for an example response. + Loads a stream object for a channel
@@ -2300,20 +3398,20 @@

Parameters:
- + - + - - - - -
NameTypeDescription
channelid + + +String + + + + The channel you want the collections of
options + + +Object + + + + Options to filter or limit the response +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
limit + + +String + + + + + + <optional>
+ + + + + +
+ + 10 + + Maximum number of most-recent objects to return. Maximum: 100.
cursor + + +Number + + + + + + <optional>
+ + + + + +
+ + Tells the server where to start fetching the next set of results in a multi-page response.
containing_item + + +String + + + + + + <optional>
+ + + + + +
+ + Returns only collections containing the specified video. Note this uses a video ID, not a collection item ID. Example: video:89917098.
+ +
Channel id of the channel you want the badges of.Channel id of the channel you want the stream for.
callbackoptions -TwitchTv~requestCallback +Object @@ -2323,114 +3421,9 @@
Parameters:
-
- -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
Example
- -
// Example response:
{
  "badge_sets": {
    "subscriber": {
      "versions": {
        "0": {
          "image_url_1x": "https://static-cdn.jtvnw.net/badges/v1/7821fdef-7fd6-4085-a9b0-eae8952ce299/1",
          "image_url_2x": "https://static-cdn.jtvnw.net/badges/v1/7821fdef-7fd6-4085-a9b0-eae8952ce299/2",
          "image_url_4x": "https://static-cdn.jtvnw.net/badges/v1/7821fdef-7fd6-4085-a9b0-eae8952ce299/3",
          "description": "Subscriber",
          "title": "Subscriber",
          "click_action": "subscribe_to_channel",
          "click_url": ""
        }
      }
    }
  }
}
- - - -
- - + Options to filter by stream type +

Properties
- -
- - - - -

- async getChatEmoticonsBySet(emotesets, callback) - - - -

- - - - -
-
- - -
- Get emote sets. -
- - - - - - - - - -
-
Parameters:
- @@ -2441,8 +3434,12 @@
Parameters:
+ + + + @@ -2453,7 +3450,7 @@
Parameters:
- + + - + + + + + + + + + +
TypeAttributesDefaultDescription
emotesetssteam_type @@ -2466,10 +3463,33 @@
Parameters:
+ + <optional>
+ + + + +
Comma seperated list of emote set ids. + + 'live' + + Constrains the type of streams returned. Valid values: live, playlist, all. Playlists are offline streams of VODs (Video on Demand) that appear live.
+ + @@ -2549,7 +3569,7 @@
Parameters:
See:
@@ -2570,12 +3590,12 @@
Parameters:
-

- async getStreamByUser(channelid, options, callback) +

+ getTeam(teamname, callback)

@@ -2588,7 +3608,7 @@

- Loads a stream object for a channel + Gets a specified team object
@@ -2624,78 +3644,7 @@

Parameters:
- channelid - - - - - -String -| - -Number - - - - - - - - - - Channel id of the channel you want the stream for. - - - - - - - options - - - - - -Object - - - - - - - - - - Options to filter by stream type -
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - -
NameTypeAttributesDefaultDescription
steam_typeteamname @@ -2708,33 +3657,10 @@
Properties
- - <optional>
- - - - - -
- - 'live' - - Constrains the type of streams returned. Valid values: live, playlist, all. Playlists are offline streams of VODs (Video on Demand) that appear live.
- + The teamname that you want to get @@ -2814,7 +3740,7 @@
Properties
See:
@@ -2840,7 +3766,7 @@

@@ -3034,7 +3960,7 @@

@@ -3205,7 +4131,7 @@

@@ -3587,7 +4513,7 @@

@@ -3697,7 +4623,7 @@

@@ -4003,7 +4929,7 @@

@@ -4265,7 +5191,7 @@

@@ -4406,7 +5332,7 @@

@@ -4762,7 +5688,7 @@

@@ -4928,7 +5854,7 @@

diff --git a/docs/UIPage.html b/docs/UIPage.html index 67ff9c2..798ba51 100644 --- a/docs/UIPage.html +++ b/docs/UIPage.html @@ -39,7 +39,7 @@

TTVST

- +
diff --git a/docs/index.html b/docs/index.html index eda71f6..486e2a6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -39,7 +39,7 @@

TTVST

- +
@@ -66,10 +66,9 @@

TTVST


To make TTVST unique for your streaming needs it's possible to create your own overlays and addons. I will document how to do that in the coming future. To start of, read the Getting Started Guide.

Platform

The TTVStreamerTool is developed and tested on an Windows 10 x64 system. I guess everything >= Windows 8 should work.

-

Linux or MacOS are not supported. You could download the source code and tweak it here and there to make it work though...

-

Download & Install

Download the zip in the v0.1.2 release and unpack it somewhere you don't need elevated writing rights. This is because the auto updater needs to overwrite some files there. You could start the program as an administrator but this is not recommended.

-

After unpacking start the tool by double clicking the ttv-streamertool.exe.

-

» Version 0.1.2 release

+

Linux or MacOS are not supported. (And propably never will be.)

+

Download & Install

Download the Setup.exe of the latest release and execute it. The application will install and create a few shortcuts. From then on the application should keep itself updated. Since I don't have the time or money for an code signing certificate the Setup.exe might be blocked from executing. It's up to you to trust this application. Do not install a Setup.exe that was not downloaded from the releases page of this project. Stay safe!

+

» Find tha latest release

Screenshot

Cockpit Screenshot

Report issues

To report issues or request improvements/features, please use the github issues page.

diff --git a/docs/lib_addons.js.html b/docs/lib_addons.js.html index f3664c4..3839a1a 100644 --- a/docs/lib_addons.js.html +++ b/docs/lib_addons.js.html @@ -41,7 +41,7 @@

TTVST

- +
@@ -57,11 +57,12 @@

TTVST

const {remote} = require('electron') const {app} = remote.require('electron') -const exec = require('child_process').exec; +const {spawn, spawnSync, execSync} = require('child_process'); const fs = require("fs") +const Path = require('path') const https = require("../node_modules/follow-redirects").https const UIPage = require('../mod/uipage') -const requireUncached = require('../node_modules/require-uncached') +const i18n_module = require('i18n-nodejs') /** * This module finds addons, loads and initialze them @@ -113,7 +114,7 @@

TTVST

} catch(e) {} try { fs.accessSync(`${addonsDir[i]}/language.json`) - lang = requireUncached('../node_modules/i18n-nodejs')(this.tool.settings.language, `${curdir}/${addonsDir[i]}/language.json`) + lang = new i18n_module(this.tool.settings.language, `${curdir}/${addonsDir[i]}/language.json`) } catch(e) {} if(infos.hasOwnProperty('name') && infos.hasOwnProperty('systems')) { @@ -241,7 +242,8 @@

TTVST

let modal = this.tool.ui.showErrorMessage(new Error(this.tool.i18n.__('Uninstalling {{addon}} now... Program will restart.', {addon: addonname}))) modal.onclick = () => {} setTimeout(() => { - exec('cmd /C "ping 127.0.0.1 -n 2 > NUL & del "' + this.package_infos[addonname].file.replace(/\//g, '\\') + '" & "' + process.execPath + '"') + fs.writeFileSync('deleteAddon.bat', '@echo off\r\ncls\r\necho +++ TTVStreamerTool Addon Uninstall +++\r\necho Please DO NOT close this window...\r\nping 127.0.0.1 -n 5 > NUL\r\ndel "' + this.package_infos[addonname].file.replace(/\//g, '\\') + '"\r\nstart "" "' + process.execPath + '"') + spawn('cmd', ['/C', 'deleteAddon.bat'], {cwd: process.cwd, env: process.env, detached: true}) app.quit() }, 5000); } else { @@ -265,7 +267,7 @@

TTVST

resp.on('data', (chunk) => { fs.appendFileSync('resources/' + addonname + '.part', chunk) }) resp.on('end', () => { fs.renameSync('resources/' + addonname + '.part', 'resources/' + addonname + '.asar') - exec('cmd /C "ping 127.0.0.1 -n 2 > NUL & "' + process.execPath + '"') + app.relaunch() app.quit() }) } else { @@ -303,8 +305,21 @@

TTVST

fs.writeFileSync('resources/' + addonname + '.part', Buffer.alloc(0)) resp.on('data', (chunk) => { fs.appendFileSync('resources/' + addonname + '.part', chunk) }) resp.on('end', () => { - exec('cmd /C "ping 127.0.0.1 -n 2 > NUL & del "' + self.package_infos[addonname].file.replace(/\//g, '\\') + '" & copy resources\\' + addonname + '.part resources\\' + addonname + '.asar & del resources\\' + addonname + '.part & "' + process.execPath + '"') + /*let exPa = process.execPath + if(exPa.startsWith('\\')) exPa = exPa.substr(1) + if(exPa.indexOf(' ') > 0) exPa = '"' + exPa + '"' + spawn('cmd', ['/Q', '/C', 'del "' + self.package_infos[addonname].file.replace(/\//g, '\\') + '" & copy resources\\' + addonname + '.part resources\\' + addonname + '.asar & del resources\\' + addonname + '.part & start ' + exPa], {'detached': true})*/ + + fs.writeFileSync('updateAddon.bat', '@echo off\r\ncls\r\necho +++ TTVStreamerTool Addon Uninstall +++\r\necho Please DO NOT close this window...\r\nping 127.0.0.1 -n 5 > NUL\r\ndel "' + this.package_infos[addonname].file.replace(/\//g, '\\') + '"\r\ncopy resources\\' + addonname + '.part resources\\' + addonname + '.asar\r\ndel resources\\' + addonname + '.part\r\nstart "" "' + process.execPath + '"') + spawn('cmd', ['/C', 'updateAddon.bat'], {cwd: process.cwd, env: process.env, detached: true}) app.quit() + + /*try { + spawn('cmd', ['/Q', '/C', 'del "' + self.package_infos[addonname].file.replace(/\//g, '\\') + '"']) + } catch(e) {} + fs.renameSync('resources/' + addonname + '.part', 'resources/' + addonname +'.asar') + app.relaunch() + app.quit()*/ }) } else { app.quit() diff --git a/docs/lib_auth.js.html b/docs/lib_auth.js.html index d6e5e60..3609cd5 100644 --- a/docs/lib_auth.js.html +++ b/docs/lib_auth.js.html @@ -41,7 +41,7 @@

TTVST

- +
diff --git a/docs/lib_chat.js.html b/docs/lib_chat.js.html index 89aafd5..c6bbe24 100644 --- a/docs/lib_chat.js.html +++ b/docs/lib_chat.js.html @@ -41,7 +41,7 @@

TTVST

- +
diff --git a/docs/lib_cockpit.js.html b/docs/lib_cockpit.js.html index fbc41e6..0a2891a 100644 --- a/docs/lib_cockpit.js.html +++ b/docs/lib_cockpit.js.html @@ -41,7 +41,7 @@

TTVST

- +
@@ -203,7 +203,9 @@

TTVST

/* Follower events */ self.tool.follows.on('follow', (user, raw) => { - self.channelActionsElement._tag.addAction(user, self.tool.i18n.__('is following this channel now'), timestamp(raw.created_at, true)) + if(self.tool.settings.showFollowAlert) { + self.channelActionsElement._tag.addAction(user, self.tool.i18n.__('is following this channel now'), timestamp(raw.created_at, true)) + } }) @@ -274,11 +276,17 @@

TTVST

self.tool.chat.on('usernotice', (channel, user, tags, msg) => { if(channel != self.openChannelObject.name) return if(tags['msg-id'] == 'resub') { + if(!self.tool.settings.showSubscriptionAlert) return self.channelActionsElement._tag.addAction(user, self.i18n.__('subscribed for the {{months}}. month in a row!', {months: tags['msg-param-months']}), timestamp(parseInt(tags['tmi-sent-ts']), true)) } if(tags['msg-id'] == 'sub') { + if(!self.tool.settings.showSubscriptionAlert) return self.channelActionsElement._tag.addAction(user, self.i18n.__('subscribed with {{plan}} to this channel', {plan: tags['msg-param-sub-plan-name']}), timestamp(parseInt(tags['tmi-sent-ts']), true)) } + if(tags['msg-id'] == 'raid') { + if(!self.tool.settings.showRaidAlert) return + self.channelActionsElement._tag.addAction(user, self.i18n.__('is raiding your channel with {{viewers}} viewers', {viewers: tags['msg-param-viewerCount']}), timestamp(parseInt(tags['tmi-sent-ts']), true)) + } }) self.tool.chat.on('clearuser', (channel, user, tags) => { if(channel != self.openChannelObject.name) return @@ -287,7 +295,10 @@

TTVST

let message = self.i18n.__('was banned from the channel.') let reason = self.i18n.__('There was no reason given.') if(tags['ban-reason'].length > 0) reason = '"' + tags['ban-reason'] + '"' - if(tags.hasOwnProperty('ban-duration')) message = self.i18n.__('was timeouted for {{duration}} {{seconds||duration}}', { duration: tags['ban-duration'] }) + if(tags.hasOwnProperty('ban-duration')) { + if(!self.tool.settings.showTimeoutAlert) return + message = self.i18n.__('was timeouted for {{duration}} {{seconds||duration}}', { duration: tags['ban-duration'] }) + } else if(!self.tool.settings.showBanAlert) return self.channelActionsElement._tag.addAction(user, message + '<br>' + reason, timestamp(new Date().getTime(), true)) } @@ -297,6 +308,7 @@

TTVST

self.chatelement._tag.clearmessages() }) self.tool.chat.on('hostingyou', (channel, user, viewers, msg, tags) => { + if(!self.tool.settings.showHostAlert) return let hostmessage = self.i18n.__('is hosting the channel') if(viewers > 0) { hostmessage = self.i18n.__('is hosting the channel with {{viewernum}} {{viewers||viewernum}}', { viewernum: viewers }) @@ -304,6 +316,7 @@

TTVST

self.channelActionsElement._tag.addAction(user, hostmessage, timestamp(new Date().getTime(), true)) }) self.tool.chat.on('autohostingyou', (channel, user, viewers, msg, tags) => { + if(!self.tool.settings.showHostAlert) return let hostmessage = self.i18n.__('is auto hosting the channel') if(viewers > 0) { hostmessage = self.i18n.__('is auto hosting the channel with {{viewernum}} {{viewers||viewernum}}', { viewernum: viewers }) @@ -375,7 +388,14 @@

TTVST

document.querySelector('#content_cockpit').style.display = 'block' } else { document.querySelector('#content_follows').style.display = 'block' - + } + + if(!this.tool.settings.showViewerList) { + document.querySelector('#chat_column').style.width = '70%' + document.querySelector('#chat_users_column').style.display = 'none' + document.querySelector('#chat_message_column').style.width = '70%' + document.querySelector('#chat_message_emotes_button').style.right = 'calc(30% + 8px)' + document.querySelector('#chat_message_emotes').style.right = 'calc(30% + 8px)' } } diff --git a/docs/lib_overlay.js.html b/docs/lib_overlay.js.html index 9614d35..d329bdc 100644 --- a/docs/lib_overlay.js.html +++ b/docs/lib_overlay.js.html @@ -41,7 +41,7 @@

TTVST

- +
diff --git a/docs/lib_settings.js.html b/docs/lib_settings.js.html index 60bf5d6..94a2166 100644 --- a/docs/lib_settings.js.html +++ b/docs/lib_settings.js.html @@ -41,7 +41,7 @@

TTVST

- +
@@ -104,6 +104,81 @@

TTVST

return this.getBoolean('autorecovermessages', false) } + /** + * Loads and returns weither or not to animate actions in the action bar + * + * @member {Boolean} + * @readonly + */ + get flashActions() { + return this.getBoolean('flashactions', true) + } + + /** + * Loads and returns weither or not to show follow alerts + * + * @member {Boolean} + * @readonly + */ + get showFollowAlert() { + return this.getBoolean('showfollowalert', true) + } + /** + * Loads and returns weither or not to show subscription alerts + * + * @member {Boolean} + * @readonly + */ + get showSubscriptionAlert() { + return this.getBoolean('showsubscriptionalert', true) + } + /** + * Loads and returns weither or not to show raid alerts + * + * @member {Boolean} + * @readonly + */ + get showRaidAlert() { + return this.getBoolean('showraidalert', true) + } + /** + * Loads and returns weither or not to show host alerts + * + * @member {Boolean} + * @readonly + */ + get showHostAlert() { + return this.getBoolean('showhostalert', true) + } + /** + * Loads and returns weither or not to show ban alerts + * + * @member {Boolean} + * @readonly + */ + get showBanAlert() { + return this.getBoolean('showbanalert', true) + } + /** + * Loads and returns weither or not to show timeout alerts + * + * @member {Boolean} + * @readonly + */ + get showTimeoutAlert() { + return this.getBoolean('showtimeoutalert', true) + } + + /** + * Loads and returns weither or not to show the viewers list + * + * @member {Boolean} + * @readonly + */ + get showViewerList() { + return this.getBoolean('showviewerlist', true) + } + /** * Loads and returns an array of configured highlight objects. * @@ -114,6 +189,16 @@

TTVST

return this.getJSON('highlights', []) } + /** + * Loads and returns weither or not to invert the application's colors + * + * @member {Boolean} + * @readonly + */ + get lightDesignMode() { + return this.getBoolean('lightdesignmode', false) + } + /** * Creates and returns a settings menu. This always creates a new MenuItem. * If you want access to the items in the application menu use @@ -170,10 +255,102 @@

TTVST

self._tool.ui.getMenuItemById('menu_localizednames').checked = self.showLocalizedNames } }, + { + label: this._tool.i18n.__('Show viewer list'), + type: 'checkbox', + id: 'menu_showviewerlist', + checked: this.showViewerList, + click() { + self.setBoolean('showviewerlist', !self.showViewerList) + if(!self.showViewerList) { + document.querySelector('#chat_column').style.width = '70%' + document.querySelector('#chat_users_column').style.display = 'none' + document.querySelector('#chat_message_column').style.width = '70%' + document.querySelector('#chat_message_emotes_button').style.right = 'calc(30% + 8px)' + document.querySelector('#chat_message_emotes').style.right = 'calc(30% + 8px)' + } else { + document.querySelector('#chat_column').style.width = '50%' + document.querySelector('#chat_users_column').style.display = 'block' + document.querySelector('#chat_message_column').style.width = '50%' + document.querySelector('#chat_message_emotes_button').style.right = 'calc(50% + 8px)' + document.querySelector('#chat_message_emotes').style.right = 'calc(50% + 8px)' + } + } + }, + { + label: this._tool.i18n.__('Alert options'), + submenu: [ + { + label: this._tool.i18n.__('Flash alerts'), + type: 'checkbox', + id: 'menu_flashalerts', + checked: this.flashActions, + click() { + self.setBoolean('flashactions', !self.flashActions) + } + }, + { type: 'separator' }, + { + label: this._tool.i18n.__('Show follow alerts'), + type: 'checkbox', + id: 'menu_showfollowalerts', + checked: this.showFollowAlert, + click() { self.setBoolean('showfollowalert', !self.showFollowAlert) } + }, + { + label: this._tool.i18n.__('Show subscription alerts'), + type: 'checkbox', + id: 'menu_showsubscriptionalerts', + checked: this.showSubscriptionAlert, + click() { self.setBoolean('showsubscriptionalert', !self.showSubscriptionAlert) } + }, + { + label: this._tool.i18n.__('Show raid alerts'), + type: 'checkbox', + id: 'menu_showraidalerts', + checked: this.showRaidAlert, + click() { self.setBoolean('showraidalert', !self.showRaidAlert) } + }, + { + label: this._tool.i18n.__('Show host alerts'), + type: 'checkbox', + id: 'menu_showhostalerts', + checked: this.showHostAlert, + click() { self.setBoolean('showhostalert', !self.showHostAlert) } + }, + { + label: this._tool.i18n.__('Show ban alerts'), + type: 'checkbox', + id: 'menu_showbanalerts', + checked: this.showBanAlert, + click() { self.setBoolean('showbanalert', !self.showBanAlert) } + }, + { + label: this._tool.i18n.__('Show timeout alerts'), + type: 'checkbox', + id: 'menu_showtimeoutalerts', + checked: this.showTimeoutAlert, + click() { self.setBoolean('showtimeoutalert', !self.showTimeoutAlert) } + } + ] + }, { label: this._tool.i18n.__('Highlights'), id: 'menu_highlights', submenu: this.create_highlight_menu() + }, + { + label: this._tool.i18n.__('Light design mode'), + type: 'checkbox', + checked: this.lightDesignMode, + click() { + self.setBoolean('lightdesignmode', !self.lightDesignMode) + if(!self.lightDesignMode) { + document.querySelector('body').classList.remove('invert') + } else { + document.querySelector('body').classList.add('invert') + } + } } ]) }) diff --git a/docs/mod_tool.js.html b/docs/mod_tool.js.html index 6e98bc3..f933890 100644 --- a/docs/mod_tool.js.html +++ b/docs/mod_tool.js.html @@ -41,7 +41,7 @@

TTVST

- +
@@ -70,9 +70,9 @@

TTVST

const Subscriptions = require('../var/subscriptions') const Addons = require('../lib/addons') -const EAU = remote.require('electron-asar-updater') -const {app} = remote.require('electron') -const exec = require('child_process').exec; +//const EAU = remote.require('electron-asar-updater') +const {app, autoUpdater} = remote.require('electron') +const spawn = require('child_process').spawn; /** * This module initializes pretty much everything and other modules have access to other modules over here. @@ -89,7 +89,7 @@

TTVST

const self = this this._settings = new ToolSettings(this) - this._i18n = i18n(this._settings.language, './../../language.json') + this._i18n = new i18n(this._settings.language, './../../language.json') this._twitchapi = new TwitchTv({ clientid: '11vhuxdssb9pc3s2uqpa7s3s0252hyk', redirecturi: 'http://localhost:8086/', @@ -116,7 +116,11 @@

TTVST

this._addons = new Addons(this) this.on('load', () => { - EAU.check((e) => { + if(self._settings.lightDesignMode) { + document.querySelector('body').classList.add('invert') + } + + /*EAU.check((e) => { if(e != null && e.length > 0) { if(e === 'no_update_available') return self.ui.showErrorMessage(new Error(e)) @@ -132,12 +136,15 @@

TTVST

let errormsg_restart = self.ui.showErrorMessage(new Error(self.i18n.__('Update ready. Program will restart automatically!'))) errormsg_restart.onclick = () => {} setTimeout(() => { - exec('cmd /C "ping 127.0.0.1 -n 2 > NUL & copy resources\\update.asar resources\\app.asar /Y & del resources\\update.asar & "' + process.execPath + '""') + let exPa = process.execPath + if(exPa.startsWith('\\')) exPa = exPa.substr(1) + if(exPa.indexOf(' ') > 0) exPa = '"' + exPa + '"' + spawn('cmd', ['/Q', '/C', 'copy resources\\update.asar resources\\app.asar /Y & del resources\\update.asar & start ' + exPa], {'detached': true}) app.quit() }, 5000); }) } - }) + })*/ }) window.onload = (e) => { diff --git a/docs/mod_toolui.js.html b/docs/mod_toolui.js.html index b41381c..decea99 100644 --- a/docs/mod_toolui.js.html +++ b/docs/mod_toolui.js.html @@ -41,7 +41,7 @@

TTVST

- +
@@ -56,7 +56,7 @@

TTVST

"use strict"
 
 const {remote} = require('electron')
-const {Menu, MenuItem} = remote
+const {Menu, MenuItem, app} = remote
 
 const TTVTool = require('./tool')
 const UIPage = require('./uipage')
@@ -109,6 +109,7 @@ 

TTVST

{ label: this._tool.i18n.__('Restart'), role: 'reload' }, { label: this._tool.i18n.__('DevTools'), role: 'toggledevtools' }, { type: 'separator' }, + { label: 'Version ' + app.getVersion() }, { label: this._tool.i18n.__('Quit'), role: 'quit' } ] }, diff --git a/docs/mod_twitchchat.js.html b/docs/mod_twitchchat.js.html index 34d4196..6380c3e 100644 --- a/docs/mod_twitchchat.js.html +++ b/docs/mod_twitchchat.js.html @@ -41,7 +41,7 @@

TTVST

- +
diff --git a/docs/mod_twitchtv.js.html b/docs/mod_twitchtv.js.html index 960a6f4..2555917 100644 --- a/docs/mod_twitchtv.js.html +++ b/docs/mod_twitchtv.js.html @@ -41,7 +41,7 @@

TTVST

- +
@@ -118,8 +118,10 @@

TTVST

if(typeof(options.redirecturi) == 'string') this.redirecturi = options.redirecturi if(typeof(options.scope) == 'object') this.scope = options.scope - this.token = window.localStorage.getItem('tw_auth_token') - if(this.token == null) this.token = '' + if(typeof(window) !== "undefined" && window.hasOwnProperty('localStorage')) { + this.token = window.localStorage.getItem('tw_auth_token') + if(this.token == null) this.token = '' + } } /** @@ -535,6 +537,35 @@

TTVST

this.requestAPI(uri, opt, true, callback) } + /** + * Gets a list of VODs (Video on Demand) from a specified channel. + * + * @async + * @param {(String|Number)} channelid Channel id of the channel you want the subscriber of. + * @param {Object} options Options to control direction of the result. + * @param {Number} [options.limit=25] Maximum number of objects to return. Maximum: 100. + * @param {Number} [options.offset=0] Object offset for pagination of results. + * @param {String} [options.broadcast_type='archive,highlight,upload'] Constrains the type of videos returned. Valid values: (any combination of) archive, highlight, upload. + * @param {String} [options.language] Constrains the language of the videos that are returned; for example, en,es. Default: all languages. + * @param {String} [options.sort='time'] Sorting order of the returned objects. Valid values: views, time. + * @param {TwitchTv~requestCallback} callback + * @see {@link https://dev.twitch.tv/docs/v5/reference/channels/#get-channel-videos} + */ + getChannelVideos(channelid, options, callback) { + if(typeof(callback) != 'function' || (typeof(channelid) != 'string' && typeof(channelid) != 'number')) return + channelid = channelid.toString() + var uri = '/kraken/channels/' + channelid + '/videos' + var opt = {} + if(typeof(options) == 'object') { + if(options.hasOwnProperty('limit') && typeof(options.limit) == 'number') opt.limit = options.limit + if(options.hasOwnProperty('offset') && typeof(options.offset) == 'number') opt.offset = options.offset + if(options.hasOwnProperty('broadcast_type') && typeof(options.broadcast_type) == 'string') opt.broadcast_type = options.broadcast_type + if(options.hasOwnProperty('language') && typeof(options.language) == 'string') opt.language = options.language + if(options.hasOwnProperty('sort') && (options.sort == 'views' || options.sort == 'time')) opt.sort = options.sort + } + this.requestAPI(uri, opt, true, callback) + } + /********************************************* * Chat *********************************************/ @@ -689,6 +720,46 @@

TTVST

} + /********************************************* + * Team + *********************************************/ + /** + * Gets a specified team object + * + * @param {String} teamname The teamname that you want to get + * @param {TwitchTv~requestCallback} callback + * @see {@link https://dev.twitch.tv/docs/v5/reference/teams/#get-team} + */ + getTeam(teamname, callback) { + if(typeof(callback) != 'function' || typeof(teamname) != 'string') return + this.requestAPI('/kraken/teams/' + encodeURIComponent(teamname), {}, false, callback) + } + + /********************************************* + * Collections + *********************************************/ + /** + * Gets collections to a specified channel + * + * @param {String} channelid The channel you want the collections of + * @param {Object} options Options to filter or limit the response + * @param {String} [options.limit=10] Maximum number of most-recent objects to return. Maximum: 100. + * @param {Number} [options.cursor] Tells the server where to start fetching the next set of results in a multi-page response. + * @param {String} [options.containing_item] Returns only collections containing the specified video. Note this uses a video ID, not a collection item ID. Example: video:89917098. + * @param {TwitchTv~requestCallback} callback + * @see {@link https://dev.twitch.tv/docs/v5/reference/collections/#get-collections-by-channel} + */ + getCollectionsByChannel(channelid, options, callback) { + if(typeof(callback) != 'function' || typeof(channelid) != 'string') return + var uri = '/kraken/channels/' + encodeURIComponent(channelid) + '/collections' + var opt = {} + if(typeof(options) == 'object') { + if(options.hasOwnProperty('limit') && typeof(options.limit) == 'number') opt.limit = options.limit + if(options.hasOwnProperty('cursor') && typeof(options.cursor) == 'string') opt.cursor = options.cursor + if(options.hasOwnProperty('containing_item') && typeof(options.containing_item) == 'string' && options.containing_item.startsWith('video:')) opt.containing_item = options.containing_item + } + this.requestAPI(uri, opt, false, callback) + } } /** diff --git a/docs/mod_uipage.js.html b/docs/mod_uipage.js.html index 483d6c7..a939579 100644 --- a/docs/mod_uipage.js.html +++ b/docs/mod_uipage.js.html @@ -41,7 +41,7 @@

TTVST

- +
diff --git a/docs/tutorial-Getting Started.html b/docs/tutorial-Getting Started.html index 86222dc..a5a3cb1 100644 --- a/docs/tutorial-Getting Started.html +++ b/docs/tutorial-Getting Started.html @@ -39,7 +39,7 @@

TTVST

- +
diff --git a/docs/var_channel.js.html b/docs/var_channel.js.html index f34f9b9..9033054 100644 --- a/docs/var_channel.js.html +++ b/docs/var_channel.js.html @@ -41,7 +41,7 @@

TTVST

- +
diff --git a/docs/var_follows.js.html b/docs/var_follows.js.html index b35512b..5872913 100644 --- a/docs/var_follows.js.html +++ b/docs/var_follows.js.html @@ -41,7 +41,7 @@

TTVST

- +
diff --git a/lib/settings.js b/lib/settings.js index f903208..a2fddca 100644 --- a/lib/settings.js +++ b/lib/settings.js @@ -60,6 +60,8 @@ class ToolSettings { } /** + * Loads and returns weither or not to show follow alerts + * * @member {Boolean} * @readonly */ @@ -67,6 +69,8 @@ class ToolSettings { return this.getBoolean('showfollowalert', true) } /** + * Loads and returns weither or not to show subscription alerts + * * @member {Boolean} * @readonly */ @@ -74,6 +78,8 @@ class ToolSettings { return this.getBoolean('showsubscriptionalert', true) } /** + * Loads and returns weither or not to show raid alerts + * * @member {Boolean} * @readonly */ @@ -81,6 +87,8 @@ class ToolSettings { return this.getBoolean('showraidalert', true) } /** + * Loads and returns weither or not to show host alerts + * * @member {Boolean} * @readonly */ @@ -88,6 +96,8 @@ class ToolSettings { return this.getBoolean('showhostalert', true) } /** + * Loads and returns weither or not to show ban alerts + * * @member {Boolean} * @readonly */ @@ -95,6 +105,8 @@ class ToolSettings { return this.getBoolean('showbanalert', true) } /** + * Loads and returns weither or not to show timeout alerts + * * @member {Boolean} * @readonly */ @@ -103,6 +115,8 @@ class ToolSettings { } /** + * Loads and returns weither or not to show the viewers list + * * @member {Boolean} * @readonly */ @@ -120,6 +134,12 @@ class ToolSettings { return this.getJSON('highlights', []) } + /** + * Loads and returns weither or not to invert the application's colors + * + * @member {Boolean} + * @readonly + */ get lightDesignMode() { return this.getBoolean('lightdesignmode', false) } diff --git a/package.json b/package.json index 5c1c75e..57c3867 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ttv-streamertool", - "version": "0.1.7", + "version": "0.2.0", "main": "main.js", "description": "TTVST is an application aimed at Twitch streamer.", "author": {