1
1
mirror of https://github.com/mister-monster/YouTube2PeerTube.git synced 2024-11-10 15:47:56 -05:00
YouTube2PeerTube/utils.py
2019-10-18 23:16:17 +00:00

17 lines
437 B
Python

import toml
def read_conf(conf_file):
conf_file = open(conf_file)
conf = conf_file.read()
conf = toml.loads(conf)
conf_file.close()
return conf
def convert_timestamp(timestamp):
timestamp = timestamp.split('T')
date = timestamp[0].split('-')
time = timestamp[1].split('+')
time = time[0].split(':')
timestamp = int(date[0] + date[1] + date[2] + time[0] + time[1] + time[2])
return timestamp