Skip to content

Latest commit

 

History

History
141 lines (89 loc) · 4.51 KB

Youtube.md

File metadata and controls

141 lines (89 loc) · 4.51 KB

Platform: YouTube

The youtube platform manages a youtube channel using @googleapis/youtube and google-auth-library.

To upload public videos, your app needs to be verified / audited first.

By using Fairpost on YouTube, you are agreeing to be bound by the YouTube Terms of Service: https://www.youtube.com/t/terms

Your posts will be preprocessed to fit YouTube. The limitations imposed by Fairpost are not imposed by YouTube.

Set up the platform

Create a new project in your account

Google has a wizard to create a youtube app: https://console.developers.google.com/start/api?id=youtube Below is how to do it manually.

Get your app audited

You can already proceed below to test the app for private videoos. To have Fairpost publish public videos, your app has to be audited

Connect the platform to a user

Enable the platform

  • Add 'youtube' to your FEED_PLATFORMS in your users storage.json

Get an OAuth2 Access Token for your platform

This token last for a few hours and should be refreshed. The refresh token (if given) lasts until it is revoked.

  • call ./fairpost.js @userid setup-platform --platform=youtube
  • follow instructions from the command line

Test the platform

  • call ./fairpost.js @userid test-platform --platform=youtube

Connect the platform to another user

  • call ./fairpost.js create-user --user=foo
  • add youtube to its FAIRPOST_PLATFORMS

Get an OAuth2 Access Token for your other page

  • call ./fairpost.js @foo setup-platform --platform=youtube
  • follow instructions from the command line

Test the other installation

  • call ./fairpost.js @foo test-platform --platform=youtube

More user settings

  • YOUTUBE_PRIVACY = public | private | unlisted
  • YOUTUBE_CATEGORY = valid youtube category id
  • YOUTUBE_PLUGIN_SETTINGS - a json object describing / overwriting the plugins used to prepare posts

Limitations

Refresh token

As long as your app is in testing status, Refresh Tokens will expire every 7 days - https://stackoverflow.com/a/69142542/95733

Video

Supported Formats

Accepted Media MIME types: video/*, application/octet-stream

File Size

Maximum file size: 256GB

Random documentation

https://developers.google.com/youtube/v3

https://developers.google.com/youtube/v3/docs/videos/insert

https://developers.google.com/youtube/v3/docs/videos#resource

https://developers.google.com/youtube/v3/guides/auth/installed-apps#chrome

https://blog.hubspot.com/website/how-to-get-youtube-api-key

scopes https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/youtube.readonly https://www.googleapis.com/auth/youtube.upload

https://googleapis.dev/nodejs/googleapis/latest/slides/

https://pixelswap.fr/entry/how-to-upload-a-video-on-youtube-with-nodejs/

https://stackoverflow.com/questions/65258438/how-to-upload-video-to-youtube-using-google-api-without-libraries

https://developers.google.com/youtube/terms/required-minimum-functionality

https://cloud.google.com/nodejs/docs/reference/google-auth-library/latest/google-auth-library/oauth2client

refreshAccessToken(callback) refreshToken(refreshToken) refreshTokenNoCache(refreshToken) getAccessToken() isTokenExpiring()

https://googleapis.dev/nodejs/google-auth-library/9.8.0/#oauth2

https://google-auth.readthedocs.io/en/stable/reference/google.oauth2.credentials.html https://googleapis.dev/nodejs/google-auth-library/8.5.2/interfaces/Credentials.html https://googleapis.dev/nodejs/google-auth-library/8.5.2/interfaces/GetAccessTokenResponse.html