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
alias subs=subs | |
function subs() { | |
movie="${1}" | |
filename="${1%.*}" | |
mappings=`ffprobe -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 "${movie}"` | |
OLDIFS=$IFS | |
IFS=, | |
( while read idx lang | |
do |
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
# get latest version | |
wget https://github.com/skeeto/endlessh/archive/master.zip | |
unzip master.zip | |
cd endlessh-master/ | |
# compile | |
make | |
# install | |
sudo cp endlessh /usr/local/bin/ |
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
#!/usr/bin/env python3 | |
import re, sys | |
from pathlib import Path | |
def fix_srt_time_format(sub_file_name: str): | |
"""Fix time format in SubRip srt subtitle files. | |
This script will: | |
* replace `.` delimiter between seconds and miliseconds with expected `,` | |
* replace leading `0:` in timestamps with expected `00:` |
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
#!/usr/bin/env python3 | |
import glob | |
import subprocess | |
from datetime import date, datetime, time, timedelta | |
from typing import List | |
# pip install -U pyexifinfo | |
# https://github.com/guinslym/pyexifinfo | |
import pyexifinfo as exif |
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
# 1 - Create a jail called `convert` using `pluginjail-10.3` template | |
# 2 - list all jails | |
jls | |
JID IP Address Hostname Path | |
1 - convert /mnt/volume/jails/convert | |
# 3 - connect to our jail | |
jexec 1 sh |
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
var raw_links = document.querySelectorAll(".results .item-ttl a") | |
var torrent_links = []; | |
for (var i = 0; i < raw_links.length; i++) { | |
var release_name = raw_links[i].attributes.href.value.split('/')[2]; | |
torrent_links.push("https://archive.org/download/" + release_name + "/" + release_name + "_archive.torrent"); | |
}; | |
console.log(torrent_links.join('\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
import chardet # https://pypi.python.org/pypi/chardet | |
def file_to_utf8(f_name): | |
"""Convert any file into UTF-8 file like object. | |
This conversion method is not perfect, because chardet doesn't detect the char set with 100% accuracy. | |
You'd have to base the decision to do the conversion on the confidence level (raging from 0 to 1) returned by the detect() | |
detect() returns a dictionary containing the auto-detected character encoding and a confidence level from 0 to 1. | |
""" | |
with open(f_name, 'rb') as f: |
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
function renamevideofiles(){ | |
input_ext="mkv" | |
dry_mode= | |
local OPTIND o d | |
while getopts :d: name; do | |
case "${name}" in | |
d) | |
dry_mode=1 | |
input_ext="${OPTARG}" | |
;; |
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
# to get the name of the card do: | |
# cat /proc/asound/cards | |
# ... | |
# 2 [DACE17 ]: USB-Audio - FiiO USB DAC-E17 | |
# FiiO FiiO USB DAC-E17 at usb-0000:00:14.0-1.4, full speed | |
# or | |
# aplay -l | |
# ... | |
# card 2: DACE17 [FiiO USB DAC-E17], device 0: USB Audio [USB Audio] | |
# Subdevices: 1/1 |
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
function dlistmp3() { | |
youtube-dl -j --flat-playlist "${1}" |\ | |
jq -r '.id' |\ | |
sed 's_^_https://www.youtube.com/watch?v=_' |\ | |
parallel -j4 'youtube-dl -f bestaudio --extract-audio --audio-format mp3 --audio-quality 192K --embed-thumbnail --add-metadata --no-post-overwrites --ignore-errors {}' | |
} |
NewerOlder