Skip to content

Commit

Permalink
adding mp4 extension so pysnap won't complain #18
Browse files Browse the repository at this point in the history
  • Loading branch information
agermanidis committed Mar 16, 2015
1 parent 04ca6c3 commit f9b316a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions snapchat_bots/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ def extract_zip_components(data):
filenames = os.listdir(unzip_dir)
for filename in filenames:
if filename.startswith("media"):
video_component = os.path.join(unzip_dir, filename)
old_video_path = os.path.join(unzip_dir, filename)
new_video_path = os.path.join(unzip_dir, "video.mp4")
os.rename(old_video_path, new_video_path)

elif filename.startswith("overlay"):
overlay_component = os.path.join(unzip_dir, filename)
return video_component, overlay_component

return new_video_path, overlay_component

def duration_string_to_timedelta(s):
[hours, minutes, seconds] = map(int, s.split(':'))
Expand Down

0 comments on commit f9b316a

Please sign in to comment.