This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
def time_to_seconds(date1, date2): | |
timedelta = date2 - date1 | |
return timedelta.days * 24 * 3600 + timedelta.seconds | |
def human_time(seconds): | |
minutes, seconds = divmod(seconds, 60) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import urllib.request | |
import os | |
def update_from_github(github_username, github_repo, github_asset, local_directory): | |
github_repo_url = 'https://github.com/{}/{}/releases/latest'.format(github_username, github_repo) | |
github_asset_url = requests.get(github_repo_url).url.replace('tag', 'download') + '/' + github_asset | |
destination = os.path.join(local_directory, github_asset) | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
:: Configuration variables | |
set "game_save_folder=C:\Users\perso\OneDrive\Documents\My Games\Starfield\Saves" | |
set "backup_folder=E:\.saves" | |
set "wait_minutes=10" | |
set "task_name=BackupStarfield" | |
goto start |