This is a simple script for converting TTML subtitle files to SRT ones. Tested with TTML files on tv.nrk.no.
It assumes the data is structured like this:
<tt>
<body>
<div>
<p>(...)</p>
| #!/bin/bash | |
| #################################### | |
| # | |
| # Backup via SCP | |
| # | |
| # Executes daily as defined by crontab -e | |
| # 0 0 * * * bash /home/pi/scripts/backup.sh | |
| # | |
| # Don't forget to generate an ssh key and add it to the mac mini |
| # move the mouse around to avoid the inactivity timeout on some websites | |
| # https://github.com/facastagnini | |
| # requires cliclick | |
| # brew install cliclick | |
| while true | |
| do | |
| /usr/local/bin/cliclick "m:12,34" | |
| sleep 60 | |
| /usr/local/bin/cliclick "m:120,34" |
| #!/bin/bash | |
| if [ $# -eq 0 ] | |
| then | |
| echo "Uso radios.sh nombre_radio" | |
| echo "Requiere VLC (brew install vlc)" | |
| echo "radios.sh --help para ver las radios disponibles" | |
| else | |
| echo "$(cat $0 | grep "#" | grep -m 1 -i $1 | cut -d" " -f2 | vlc -Idummy --quiet -)" | |
| fi |
| { | |
| "title": "Diego", | |
| "rules": [ | |
| { | |
| "description": "Hold down left control to sleep", | |
| "manipulators": [ | |
| { | |
| "from": { | |
| "key_code": "left_control", | |
| "modifiers": { |
| #!/usr/bin/python2.7 | |
| #original source: https://superuser.com/questions/902869/how-to-identify-which-process-is-running-which-window-in-mac-os-x | |
| import Quartz | |
| import time | |
| from Foundation import NSSet, NSMutableSet | |
| def transformWindowData(data): | |
| list1 = [] | |
| for v in data: |
| Set your macOS server to deny SMB 3 connections | |
| Validate negotiate requests are an SMB 3 feature that clients initiate. To prevent clients from making these requests, you can set your macOS server to accept only SMB 2 connections. A bit-field in server preferences controls Server Dialect. The keyword for this bit-field is ProtocolVersionMap. It uses only three bits: | |
| Value Meaning | |
| 1 Support SMB 1 | |
| 2 Support SMB 2 | |
| 4 Support SMB 3 | |
| To support multiple dialects, combine bits. |
| brew cask install blackhole | |
| #https://github.com/ExistentialAudio/BlackHole | |
| Record System Audio | |
| Setup Multi-output Device | |
| In Audio Midi Setup->Audio Devices Right-click on the newly created Multi-output and select "Use This Device For Sound Output" | |
| Open digital audio workstation (DAW) such as GarageBand or QuickTime and set input device to "BlackHole" | |
| Set track to input from channel 1-2 | |
| Play audio from another application and monitor or record in your DAW. |
| First extract the suitcases to regular files with dataforks | |
| ----------------------------------------------------------------- | |
| (Source: http://xahlee.info/UnixResource_dir/macosx.html) | |
| (Source: http://fondu.sourceforge.net/) | |
| (Source: https://stackoverflow.com/questions/7412462/using-os-9-resource-fork-fonts-in-css-with-font-face/64561713#64561713) | |
| This is a very old file format where the font information is only contained in the resource fork, not the data fork, so the files seem empty to most modern apps. | |
| First we can group them all in a single directory taking advantage of the find command, because find doesn't see the resource fork and consider the file empty, we create a new directory in the user home and copy all the suitcases there: |
| # add a Run shell script module in automator, pass input as arguments. Set as a folder action on the appropiate folders. | |
| for f in "$@" | |
| do | |
| if [ ${f: -4} == ".mkv" ] | |
| then | |
| /usr/local/bin/ffmpeg -hide_banner -y -loglevel quiet -i "$f" -map 0:s? "${f%.*}".en.srt | |
| fi | |
| done |