First, clone and install the necessary dependencies.
$ git clone https://github.com/Cyan903/Soundcloud-yt.git
$ cd Soundcloud-yt
$ pnpm i
Next, you need to register a new project with YouTube's data API. Below is a step by step guide to navigate through the console, but you can also follow Google's official guide here. Although that doesn't include the steps to setup the credentials.
Navigate over to the console and create a new project. You can name it whatever you'd like, as it doesn't have an effect on the final outcome.
![]() |
![]() |
---|
Next you have to enable YouTube's Data API v3. You can find this by searching for it in the search bar.
Once enabled, create your credentials. These will be used to log into the app and upload videos.
![]() |
![]() |
---|---|
![]() |
![]() |
During the credential setup, make sure to set your options as shown above. Especially the authorized redirect urls, application type, and API type.
Once finished, click the pencil icon to edit your clients.
Once here, you need to configure secret.json
in config/
.
$ cp config/secret_example config/secret.json
$ nano config/secret.json
These values should match up to what you see in the image above.
{
"installed": {
"client_id": "<client_id>.apps.googleusercontent.com",
"client_secret": "<client_secret>",
"redirect_uris": ["http://localhost:8080/oauth2callback"],
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token"
}
}
Any changes made in this config should also be reflected in the console (ex, if you change the port in secret.json
, the redirect url should also have that port.
![]() |
![]() |
---|
Once completed, you need to add yourself as a test user. Navigate to the OAuth consent screen and click "Add Users". Then just simply enter the gmail of the account you want to use.
![]() |
![]() |
---|
Now you're done with the console. All that's left is to authorize your account. Run:
$ pnpm start auth
You will be asked to visit a url and enter a code.
Once finished, you should be authorized. Now you can freely upload content with:
$ pnpm start upload <soundcloud_url>
If at any point you need to reauthorize yourself, simply run soundcloud-yt auth
and login again.