Youtube video upload using ubuntu command line

Youtube-upload is a command line script that using to upload a videos to your youtube account. This tool runs using Python

Where to download

click here to download youtube-upload

$ tar xvzf youtube-upload-VERSION.tgz
$ cd youtube-upload-VERSION
$ sudo python install


Before installing youtube-upload tool you must need to install  Python 2.6 or 2.7 and Python-gdata(>=1.2.4)

without installing python-gdata you get error like this

Traceback (most recent call last):
 File "", line 3, in 
 from youtube_upload import VERSION
 File "/home/vinoth/youtube_upload/youtube-upload-0.7.3/youtube_upload/", line 1, in 
 from youtube_upload import * 
 File "/home/vinoth/youtube_upload/youtube-upload-0.7.3/youtube_upload/", line 48, in 
ImportError: No module named

install python-gdata

What is python-gdata?

Python-gdata – Google Data Python client library

  • Distribution: Ubuntu 14.04.2 LTS
  • Repository: Ubuntu Universe i386
  • Package name: python-gdata
  • Package version: 2.0.14-2
  • Package architecture: all
  • Package type: deb
  • Binary package: python-gdata_2.0.14-2_all.deb
  • Source package: python-gdata
  • Installed size: 2,93 MB
  • Download size: 447,12 KB
    The GData (Google data) APIs provide a simple protocol for reading and writing data on the web.
    Each of the following Google services provides a Google data API:
    Base, Blogger, Calendar, Code Search, Contacts, Document List, Google Apps Provisioning, Notebook, Picasa Web Albums, Spreadsheets & YouTube.
    The Google data Python client library provides a library and source
    code that make it easy to access data through Google data APIs.
$sudo apt-get update
$sudo apt-get install python-gdata

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required: corosync libcfg6 libcmap4 libcorosync-common4 libcpg4 libibverbs1 libqb0
libquorum5 librdmacm1 libsam4 libtotem-pg5 libvotequorum6 libzookeeper-mt2
Use 'apt-get autoremove' to remove them.
Suggested packages: python-gdata-doc
The following NEW packages will be installed: python-gdata
0 upgraded, 1 newly installed, 0 to remove and 526 not upgraded.
Need to get 466 kB of archives.
After this operation, 2,856 kB of additional disk space will be used.
Get:1 trusty/universe python-gdata all 2.0.18+dfsg-1 [466 kB]
Fetched 466 kB in 30s (15.1 kB/s)
Selecting previously unselected package python-gdata.
(Reading database ... 237282 files and directories currently installed.)
Preparing to unpack .../python-gdata_2.0.18+dfsg-1_all.deb ...
Unpacking python-gdata (2.0.18+dfsg-1) ...
Setting up python-gdata (2.0.18+dfsg-1) ...

python-gdata module installed successfully.

Then again run this command inside the folder of youtube-upload

$ sudo python install

running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/youtube_upload
copying youtube_upload/ -> build/lib.linux-x86_64-2.7/youtube_upload
copying youtube_upload/ -> build/lib.linux-x86_64-2.7/youtube_upload
running build_scripts
creating build/scripts-2.7
copying and adjusting bin/youtube-upload -> build/scripts-2.7
changing mode of build/scripts-2.7/youtube-upload from 644 to 755
running install_lib
creating /usr/local/lib/python2.7/dist-packages/youtube_upload
copying build/lib.linux-x86_64-2.7/youtube_upload/ -> /usr/local/lib/python2.7/dist-packages/youtube_upload
copying build/lib.linux-x86_64-2.7/youtube_upload/ -> /usr/local/lib/python2.7/dist-packages/youtube_upload
byte-compiling /usr/local/lib/python2.7/dist-packages/youtube_upload/ to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/youtube_upload/ to youtube_upload.pyc
running install_scripts
copying build/scripts-2.7/youtube-upload -> /usr/local/bin
changing mode of /usr/local/bin/youtube-upload to 755
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/youtube_upload-0.7.3.egg-info

youtube upload tool is install successfully

Some Examples

$ youtube-upload --password=mypassword \
                 --title="A.S. Mutter" --description="A.S. Mutter plays Beethoven" \
                 --category=Music --keywords="mutter, beethoven" anne_sophie_mutter.flv

$youtube-upload --password=****** --title="Myvideo" --description="$(my video )" --category=Music --keyword="MYvideo" sample.mp4

my: command not found
Login to Youtube API:', password='*********'
Start upload using a HTTP post: sample.mp4 ->
Install python-progressbar to see a nice progress bar

$sudo pip install progressbar

Downloading/unpacking progressbar
 Downloading progressbar-2.2.tar.gz
 Running (path:/tmp/pip_build_root/progressbar/ egg_info for package progressbar
Installing collected packages: progressbar
 Running install for progressbar
Successfully installed progressbar
Cleaning up...

Thanks to Google code.

I hope you this blog is helpful for you 😀