NO-LANG

Digital Garden

Questa pagina è un esperimento di "giardino digitale", un luogo dove raccoglierò esperienze, perloppiù digitali, che potrebbero essermi utili in futuro e chissà, forse potrebbero essere utili anche a voi! I post saranno in ordine cronologico (dal più al meno recente) e saranno scritti prevalentemente in inglese. Se più avanti ne sentirò la necessità, metterò dei filtri per poterli smistare per lingua.


This page is an experiment in a "digital garden," a place where I will collect experiences, mostly digital, that might be useful to me in the future and who knows, maybe they might be useful to you! The posts will be in chronological order (from most to least recent) and will be written mostly in English. If I feel the need for it later, I will put filters so that they can be sorted by language.


Thursday, 4th January 2024

Flippin' subtitles, dude!

I was asked to do a brief translation work for a family member. The original request was: "You speak english, right? Could you please watch this entire DVD and summarise it for me please?". Of course, I wasn't going to do that, so I said "Don't worry, I'll make sure you can watch the DVD with Italian subs". They were happy, I thought I could have leveraged YouTube for the automatic subs and DeepL for some quick translation, and with a bit of proof reading I would be done in no time. Turns out I was wrong.

DeepL doesn't like timestamps

Feeding the raw .sbv file downloaded from YouTube yielded decent results on tiny videos (< 1 min) but started becoming problematic with longer vidoes. DeepL wasn't able to grasp the context of what was being said, because every sentence was interrupted by timestamps. I quickly realised that it would have taken a huge amount of time to manually correct all the mistakes, and thus this ideas was scrapped.

YouTube's auto-translated subtitles

Even though I am confident in DeepL's translation capabilities, I decided to give YouTube's auto-translated subs a go. But here's the catch: as of today, it's not that easy to get a hold of them. Using yt-dlp's subtitle download feature seemed to work fine, but at a closer inspection, the donwloaded subs were a mess. Final Cut Pro wasn't able to import them (I tried every possible format), and even trying to re-upload them to YouTube yielded several errors. While YouTube's auto-generated subtitles were extremely clean when downloaded from YouTube, they became a garbled mess when downloaded via yt-dlp. I thought it was an auto-translation issue, but even the native ones suffered from the same issue.

The working workflow

As of today, January 2024, it seems to be possible to download auto-translated subtitles from YouTube only if captions have been published in the original video language first. In YouTube's own words: "Auto-translate is unavailable for auto-generated captions". However, in italian we say "Fatta la legge, trovato l'inganno" that literally translates to "Once the law is made, the trick is found", but in this case it's more of a workaround. Here's the workflow:

  1. Upload the video to YouTube and wait for captions to be auto-generated.
  2. Download the auto-generated captions in the original language.
  3. Re-upload the captions on YouTube for the "English (video language)" subtitle track.
    (We are effectively uploading the auto-generated captions and telling YouTube these are custom captions of ours.)
  4. Create a new language subtitles track (in my case, italian)
  5. Edit the newly created subtitles track, and select Auto-translate

Doing so, you will be able to download the auto-translated subtitle track from YouTube, saving a clean .sbv file that can be converted in whichever format you need. In my case, I used FFmpeg to convert the .sbv file to .srt.

ffmpeg -i input.sbv output.srt


Monday, 7th August 2023

If local tunnelling worked before, it should always work.

Yesterday, I spent the whole day trying to figure out why my local tunnelling wasn't working anymore. I did everything I used to do in the past, but nothing seemed to work. Because I am running beta software both on my iPad and on my iPhone, I started thinking that some new firewall setting was interfering: it wasn't.

I also remembered that recently I spent my time tweaking my FastGATE modem settings, and started thinking that I must have changed something that was preventing me from accessing my local server. Spoiler alert: I didn't.

After watching a couple of YouTube tutorials on "how to set up local tunnelling", and realising I was doing exactly what I needed to do, I noticed that one of the tutorials was using a Visual Studio Code addon called Live Server. From the interactions, I remembered that I used to use that addon too, but most recently switched to Microsoft's Live Preview for no particular reason.

Turns out it was a bug on Microsoft's addon, and switching did the trick. Too bad I lost a whole day on this.