Designed for capturing presentations at conferences. Pre-fill a list of talks to record, record them, and upload them to YouTube with our YouTube Uploader.
import itertools
import os
import sys
def is_valid_video(filepath):
return filepath.endswith('.gif')
def gather_files(path):
if os.path.isdir(path):
for base, _, filenames in os.walk(path):
for filename in filenames:
yield os.path.join(base, filename)
else:
yield path
def gather_videos(paths):
unique_paths = set(os.path.abspath(path) for path in paths)
filepaths = itertools.chain.from_iterable(gather_files(path) for path in unique_paths)
for filepath in filepaths:
if is_valid_video(filepath):
yield filepath
if __name__ == '__main__':
for filepath in gather_videos(sys.argv[1:]):
print filepath
See the discussion on the mailing list.
@mtomwing recommended
Related to #529