...the proper way
Stuff in the following sections should be done prior installing Python on the machine.
| # ====================================================================================================================== | |
| # EditorConfig is awesome: https://EditorConfig.org | |
| # ---------------------------------------------------------------------------------------------------------------------- | |
| # | |
| # Must be specified in the preamble. Set to "true" to stop the .editorconfig file search on the current file. The value is case insensitive. | |
| # root = true | |
| # | |
| # Set to "latin1", "utf-8", "utf-8-bom", "utf-16be" or "utf-16le" to control the character set. Use of "utf-8-bom" is discouraged. | |
| # charset = utf-8 | |
| # |
| # ========================================================================= | |
| # Instructions: How to install and configure 'yt-dlp' on Windows 10 machine | |
| # | |
| # NOTE: Lines starting with # are treated as comments | |
| # ------------------------------------------------------------------------- | |
| # | |
| # | |
| # ========================================================================= | |
| # Part I. "Install Prerequisites" | |
| # ------------------------------------------------------------------------- |
| """Encoders for 'any' type of data that is not supported by default (+tests).""" | |
| import datetime | |
| import decimal | |
| import enum | |
| import inspect | |
| import ipaddress | |
| import json | |
| import pathlib | |
| import sqlite3 | |
| import textwrap |
| - Insert a USB flash drive into a running computer. | |
| - Open a Command Prompt window as an administrator. | |
| - Type `diskpart`. | |
| - In the new command line window that opens, to determine the USB flash drive number or drive letter, at the command prompt, type `list disk`, and then click ENTER. | |
| The list disk command displays all the disks on the computer. Note the drive number or drive letter of the USB flash drive. | |
| - At the command prompt, type `select disk <X>`, where X is the drive number or drive letter of the USB flash drive, and then click ENTER. |
| @echo off | |
| SETLOCAL | |
| For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set STAMP_DATE=%%c-%%a-%%b) | |
| For /f "tokens=1-4 delims=./" %%a in ("%TIME%") do (set STAMP_TIME=%%a%%b) | |
| set STAMP=%STAMP_DATE%_%STAMP_TIME% | |
| set STAMP=%STAMP::=_% | |
| set CHROME_TMP=%TMP%\chrome_tmp_%STAMP% |
| import atexit | |
| import logging | |
| import sys | |
| from abc import ABC | |
| from abc import abstractmethod | |
| from argparse import ArgumentParser | |
| from argparse import FileType | |
| from argparse import Namespace | |
| from typing import Optional |
| // build.gradle -> dependencies: | |
| // implementation 'org.slf4j:slf4j-api:1.7.30' | |
| // implementation 'org.slf4j:slf4j-log4j12:1.7.30' | |
| // implementation 'org.apache.commons:commons-lang3:3.10' | |
| // implementation 'commons-io:commons-io:2.7' | |
| import org.apache.commons.io.FileUtils; | |
| import org.apache.commons.lang3.exception.ExceptionUtils; | |
| import org.slf4j.Logger; |
| # Root logger option | |
| log4j.rootLogger=DEBUG, file, stdout | |
| # Direct log messages to a log file | |
| log4j.appender.file=org.apache.log4j.RollingFileAppender | |
| log4j.appender.file.File= execution.log | |
| log4j.appender.file.MaxFileSize=10MB | |
| log4j.appender.file.MaxBackupIndex=10 | |
| log4j.appender.file.layout=org.apache.log4j.PatternLayout | |
| log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %t [%c{1}:%L] %m%n | |
| # Direct log messages to stdout |