The problem
O problema
The gap between “this is useful” and “I can find this again in six months” is where most of what I watch disappears. Saving the link doesn't close it; the link isn't the knowledge.
É no espaço entre “isso é útil” e “consigo achar isso de novo daqui a seis meses” que some quase tudo o que eu assisto. Salvar o link não resolve: o link não é o conhecimento.
How it works
Como funciona
- Paste. A link in one Discord channel; the bot reacts with an hourglass.
- Transcribe. yt-dlp pulls the captions and the video's title and channel.
- Clean. Claude turns raw auto-captions into readable prose with section headings.
- Enrich. A second pass extracts the takeaways, the people and the concepts; each becomes a wiki link, and new people get a stub note of their own.
- File and sync. The note lands in the vault, is committed and pushed to GitHub, and reaches my Mac and phone through the second brain's sync. The bot replies with a check mark.
- Colar. Um link num canal do Discord; o bot reage com uma ampulheta.
- Transcrever. O yt-dlp puxa as legendas, o título e o canal do vídeo.
- Limpar. O Claude transforma as legendas automáticas cruas em texto legível, com títulos de seção.
- Enriquecer. Uma segunda passada extrai os principais pontos, as pessoas e os conceitos; cada um vira um wiki link, e pessoas novas ganham uma nota inicial só delas.
- Arquivar e sincronizar. A nota cai no vault, ganha commit e push para o GitHub e chega ao Mac e ao celular pela sincronização do segundo cérebro. O bot responde com um check.
A second channel works the other way round: ask a question and the bot answers from the whole vault.
Um segundo canal faz o caminho inverso: você pergunta e o bot responde com base no vault inteiro.
Two bugs worth the price of admission
Dois bugs que valeram o ingresso
The lockfile. It died silently for two days. The kernel runs fs.protected_regular=2, which refuses writes to a file owned by another user inside a sticky, world-writable directory, root included. The lockfile was in /tmp. Locks live in /run now. The same setting had quietly broken the vault sync too; I found that one only because I went looking after this.
O lockfile. O bot morreu em silêncio por dois dias. O kernel roda com fs.protected_regular=2, que recusa escrita num arquivo de outro usuário dentro de um diretório sticky e gravável por todos, até para o root. O lockfile estava em /tmp. Hoje os locks ficam em /run. A mesma configuração também tinha quebrado, sem alarde, a sincronização do vault; só descobri porque fui procurar depois disso.
Logging the wrong stream. The CLI it shells out to reports an expired session on stdout, not stderr. I was logging stderr. The result was a log full of successful-looking silence while nothing worked. Log both.
Logando a saída errada. A CLI que o bot chama avisa sessão expirada no stdout, não no stderr. Eu logava o stderr. Resultado: um log cheio de um silêncio com cara de sucesso enquanto nada funcionava. Logue os dois.
Small things that mattered
Detalhes que fizeram diferença
- Blocking work wrapped in
asyncio.to_threadso the Discord heartbeat keeps beating. - Graceful degradation: if the cleaning step fails, the raw transcript is still saved; nothing pasted is lost.
- One lock shared with the five-minute vault sync, so the two never run git at the same time.
- Keepalive: a check restarts the bot if it isn't running.
- Trabalho bloqueante dentro de
asyncio.to_thread, para o heartbeat do Discord continuar batendo. - Degradação suave: se a limpeza falhar, a transcrição crua é salva mesmo assim; nada do que foi colado se perde.
- Um lock só, dividido com a sincronização do vault a cada cinco minutos, para os dois nunca rodarem git ao mesmo tempo.
- Keepalive: uma checagem reinicia o bot se ele não estiver rodando.