Andreas Demmelbauer 3 роки тому
джерело
коміт
100f8ad6e8
1 змінених файлів з 6 додано та 5 видалено
  1. +6
    -5
      demotape.py

+ 6
- 5
demotape.py Переглянути файл

@@ -126,7 +126,7 @@ def download_stream(channel, dest_path):


def process_channel(channel):
#logging.info('entered function process_channel with ' + channel['name'])
logging.info('entered function process_channel with ' + channel['name'])
while True:

logging.info(timestamp() + ' checking ' + channel['name'])
@@ -159,17 +159,18 @@ def upload_video(videofile_path):
# Upload to cloud using webdav
result = os.system('curl -L -u %s -T "%s" "%s"' % (credentials, videofile_path, webdav_url))
if result == 0: # exit code
logging.info('Uploaded sucessfully %s to %s' % (filename, webdav_url))
delete_video(videofile_path)
return True
except:
logging.info('Error while uploading %s to %s' % (file, webdav_url))
logging.info('Error while uploading %s to %s' % (filename, webdav_url))

def delete_video(file):
try:
logging.info('Deleting Video %s' % (file))
os.system('rm -rf "%s"' % (file))
return True
result = os.system('rm -rf "%s"' % (file))
if result == 0: # exit code
logging.info('Deleted sucessfully {}'.format(file))
except:
logging.info('Error while deleting %s' % (file))



Завантаження…
Відмінити
Зберегти