ffmpeg -i in.m3u8 -acodec copy -bsf:a aac_adtstoasc -vcodec copy out.mp4
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
<?php | |
function gRS($length, $opt = '111') { | |
$r = ''; | |
//numbers only | |
$r .= ( ( (int) $opt[0] === 1) ? '012345678923456789' : ''); | |
//numbers with small letters | |
$r .= ( ( (int) $opt[1] === 1) ? 'abcdefghijklmnopqrstuvwxyz' : ''); | |
//numbers with small and capital letters | |
$r .= ( ( (int) $opt[2] === 1) ? 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' : ''); |
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
<# | |
.SYNOPSIS | |
Batch rename files with regex replace | |
.DESCRIPTION | |
BATCHREGEX makes it easy to batch rename your files using regex. Supply the directory of the files you need to rename; supply the regex expression you want applyp; | |
supply the new file names (including capturing groups as `$1, `$2, etc.; please note the backtick). Some experience with regex would be nice before using this. | |
Please note that the default mode for $safe_mode = 1, which means that it will show what happens when you'd rename the files but it will NOT execute the command. | |
When setting $safe_mode = 0, your regex will be executed so there's no turning back... | |
.EXAMPLE | |
In the following examples, pretend we have the following files "MyAwesomeVideo - 01 (somerubbish).mp4",..., "MyAwesomeVideo - 50 (somerubbish).mp4" |
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
# The directory of the ASS files that need to be cleaned | |
$dir = "C:\Users\Kintoki\Desktop\ASS_files" | |
$files = Get-ChildItem "$dir" | Where-Object {$_.Extension -eq ".ass"} | |
#Start batch loop | |
for ($i=0; $i -lt $files.Count; $i++) { | |
$subs = $files[$i].FullName | |
$ASS = Get-Content -LiteralPath $subs | |
Write-Host ('>> File: ' + $files[$i].BaseName) | |
#Remove non-used styles |
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
# Use FFprobe to get file metadata, e.g. streams, tags, etc., in JSON format | |
import json | |
import subprocess as sp | |
def get_file_metadata(input_file): | |
return json.loads(sp.check_output(["ffprobe","-v","quiet","-print_format","json","-show_streams","-show_format",input_file]).decode('utf-8')) | |
file_metadata = get_file_metadata(r"D:\hello_world.mp4") |
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
# "Automatically" adds font but for some reason it still needs user interaction when the file already exists | |
function addNewFonts{ | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$dir | |
) | |
if($dir[-1] -ne [IO.Path]::DirectorySeparatorChar){$dir = $dir + [IO.Path]::DirectorySeparatorChar} | |
$fonts = (New-Object -ComObject Shell.Application).Namespace(0x14) | |
Get-ChildItem -Path ($dir + '*') -Include @('*.ttf','*.otf') | % { $fonts.CopyHere($_.fullname, 16) } |
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
# Change metadata like Title, Comment, Description, by using Exiftool | |
# Tested with ExifTool 11.98 on Win10 and Ubuntu 18.04 | |
import subprocess as sp | |
def change_file_metadata(input_file, meta_dict={'-Title':'','-Comment':''}): | |
return sp.check_output(["exiftool", "-api", "largefilesupport=1", "-overwrite_original"] + [ '{}={}'.format(k,v) for k, v in meta_dict.items() ] + [input_file]) | |
change_file_metadata(r"D:\hello_world.mp4",{'-Title':'Hello Darkness','-Comment':'My Old Friend'}) | |
# b' 1 image files updated\r\n' |
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
[CmdletBinding()] | |
<# | |
.SYNOPSIS | |
Create a random string of alphanumeric characters | |
.DESCRIPTION | |
This function creates a random string of alphanumeric characters. | |
Alphanumeric characters are put into an array, joined, randomly picked and shuffled once more. | |
.PARAMETER length | |
The length of the random string to be returned. |
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
<?php | |
class MailJetAPI{ | |
/* | |
* Simpel MailJet mailer with the v3 API | |
*/ | |
private const BASE_URL = 'https://api.mailjet.com/v3.1/send'; | |
private $key; | |
private $secret; |
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
<?php | |
class OneWayEncryption{ | |
/* | |
* One way encryption; hash + salt | |
*/ | |
private const COST = '14'; | |
private function uniqueSalt() { |
OlderNewer