Digital Garden
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.
-
Thu Jan 04 2024 01:00:00 GMT+0100 (Central European Standard Time)
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:
- Upload the video to YouTube and wait for captions to be auto-generated.
- Download the auto-generated captions in the original language.
- 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.)
- Create a new language subtitles track (in my case, italian)
- 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
-
Mon Aug 07 2023 02:00:00 GMT+0200 (Central European Summer Time)
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.
-
Wed May 17 2023 02:00:00 GMT+0200 (Central European Summer Time)
Zotero setup, mostly as a reminder for myself
I have recently started using Zotero together with other researchers, and thus have started using Zotero’s inbuilt shared libraries. This means I have to now manage multiple libraries, and it seems like a good time to document the setup to remember why I did things a certain way a while back.
Local library
The local library is managed by Zotfile, which automatically renames and moves the files to a specific folder enabling me to use iCloud rather than Zotero’s own cloud storage. Every time a file is added, I simply:
- Right-click on the file
- Click on “Manage Attachments”
- Click on “Rename and Move”
Shared Library
For the shared library things are slightly different. Due to it being handled entirely by Zotero, I have to let it handle also References and Attachments. There are two separate scenarios:
- When I add a new file and reference, I simply “Add to shared library”
- When instead I want to share an existing file in the local library, I must:
- Right-click on the file
- Click on “Manage Attachments”
- Click on “Convert linked files to stored files”
In case of an existing file, this will store the data using Zotero’s storage, and it can then be moved to the chosen group library, and deleted from the local library to avoid duplication.