Picarto.tv is an alternative streaming platform primarily focused on art and creation streams. It has a subscription service for all streamers, offers built in commissions (using a Twitch Bits like alternative) and several other niceties for creatives to get their foot in the door. This API extension primarily will focus on giving its users follower and subscriber related triggers and variables to integrate into their workflows. Kudos, the currency used for commissions and tipping do not seem to have a public endpoint at this time but that may be added later.
This is a live project and I’m releasing updates fairly regularly right now, so subscribe to the topic and grab the new version as soon as possible. Outside of bug fixes and changes to the implementation where needed, I hope to not break too many things and mess with your ability to add custom tweaks for your needs. If you need to modify Actions, I’d recommend making two separate actions (one for the code modifications and the other to call both the old and new code if the changes are not directly being made to my implementation but as an extension).
The current webhook generation code may break on Streamer.Bot 0.2.2 and under. The 0.2.3 Beta should be starting soon, so an upgrade to that would be recommended.
picarto-api-extension-actions-0.0.8.sb (16.3 KB)
picarto-api-extension-webhooks-0.0.8.sb (11.3 KB)
In Streamer.bot click the Import button in the top menu. Drag the .sb file into the Import String field. Imports by default are disabled. You’ll need to manually enable the
Timed Action Trigger - Picarto API Ping and the many Actions (added in 0.0.2+) under the
The zip file above is required for running this extension. Extract that into your Streamer.Bot folder, extract the zip file in the new picarto folder and drag it to your C drive. This is to make it so that you don’t need to change the DLL reference for any actions that rely on it. If you place it in a different location, you’ll need to change the SubstractionSoft.dll reference in the C# methods of the
Register Picarto Follow Webhook and
Register Picarto Webhooks with Streamer.Bot actions.
Right-Click the Oauth link to open where you will setup your app (required for API access) and Click
Open In New Tab
Click Authorize to pull up the window you’ll put your Oauth info in. You’ll need to enable all four permissions for Webhook creation and access (changed in 0.0.3 release)
Login with your Picarto Credentials. A bot account will mess with getting notifications so it’s not recommended.
Click Add Client and fill in all of the info. The Redirect URIs section must have this or it won’t work at all:
Click Edit Client and copy both
Client Secretinto the proper fields in the Authorize window opened in Step 2. You’ll need these for Step 12.
Click where it says
Try it outon the right.
Type in your Channel Name and click
Scroll down to the
curlsection and copy the entire string that comes after
-H Authorization: Bearerminus the spaces and the single quotation marks. Should begin with an
Open Streamer.bot but don’t close the Picarto API page (in case you need to go back and fix something).
- Add these Global Permanent Variables
- picartoBearer -
<Bearer Token copied from previous step>
- picartoChannelName -
<your Channel Name>
Note Anytime you need to either change your Client Token and/or Client ID, you’ll need to redo Steps 6 - 12. The Bearer token for this last step need to be regenerated and reregistered with Streamer.bot
Added for 0.0.3
- picartoClientID -
<the client id from Step 5>
- picartoClientToken -
<the client secret from Step 5>
May remove these in the future since Webhooks are going to be more useful for this
- Create two new Actions under the
PicartoQueue with the following names:
- Process Picarto Follow
- Process Picarto Subscriber
These are where you will process the alerts and decide how you want to use them. Typically, Picarto is a secondary platform with another platform as the main, so you may want to integrate this into your implementation for those but there are many different ways you can handle this.
Added for 0.0.4
Install the latest LTS release of Node.js for your operating system.
Download the server code file in Resources section and unzip it where your Streamer.Bot instance is running from. It will add a
picartofolder. All of the code will be inside of that.
Open Windows Command Prompt or any terminal on your operating system and navigate to the
npm install -g yarn(yarn is the recommended way to manage the code).
yarnto install all of the required libraries for the code to work. If no errors show up, close your terminal. No need to use it for any other steps.
Right-click this page link, click
Open in New Taband sign in to your account on that page.
Scroll down and click
Approveto generate a chat bot token (will only appear once). Keep this page open for the next steps.
Click Variables up top.
Create a new Persisted Global variable and name it
Copy the token from Step 7 and paste it as the value for this new variable.
- NOTE if you don’t have a
picartoChannelNamePersisted Global variable, make it now and set its value to your channel name. This is important for the bot to watch the right chat. Would not recommend using a bot account for this for the time being.
Close the page opened in Step 7
Picartogroup on the Actions page, click the
Picarto Chat Server Initaction. Adjust the trigger to your setup. Mine runs on a single 5 second timer on startup that runs once.
Right click the trigger and click
Test. If everything was installed and setup correctly in the previous steps, a Command Prompt window should have appeared and stayed open with some log info and the word Node in the title. Minimize this but don’t close it. It’s the Websocket relay server but doesn’t work in headless mode right now.
Websocket Clients. Right click
Picarto Chat (ws://127.0.0.1:8080/)and click
Connect. It should say Open if everything worked correctly.
You can now use this Websocket Client as a trigger for Actions based on Picarto chat events. It has some limitations, though (see below).
- picartoOnline (Temp Variable) - is Picarto stream online? Use this as a trigger for anything that relies on you being live
- picartoFollowerCount - how many followers your Picarto channel currently has
- picartoSubCount - how many subscribers your Picarto channel currently has
Added in 0.0.3
- picartoFollowHook - follow webhook ID
- picartoUnfollowHook - unfollow webhook ID
- picartoSubHook - subscribe webhook ID
- picartoUnsubHook - unsubscribe webhook ID
- picartoOnlineHook - online webhook ID
- picartoOfflineHook - offline webhook ID
- picartoEvStartHook - event_start webhook ID
- picartoEvEndHook - event_end webhook ID
Updated in 0.0.5
- picartoChannelID - Made this a persistent global variable since it’s just so important for future API endpoint calls
- user - display name of user that triggered event; useful for displaying user from chat
- userName - login name of user that triggered event; useful for displaying the account name and not chat name
- avatar - the profile picture URL of user that triggered event; useful for Browser Source based alerts that can display this
- picartoInit (Temp) - set this to True (twice) to activate the Webhook registration mechanism and wait at least 5 minutes for it to finish (although, my tests have shown 10+ minutes once due to Picarto server rate limiting)
- picartoPort (optional Global variable) - the default port for this is 9005. Only change if you’re already using
http://localhost:9005for something else. If you change, you will need to regenerate all webhooks (will add a mechanism to do this for you with one of my next updates)
- Kudos, the built in tipping system, does not have official Webhooks or endpoints in the core API. I will not support this part.
- Public rate limits are 30/minute but everything else seems to not have a consistent amount of time allowed between API calls; once my Webhooks implementation is fully built, I’ll be able to test rate limits there
Added in 0.0.4
- The chat API is pretty basic. It has most of what’s expected (name of chatter, timestamps, etc) but they are labeled using abbreviations and aren’t extrapolated in the bot library itself.
- There’s no official way to use a bot account and have it join your channel. Whatever account is used to generate the token found in Step 7 of the
Chat Websocket Initializationsection, that channel is what the bot will read chat messages from. A workaround that some older bots have used for it involves scraping the streamer’s page, parsing its code and then sending the message as the bot to the channel’s chat websocket, but that seems complex and prone to errors right now.