mirror of
https://github.com/mr0xb/scripts.git
synced 2026-08-28 03:44:57 -04:00
.
This commit is contained in:
parent
62156a1d85
commit
e698f046c8
5 changed files with 183 additions and 0 deletions
11
media/handbrake/hand_loop.sh
Normal file
11
media/handbrake/hand_loop.sh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#/bin/bash
|
||||
|
||||
file=$1
|
||||
if [ -f "$file" ]; then
|
||||
while read -r line;
|
||||
do
|
||||
echo "" | ./handbrake.sh "$line"
|
||||
done < "$file"
|
||||
else
|
||||
echo "$file does not exist or is not a file!"
|
||||
fi
|
||||
18
media/handbrake/handbrake.sh
Normal file
18
media/handbrake/handbrake.sh
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#/bin/bash
|
||||
|
||||
file="$1"
|
||||
if [ -f "$file" ];
|
||||
then
|
||||
|
||||
output="${file##*/}"
|
||||
/usr/bin/HandBrakeCLI --preset-import-gui preset.json -map-metadata 0 -E mp3 -B 128 -b 1600 -e x265 -x vbv-maxrate=1600 -x vbv-bufsize=2200 -X 1920 -Y 1080 --audio-lang-list "eng" --subtitle-lang-list "eng" --all-subtitles -i "${file}" -o "${output%.*}.mkv"
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "would have moved $file to $file.old" >> log.txt
|
||||
echo "would have moved $output to $file" >> log.txt
|
||||
else
|
||||
echo "error with $file" >> error.txt
|
||||
fi
|
||||
else
|
||||
echo "$file not found!" >> error.log
|
||||
fi
|
||||
112
media/handbrake/preset.json
Normal file
112
media/handbrake/preset.json
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
{
|
||||
"PresetList": [
|
||||
{
|
||||
"AlignAVStart": false,
|
||||
"AudioCopyMask": [],
|
||||
"AudioEncoderFallback": "mp3",
|
||||
"AudioLanguageList":[
|
||||
"eng"
|
||||
],
|
||||
"AudioList": [
|
||||
{
|
||||
"AudioBitrate": 128,
|
||||
"AudioCompressionLevel": 0,
|
||||
"AudioEncoder": "mp3",
|
||||
"AudioMixdown": "stereo",
|
||||
"AudioNormalizeMixLevel": false,
|
||||
"AudioSamplerate": "auto",
|
||||
"AudioTrackQualityEnable": false,
|
||||
"AudioTrackQuality": -1,
|
||||
"AudioTrackGainSlider": 0,
|
||||
"AudioTrackDRCSlider": 0
|
||||
}
|
||||
],
|
||||
"AudioSecondaryEncoderMode": true,
|
||||
"AudioTrackSelectionBehavior": "first",
|
||||
"ChapterMarkers": true,
|
||||
"ChildrenArray": [],
|
||||
"Default": false,
|
||||
"FileFormat": "av_mkv",
|
||||
"Folder": false,
|
||||
"FolderOpen": false,
|
||||
"Mp4HttpOptimize": false,
|
||||
"Mp4iPodCompatible": false,
|
||||
"PictureAutoCrop": false,
|
||||
"PictureBottomCrop": 0,
|
||||
"PictureLeftCrop": 0,
|
||||
"PictureRightCrop": 0,
|
||||
"PictureTopCrop": 0,
|
||||
"PictureDARWidth": 1080,
|
||||
"PictureDeblockPreset": "off",
|
||||
"PictureDeblockTune": "medium",
|
||||
"PictureDeblockCustom": "strength=strong:thresh=20:blocksize=8",
|
||||
"PictureDeinterlaceFilter": "off",
|
||||
"PictureCombDetectPreset": "off",
|
||||
"PictureCombDetectCustom": "",
|
||||
"PictureDenoiseCustom": "",
|
||||
"PictureDenoiseFilter": "off",
|
||||
"PictureDenoisePreset": "medium",
|
||||
"PictureDenoiseTune": "none",
|
||||
"PictureSharpenCustom": "",
|
||||
"PictureSharpenFilter": "off",
|
||||
"PictureSharpenPreset": "medium",
|
||||
"PictureSharpenTune": "none",
|
||||
"PictureDetelecine": "off",
|
||||
"PictureDetelecineCustom": "",
|
||||
"PictureColorspacePreset": "off",
|
||||
"PictureColorspaceCustom": "",
|
||||
"PictureChromaSmoothPreset": "off",
|
||||
"PictureChromaSmoothTune": "none",
|
||||
"PictureChromaSmoothCustom": "",
|
||||
"PictureItuPAR": false,
|
||||
"PictureKeepRatio": true,
|
||||
"PictureLooseCrop": false,
|
||||
"PicturePAR": "auto",
|
||||
"PicturePARWidth": 1,
|
||||
"PicturePARHeight": 1,
|
||||
"PictureWidth": 1920,
|
||||
"PictureHeight": 1080,
|
||||
"PictureUseMaximumSize": true,
|
||||
"PictureAllowUpscaling": false,
|
||||
"PictureForceHeight": 0,
|
||||
"PictureForceWidth": 0,
|
||||
"PicturePadMode": "none",
|
||||
"PicturePadTop": 0,
|
||||
"PicturePadBottom": 0,
|
||||
"PicturePadLeft": 0,
|
||||
"PicturePadRight": 0,
|
||||
"PresetName": "dikburt",
|
||||
"Type": 1,
|
||||
"SubtitleAddCC": false,
|
||||
"SubtitleAddForeignAudioSearch": true,
|
||||
"SubtitleAddForeignAudioSubtitle": false,
|
||||
"SubtitleBurnBehavior": "none",
|
||||
"SubtitleBurnBDSub": false,
|
||||
"SubtitleBurnDVDSub": false,
|
||||
"SubtitleLanguageList": [
|
||||
"eng"
|
||||
],
|
||||
"SubtitleTrackSelectionBehavior": "none",
|
||||
"VideoColorMatrixCode": 0,
|
||||
"VideoEncoder": "x265",
|
||||
"VideoFramerateMode": "vfr",
|
||||
"VideoGrayScale": false,
|
||||
"VideoScaler": "swscale",
|
||||
"VideoPreset": "fast",
|
||||
"VideoTune": "",
|
||||
"VideoProfile": "auto",
|
||||
"VideoLevel": "auto",
|
||||
"VideoOptionExtra": "",
|
||||
"VideoQSVDecode": true,
|
||||
"VideoQSVAsyncDepth": 0,
|
||||
"VideoTwoPass": false,
|
||||
"VideoTurboTwoPass": false,
|
||||
"x264UseAdvancedOptions": false,
|
||||
"PresetDisabled": false,
|
||||
"MetadataPassthrough": false
|
||||
}
|
||||
],
|
||||
"VersionMajor": 47,
|
||||
"VersionMicro": 0,
|
||||
"VersionMinor": 0
|
||||
}
|
||||
25
util/gandi_dyndns
Normal file
25
util/gandi_dyndns
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Gandi LiveDNS API KEY
|
||||
API_KEY=$GANDI_DDNS_API_KEY
|
||||
|
||||
# Domain hosted with Gandi
|
||||
DOMAIN=$GANDI_DDNS_DOMAIN
|
||||
|
||||
# Subdomain to update DNS
|
||||
SUBDOMAIN=$GANDI_DDNS_SUBDOMAIN
|
||||
|
||||
# Get external IP address
|
||||
EXT_IP=$(curl -s ifconfig.me)
|
||||
|
||||
#Get the current Zone for the provided domain
|
||||
CURRENT_ZONE_HREF=$(curl -s -H "X-Api-Key: $API_KEY" https://dns.api.gandi.net/api/v5/domains/$DOMAIN | jq -r '.zone_records_href')
|
||||
|
||||
# Update the A Record of the subdomain using PUT
|
||||
curl -D- -X PUT -H "Content-Type: application/json" \
|
||||
-H "X-Api-Key: $API_KEY" \
|
||||
-d "{\"rrset_name\": \"$SUBDOMAIN\",
|
||||
\"rrset_type\": \"A\",
|
||||
\"rrset_ttl\": 1200,
|
||||
\"rrset_values\": [\"$EXT_IP\"]}" \
|
||||
$CURRENT_ZONE_HREF/$SUBDOMAIN/A
|
||||
17
util/urle
Executable file
17
util/urle
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/env bash
|
||||
|
||||
urlencode_single_printf () {
|
||||
string=$1; format=; set --
|
||||
while [ -n "$string" ]; do
|
||||
tail=${string#?}
|
||||
head=${string%$tail}
|
||||
case $head in
|
||||
[-._~0-9A-Za-z]) format=$format%c; set -- "$@" "$head";;
|
||||
*) format=$format%%%02x; set -- "$@" "'$head";;
|
||||
esac
|
||||
string=$tail
|
||||
done
|
||||
printf "$format\\n" "$@"
|
||||
}
|
||||
|
||||
urlencode_single_printf $1
|
||||
Loading…
Reference in a new issue