Skip to content

Instantly share code, notes, and snippets.

@rytsikau
rytsikau / YTchannel2json.bat
Last active September 16, 2022 05:39
Saves information about the videos on the requested YouTube channel to a JSON file
@echo off
rem Saves information about the videos on the requested YouTube channel to a JSON file
set YTDLP="c:\Program Files\yt-dlp\yt-dlp.exe"
set OUTPUT_FOLDER="d:\My Files\"
set TM=%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
set TM=%TM: =0%
set DT=_%Date:~6,4%%Date:~3,2%%Date:~0,2%-%TM%
for %%i in (%OUTPUT_FOLDER%) do (set OUTPUT_FOLDER=%%~di%%~pi%DT%\)
@rytsikau
rytsikau / FirefoxBookmarksConverter.ps1
Created December 12, 2021 17:19
Convert Firefox bookmarks file (JSON format) to plain text
'--------------------------------------------------------------------------------------------------'
' Convert Firefox bookmarks file (JSON format) to plain text (v.20211212) '
'--------------------------------------------------------------------------------------------------'
set-executionpolicy unrestricted -scope currentuser
$erroractionpreference = "silentlycontinue"; remove-variable *; $erroractionpreference = "continue"
$inputFile = "bookmarks.json"
$outputFile = "bookmarks.txt"
$separator = "`t"
@rytsikau
rytsikau / ee.fastvid.ps1
Last active December 12, 2021 17:18
Simple video recompress + crop, resize, deinterlace and set aspect ratio
'--------------------------------------------------------------------------------------------------'
' ee.fastvid (v.20211211) Simple video crop, resize, deinterlace and set the aspect ratio '
'--------------------------------------------------------------------------------------------------'
set-executionpolicy unrestricted -scope currentuser
$erroractionpreference = "silentlycontinue"; remove-variable *; $erroractionpreference = "continue"
$ffmpegDir = "p:\!programs\!consoles\ffmpeg"
$outputDir = "c:\!downloads"
$outputFormat = ".mp4"
$audioCompress = "-c:a aac"
$videoCompress = "-c:v h264_qsv -q:v 22"
@rytsikau
rytsikau / ffmpeg_audiorecorder.bat
Created April 8, 2021 11:07
Simple voice audio recording on Windows PC
@echo off
set DIROUTPUT="d:\Recordings"
set FFMPEG="c:\Program Files\FFmpeg\ffmpeg.exe"
rem TO LIST AVAILABLE DEVICES:
rem %FFMPEG% -hide_banner -list_devices true -f dshow -i dummy
rem pause & exit
rem SET DEVICE NAME:
@rytsikau
rytsikau / curl_download.bat
Created April 8, 2021 07:51
Fast file download with Curl
@echo off
set OUTPUTFOLDER="d:\downloads"
set CURL="c:\Program Files\Curl\curl.exe"
set /p URL=Enter URL:
set TM=%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
set TM=%TM: =0%
set OUTPUT="%OUTPUTFOLDER%\%Date:~6,4%%Date:~3,2%%Date:~0,2%-%TM%.dat"
%CURL% -L "%URL%" --remote-time -o %OUTPUT%
@rytsikau
rytsikau / renameFoldersWithItsLastEditDates.ps1
Last active November 8, 2020 07:25
Renames folders with the last write time of their most recent files
'-------------------------------------------------------------------------------------------------'
' renameFoldersWithItsLastEditDates (2020-11-08) '
' Renames folders with the last write time of their most recent files '
' [directoryName] -> [directoryName]_[YYYYMMDD-HHmmss] '
'-------------------------------------------------------------------------------------------------'
Set-ExecutionPolicy Unrestricted -Scope CurrentUser
$erroractionpreference = "SilentlyContinue"; Remove-Variable *; $erroractionpreference = "Continue"
$pathWithFoldersToRename = "c:\FoldersToRename\"
@rytsikau
rytsikau / mediafiles_info.ps1
Last active September 4, 2020 07:18
Get media info for *.mp4 files with FFprobe and standard Windows shell
"--------------------------------------------------"
set-executionpolicy unrestricted -scope currentuser
$erroractionpreference = "silentlycontinue"; remove-variable *; $erroractionpreference = "continue"
$objShell = new-object -comobject shell.application
$folderFFprobe = "C:\Program Files\FFmpeg"
$folderMedia = "D:\My Documents"
"Get media info for *.mp4 files with FFprobe and standard Windows shell"
"Folder: $folderMedia"
"--------------------------------------------------"
@rytsikau
rytsikau / list_files_in_zips.ps1
Created July 16, 2020 06:25
Listing files contained inside zip archives of a specified folder
#------------------------------------------------------------------------------
# Listing files contained inside zip archives of a specified folder
#------------------------------------------------------------------------------
#<#----------------------------------------------------------------------------
function ListFilesInZips ([string]$inputFolder)
{
add-type -assembly System.IO.Compression.FileSystem
foreach ($zipFile in (get-childitem $inputFolder -filter '*.zip'))
@rytsikau
rytsikau / timelapse_video_maker.bat
Last active July 15, 2020 17:45
This Windows batch script can make timelapse video with FFmpeg executable library. Source video fullname needs as an argument
@echo off
set FOLDEROUTPUT=c:\output
set FOLDERFFMPEG=c:\programs\ffmpeg
set VIDEOPRESET_1=-preset ultrafast
set VIDEOPRESET_2=-vcodec h264_qsv -q 20
if [%1]==[] goto noargument
:begin
cls