This is share svg Share this item

YouTube Upload (CLI)

Scripted uploads to Youtube

upload video files from local disk or from the web.
ratelimit upload bandwidth

youtubeuploader command added to NAS $PATH


Youtube API
Talking to the Youtube API requires oauth2 authentication. As such, you must:

Create an account on the Google Developers Console
Register a new app there
Enable the Youtube API (APIs & Services -> Enable APIs and Services)
Create Client ID (APIs & Auth -> Credentials -> Create Credentials), select 'Oauth client ID', select type 'Web application'
Add an 'Authorized redirect URI' of 'http://localhost:8080/oauth2callback'
Download the client secrets JSON file (click download icon next to newly created client ID) and save it as file client_secrets.json in the same directory as the utility e.g.

"web": {
"client_id": "",
"project_id": "youtubeuploader-yyyyy",
"auth_uri": "",
"token_uri": "",
"auth_provider_x509_cert_url": "",
"client_secret": "xxxxxxxxxxxxxxxxxxxx",
"redirect_uris": [


At a minimum, just specify a filename:

./youtubeuploader -filename blob.mp4
If it is the first time you've run the utility, a browser window should popup and prompt you to provide Youtube credentials. A token will be created and stored in request.token file in the local directory for subsequent use. To run the utility on a headless-server, generate the token file locally first, then simply copy the token file along with youtubeuploader and client_secrets.json to the remote host.

Full list of options:

-cache string
token cache file (default "request.token")
-caption string
caption filename. Can be a URL
-categoryId string
video category Id
-chunksize int
size (in bytes) of each upload chunk. A zero value will cause all data to be uploaded in a single request (default 16777216)
-description string
video description (default "uploaded by youtubeuploader")
-filename string
video filename. Can be a URL. Read from stdin with '-'
set this if no browser available for the oauth authorisation step
-language string
video language (default "en")
-limitBetween string
only rate limit between these times e.g. 10:00-14:00 (local time zone)
-metaJSON string
JSON file containing title,description,tags etc (optional)
-metaJSONout string
filename to write uploaded video metadata into (optional)
notify channel subscribers of new video (default true)
-oAuthPort int
TCP port to listen on when requesting an oAuth token (default 8080)
-privacy string
video privacy status (default "private")
suppress progress indicator
-ratelimit int
rate limit upload in Kbps. No limit by default
-secrets string
Client Secrets configuration (default "client_secrets.json")
-tags string
comma separated list of video tags
-thumbnail string
thumbnail filename. Can be a URL
-title string
video title
show version

Your gratitude and finance will help me to continue integration of this QPKG and maintain up to date versions.

Contact the Author

No older version