Examples
youtube-upload --title="A.S. Mutter" anne_sophie_mutter.flv
./youtubeuploader -filename blob.mp4
tokland/youtube-upload
Command-line script to upload videos to Youtube using theYoutube APIv3. It should work on any platform (GNU/Linux, BSD, OS X, Windows, …) that runs Python.
Install
$ sudo pip install --upgrade google-api-python-client oauth2client progressbar2
$ wget https://github.com/tokland/youtube-upload/archive/master.zip
$ unzip master.zip
$ cd youtube-upload-master
$ sudo python setup.py install
Setup
The package used to include a default client_secrets.json
file. It does not work anymore, Google has revoked it. So you now must create and use your own OAuth 2.0 file, it’s a free service. Steps:
- Go to the Google console.
- Create project.
- Side menu: APIs & auth -> APIs
- Top menu: Enabled API(s): Enable all Youtube APIs.
- Side menu: APIs & auth -> Credentials.
- Create a Client ID: Add credentials -> OAuth 2.0 Client ID -> Other -> Name: youtube-upload -> Create -> OK
- Download JSON: Under the section “OAuth 2.0 client IDs”. Save the file to your local system.
Use this JSON as your credentials file: –client-secrets=CLIENT_SECRETS or copy it to ~/client_secrets.json.
GitHub tokland / youtube-upload
porjo/youtubeuploader
Scripted uploads to youtube.
- upload video files from local disk or from the web.
- ratelimit upload bandwidth
It has precompiled binary for Linux, Mac or Windows.
Setup
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 & Auth -> APIs)
- Create Client ID (APIs & Auth -> Credentials), select ‘Web application’
- Add an ‘Authorized redirect URI’ of ‘http://localhost:8080/oauth2callback'
- Take note of the Client ID and Client secret values
The utility looks for client_secrets.json in the local directory. Create it first using the details from above:
{ "installed": { "client_id": "xxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com", "client_secret": "xxxxxxxxxxxxxxxxxxxxx", "redirect_uris": ["http://localhost:8080/oauth2callback"], "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://accounts.google.com/o/oauth2/token" } }
Update client_id
and client_secret
to match your details
- GitHub porjo / youtubeuploader