Node.js Bot to identify songs in Twitter videos!
Audio Recognition provided by ACRCloud.
Mention @nomemusica (pt-BR) to a music video for a live preview.
To run this bot you'll need to insert some info inside the .env
file and some tokens inside the Control Panel.
This API is responsible for the fingerprinting, it'll receive the .mp4 video and try to extract information about the song in background.
After creating your account, access the ACRCloud Console and grab the Host
, Access Key
and Access Secret
for your application.
If you intend to use more than a single ACR API Key/Secret to increase the usages per day (100rq/day), separate them with a new line inside the Control Panel.
You'll need to create a Google API Project for that (don't worry, it's free). After creating your project, head to your Google API Console and enable Youtube Data API v3
, generate your API Key
and you're good to go.
If you don't have your own Twitter App yet, I suggest creating it directly into your bot account, as all four tokens will be easily found in your Apps' page. However, if you already have one, grab your Consumer API Key
and Consumer API Secret
, add them to your Control Panel, also use them on Twurl to generate your Access Token Key
and Access Token Secret
for separate bot accounts (they'll be saved in ~/.twurlrc
).
This is an optional fallback API, just in case ACRCloud fails to match in the first time. You can also use more than a single token to increase the usages per month (500rq/month).
To acquire your RapidAPI token, add a new app and subscribe it to apidojo's Shazam, then copy your X-RapidAPI-Key
and the setup is over.
You can upload this project to Heroku if you want, but to test it in your own machine, simply execute:
npm install # once only
npm start
Note: Anti-spam response messages are hardcoded inside recognition/utils/prettyMessage.js
.
All your tokens (gathered in Setup) should be set at this step.
Access the /adm
endpoint passing your backendpass
(from .env
) like this:
http://localhost:3000/adm?pass=example
• stopRetrying
checkbox will make your app stop trying to login to Twitter.