Commit 8cc4b6e5 authored by Tony Mai's avatar Tony Mai

add scripts

parent 23246920
...@@ -2,13 +2,13 @@ from setuptools import setup ...@@ -2,13 +2,13 @@ from setuptools import setup
with open("README.md", "r") as fh: with open("README.md", "r") as fh:
long_description = fh.read() long_description = fh.read()
setup(name='goprocam', setup(name='goprocam',
version='3.0.3', version='3.0.4',
description='GoPro WiFi API Wrapper for Python - Compatible with HERO3, HERO3+, HERO4, HERO5, HERO+, HERO6', description='GoPro WiFi API Wrapper for Python - Fusion ',
url='http://github.com/konradit/gopro-py-api', url='http://gitfolder.com/tonymai/gopro',
long_description=long_description, long_description=long_description,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
author='Konrad Iturbe', author='Konrad Iturbe',
author_email='mail@chernowii.com', author_email='mail@tonymai@mobiusmail.com',
license='MIT', license='MIT',
packages=['goprocam'], packages=['goprocam'],
zip_safe=False) zip_safe=False)
#!/usr/bin/python3
from goprocam import GoProCamera
from goprocam import constants
import os
import sys
import re
import time
if len(sys.argv) < 2:
print ("Usage cp_fusion_files.py <destination directory> ")
exit()
file_path = sys.argv[1]
print ("file_path: " + file_path)
gpCam = GoProCamera.GoPro()
gpCam.pair(usepin=False)
#gpCam.pair(usepin=True)
if not os.path.exists(file_path):
os.makedirs(file_path);
print ("Start...")
localtime = time.asctime( time.localtime(time.time()) )
start_time = time.time()
print ("Start time :", localtime)
gpCam.overview()
#print(gpCam.getMedia())
#print(gpCam.getMediaInfo("file"))
gpCam.listMedia(True)
#exit()
data=gpCam.listMedia(True,True)
for i in data:
folder=i[0]
if not os.path.exists(file_path+"/"+folder):
os.makedirs(file_path+"/"+folder);
mp4_file=i[1]
lrv_file=re.sub(".MP4",".LRV",mp4_file)
print("copy "+folder+"/"+mp4_file+" to "+file_path);
gpCam.downloadMedia(folder,mp4_file,file_path+"/"+folder+"/"+mp4_file)
print("copy "+folder+"/"+lrv_file+" to "+file_path);
gpCam.downloadMedia(folder,lrv_file,file_path+"/"+folder+"/"+lrv_file)
if re.search("GPBK",mp4_file) or re.search("GB",mp4_file):
wav_file=re.sub(".MP4",".WAV",mp4_file)
#print("copy "+folder+"/"+wav_file+" to "+file_path);
gpCam.downloadMedia(folder,wav_file,file_path+"/"+folder+"/"+wav_file)
if re.search("GPBK",mp4_file):
thm_file=re.sub(".MP4",".THM",mp4_file)
#print("copy "+folder+"/"+thm_file+" to "+file_path);
gpCam.downloadMedia(folder,thm_file,file_path+"/"+folder+"/"+thm_file)
if re.search("GPFR",mp4_file):
thm_file=re.sub(".MP4",".THM",mp4_file)
#print("copy "+folder+"/"+thm_file+" to "+file_path);
gpCam.downloadMedia(folder,thm_file,file_path+"/"+folder+"/"+thm_file)
print ("Done")
localtime = time.asctime( time.localtime(time.time()) )
elapsed_time = time.time() - start_time
print ("End time :", localtime)
print ("Elapse time :", elapsed_time)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment