Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
theo23 la Simpatie.ro
Femeie
24 ani
Arges
cauta Barbat
26 - 45 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [POWERSHELL] Convert JSON Subtitles to SRT Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
Mrrrr
AdMiN

Inregistrat: acum 19 ani
Postari: 2364
I downloaded a free health video online, but the English subtitles coming with it are not downloadable with the video, they're not in VTT format, but in JSON format. I tried one of the fancy online converters, but they appear to be expecting something else.

Gave ChatGPT a sample, and it wrote the following command that converted my subtitle.json file into subtitle.srt:

$j=Get-Content .\subtitle.json -Raw | ConvertFrom-Json;$n=1;$out=foreach($i in $j.content.items){$s=[timespan]::FromSeconds($i.startTime);$e=[timespan]::FromSeconds($i.endTime);"$n`r`n{0:hh\:mm\:ss},{1:000} --> {2:hh\:mm\:ss},{3:000}`r`n{4}`r`n" -f $s,$s.Milliseconds,$e,$e.Milliseconds,$i.content;$n++};$out | Set-Content .\subtitle.srt -Encoding UTF8


Source: ChatGPT


_______________________________________


pus acum 22 ore
   
Pagini: 1  

Mergi la