Sidirius / youtube-upload

Automatically exported from code.google.com/p/youtube-upload
0 stars 0 forks source link

= Introduction =

Youtube-upload is a command-line script that uploads videos to Youtube. If a video does not comply with Youtube limitations (<15mins for a normal user) you must split it before using ffmpeg or any other tool. Youtube-upload should work on any platform (GNU/Linux, BSD, OS X, Windows, ...) that runs Python.

= Dependencies =

Note: You must have logged in at least once into your Youtube account prior to uploading any videos.

= Download & Install =

{{{ $ wget http://youtube-upload.googlecode.com/files/youtube-upload-VERSION.tgz $ tar xvzf youtube-upload-VERSION.tgz $ cd youtube-upload-VERSION $ sudo python setup.py install }}}

{{{ $ svn checkout http://youtube-upload.googlecode.com/svn/trunk/ youtube-upload $ cd youtube-upload $ sudo python setup.py install }}}

{{{ $ cd youtube-upload-VERSION $ python youtube_upload/youtube_upload.py ... }}}

= Usage examples =

{{{ $ youtube-upload --email=myemail@gmail.com --password=mypassword \ --title="A.S. Mutter" --description="A.S. Mutter plays Beethoven" \ --category=Music --keywords="mutter, beethoven" anne_sophie_mutter.flv www.youtube.com/watch?v=pxzZ-fYjeYs }}}

{{{ $ youtube-upload --email=myemail@gmail.com --password=mypassword \ --title="A.S. Mutter" --description="$(< \description.txt)" \ --category=Music --keywords="mutter, beethoven" anne_sophie_mutter.flv www.youtube.com/watch?v=pxzZ-fYjeYs }}}

{{{ $ youtube-upload --api-upload [OTHER OPTIONS] file.flv }}}

If you set explicitly the {{{--api-upload}}} options or {{{pycurl}}} isn't installed, the original Youtube API will be used to upload the video file. This method is not recommended because it does not shows the nice progressbar.

{{{ $ youtube-upload [OPTIONS] --title="TITLE" video.part1.avi video.part2.avi www.youtube.com/watch?v=pxzZ-fYjeYs # title: TITLE [1/2] www.youtube.com/watch?v=pxzZ-fYsdff # title: TITLE [2/2] }}}

{{{ $ youtube-upload [OPTIONS] --add-to-playlist=http://gdata.youtube.com/feeds/api/playlists/7986C428284A40A1 http://www.youtube.com/watch?v=Zpqu97l3G1U }}}

Note that the argument must be the video URL (not a local file) and the playlist is the URL of the feed (with no prefix "PL").

{{{ $ youtube-upload --get-categories Tech Education Animals People Travel Entertainment Howto Sports Autos Music News Games Nonprofit Comedy Film }}}

Youtube currently limits videos to <2Gb and <15' for almost all users. You can use the Bash example script to split it before uploading:

{{{ $ bash examples/split_video_for_youtube.sh video.avi video.part1.avi video.part2.avi video.part3.avi }}}

The script uses pycurl by default (when available) to upload the video, but if you need to tweak the upload parameters take a look at the Bash script included with the sources ([http://code.google.com/p/youtube-upload/source/browse/trunk/examples/upload_with_curl.sh examples/upload_with_curl.sh]). This command, for example, would upload somevideo.flv with a limit rate of 100KBytes:

{{{ $ youtube-upload --get-upload-form-info [OPTIONS] | bash examples/upload_with_curl.sh --limit-rate 100k }}}

{{{ $ youtube-upload --private ... }}}

{{{ $ youtube-upload --unlisted ... }}}

{{{ $ cat password.txt | youtube-upload -p - .... }}}

Set environment variables http_proxy and https_proxy:

{{{ $ export http_proxy=http://user:password@host:port $ export https_proxy=http://user:password@host:port $ youtube-upload ....

}}}

Set new title for video:

{{{ $ youtube-upload --email=EMAIL --password=PASSWORD --update-metadata --title "new title" www.youtube.com/watch?v=pxzZ-fYjeYs }}}

= Caveats =

== Validate your credentials == Before you upload a video using the script, do it manually to make sure everything is ok (you have a valid user/password and an associated channel). See issue57 for more details.

== Using two-step verification ==

If you are using [https://support.google.com/accounts/answer/180744?hl=en two-step verification] issue an application-specific password and use it in the script as if it was your real password. See [https://code.google.com/p/youtube-upload/issues/detail?id=111 issue111] for more details.

== Sign in using App Passwords ==

An App password is a 16-digit passcode that gives an app or device permission to access your Google Account. If you use 2-Step-Verification and are seeing a “password incorrect” error when trying to access your Google Account, an App password may solve the problem.

https://support.google.com/accounts/answer/185833?hl=en

== Progressbar ==

You need both packages python-progressbar and pycurl installed to see the progress bar when uploading a video.

= Feedback =

Use the [http://code.google.com/p/youtube-upload/issues/ issues tracker] to report bugs or suggest improvements.