1
1
mirror of https://github.com/mister-monster/YouTube2PeerTube.git synced 2024-11-22 03:54:16 -05:00
YouTube2PeerTube/utils.py

17 lines
437 B
Python
Raw Normal View History

2019-10-18 19:16:17 -04:00
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