Scripting way to upload videos to peertube and youtube
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
707 B

  1. from os.path import join, abspath, isfile, dirname, exists
  2. from os import listdir
  3. from shutil import copyfile
  4. import logging
  5. logger = logging.getLogger('Prismedia')
  6. from . import utils
  7. def genconfig():
  8. path = join(dirname(__file__), 'config')
  9. files = [f for f in listdir(path) if isfile(join(path, f))]
  10. for f in files:
  11. final_f = f.replace(".sample", "")
  12. if exists(final_f) and not utils.ask_overwrite(final_f + " already exists. Do you want to overwrite it?"):
  13. continue
  14. copyfile(join(path, f), final_f)
  15. logger.info(str(final_f) + " correctly generated, you may now edit it to fill your credentials.")
  16. if __name__ == '__main__':
  17. genconfig()