Skip to content

Instantly share code, notes, and snippets.

@ibebrett
Created October 31, 2014 18:09
Show Gist options
  • Save ibebrett/241dc3014c4248cb8b79 to your computer and use it in GitHub Desktop.
Save ibebrett/241dc3014c4248cb8b79 to your computer and use it in GitHub Desktop.
import argparse
import hashlib
from videoads import VideoCreative
def main(path):
new_path = '{0}-converted'.format(path)
VideoCreative.convert(path, new_path)
phash_key = '1-md5-%s' % hashlib.md5(unicode(VideoCreative.video_phash(new_path, 2))).hexdigest()
print phash_key
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('path')
args = parser.parse_args()
main(args.path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment