Tutorial- video uploading for mac users.
We Mac users are a minority here and can't use the normal uploading procedure for PC users. Fortunately, our Admin has come up with a relatively easy method for us Mac types. It may seem a little involved at first but after 1 or 2 times it is not a big deal at all.
1. First, you must have Python installed in your system. It's probably already on your computer- if you open the Terminal application and type "python" (without the quotes) it will return a message with the current version number of Python that is installed. If it isn't there or is older than 3.1.2 then you may want to download it from here: http://www.python.org/ftp/python/3.1.2/ ... -03-24.dmg
This is the latest version as of April 2010.
2. You will need the Uploader Script that admin created. in the text box and paste it into a plain
text file. Name it video_setup.py
# ChessVideos.TV Video Upload Helper
# Author: Dan Birken
# Copyright (c) ChessVideos.TV
# Version 0.2
VALID_EXTENSIONS = ('mov', 'avi', 'wmv')
f = open(filename, 'rb')
filehash = md5.md5()
def get_safe_number(desc, min, max):
value = raw_input(desc)
if check_number(value, min, max):
def check_number(num_string, min, max):
return max >= int(num_string) >= min
if len(sys.argv) != 2:
print "Error, expects video_setup.py [video file]"
ext = sys.argv[-3:]
if ext not in VALID_EXTENSIONS:
print "Error, files extension must be one of %s" % VALID_EXTENSIONS
# Now lets make sure it exists
if not os.path.exists(sys.argv):
print "Error, Given file does not exist."
# Input username and password
username = raw_input('Input your forum username: ')
password = getpass.getpass('Input your forum password: ')
title = raw_input('Input the title of the video: ')
while len(title) > 40 or len(title) < 10:
title = raw_input('(Title must be between 10-40 chars) '
'Input the title of the video: ')
tags = raw_input('Input a list of tags for this video '
'(use commas for multiple tags): ')
level = get_safe_number('Input the level of your video: \n'
type = get_safe_number('Input the type of video: \n'
'(0) Live Commentary\n'
'(1) Dual Commentary\n'
'(2) Game Analysis\n'
'(6) Chess Puzzle\n',
color = get_safe_number('Input your color: \n'
'(2) N/A or doesn\'t matter\n',
file_hash = hash_file(sys.argv)
passhashobj = md5.md5()
pass_hash = passhashobj.hexdigest()
out_file = [title, username, pass_hash, level, file_hash,
'EXT', type, '', tags, color, '']
# Generate a nice StringIO for the metadata
metadata = StringIO.StringIO('\n'.join(out_file))
print 'Video metadata created, attempting to upload...'
out_hash = file_hash + str(int(time.time()))
remote_metadata = out_hash + '.%s.info' % ext
local_file = sys.argv
remote_file = out_hash + '.%s' % ext
ftp = ftplib.FTP('www.chessvideos.tv')
print 'Connected to chessvideos.tv...'
ftp.storlines('STOR %s' % remote_metadata, metadata)
print 'Metadata uploaded successfully, uploading video file.'
print 'This may take a while, so be patient.'
ftp.storbinary('STOR %s' % remote_file, open(local_file, 'rb'))
print 'Video uploaded successfully.'
3. After copying and pasting the script into a plain text file, create a new folder on your desktop named "CV" (again without the quotes). Put the script into this folder.
4. Record your video (quicktime movie or AVI are good formats- I recommend QT as it uses smaller file sizes and is quicker to upload). There are a number of screen capture utilities that will work. Personally, I use IShowU
which is excellent though it is a commercial product.
5. Drag your completed movie into the "CV" folder you created earlier. Let's assume that the file name of the video you created is "mychessvideo.mov" .
6. Open the Terminal application. Type "cd desktop/cv" (without the quotes)
7. Now type "python video_setup.py mychessvideo.mov" (without the quotes) and press return. Naturally, you would alter what you type based on the actual filename of your video. It should look something like this (before you press return) :
8. If all has gone well, the terminal will prompt you for your forum username and password (from your chessvideos.tv account info). It will also prompt you for the name of the video- you can name it anything at this stage- it doesn't have to be the filename of the video.. What you type will be the title of the video as it appears on the forum.
9. It will prompt you for some further info on your video which is pretty self-explanatory. It will then give you a message shortly (depends on the size of the video) that your "video successfully uploaded"
10. Check out the new posts on the forum to see if it uploaded properly. Normally there is a delay before it is posted, again depending on the size of the video. It's not unusual for a large video to take 30 minutes or more before it shows up on the site so don't despair if it doesn't show up right away.
OK this seems like a lot but after you have laid the groundwork it's basically this:
1. Make video. Drag to "CV" folder
2. Open terminal and perform steps 6, 7 and 8 above. That's pretty much it. I tried to make this tutorial idiot-proof which accounts for the number of steps involved- if you still have questions, or I left something out, please post your question here and I will reply promptly as possible.