(obbligatorio 'questo è probabilmente un youtube interna.interfaccia COM e potrebbe rompersi in qualsiasi momento ')
Invece di collegamento a un altro strumento che fa questo, ecco una risposta alla domanda di 'come fare questo'
ho usato fiddler per ispezionare la youtube.com Traffico HTTP e c'è una risposta da /api/timedtext
che contiene le informazioni sulla didascalia chiusa come XML.
Sembra che una risposta simile:
<p t="0" d="5430" w="1">
<s p="2" ac="136">we've</s>
<s t="780" ac="252"> got</s>
</p>
<p t="2280" d="7170" w="1">
<s ac="243">we're</s>
<s t="810" ac="233"> going</s>
</p>
mezzi a tempo 0
è la parola we've
e al tempo 0+780
è la parola got
e al tempo 2280+810
è la parola going
, ecc Questo tempo è in millisecondi quindi per il tempo 3090 vorresti aggiungere &t=3
all'URL.
è possibile utilizzare qualsiasi strumento per cucire insieme l'XML in qualcosa di leggibile, ma qui è il mio script Power BI Desktop di trovare parole come "privilegio":
let
Source = Xml.Tables(File.Contents("C:\Download\body.xml")),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Attribute:format", Int64.Type}}),
body = #"Changed Type"{0}[body],
p = body{0}[p],
#"Changed Type1" = Table.TransformColumnTypes(p,{{"Attribute:t", Int64.Type}, {"Attribute:d", Int64.Type}, {"Attribute:w", Int64.Type}, {"Attribute:a", Int64.Type}, {"Attribute:p", Int64.Type}}),
#"Expanded s" = Table.ExpandTableColumn(#"Changed Type1", "s", {"Attribute:ac", "Attribute:p", "Attribute:t", "Element:Text"}, {"s.Attribute:ac", "s.Attribute:p", "s.Attribute:t", "s.Element:Text"}),
#"Changed Type2" = Table.TransformColumnTypes(#"Expanded s",{{"s.Attribute:t", Int64.Type}}),
#"Removed Other Columns" = Table.SelectColumns(#"Changed Type2",{"s.Attribute:t", "s.Element:Text", "Attribute:t"}),
#"Replaced Value" = Table.ReplaceValue(#"Removed Other Columns",null,0,Replacer.ReplaceValue,{"s.Attribute:t"}),
#"Filtered Rows" = Table.SelectRows(#"Replaced Value", each [#"s.Element:Text"] <> null),
#"Added Custom" = Table.AddColumn(#"Filtered Rows", "Time", each [#"Attribute:t"] + [#"s.Attribute:t"]),
#"Filtered Rows1" = Table.SelectRows(#"Added Custom", each ([#"s.Element:Text"] = " privilege" or [#"s.Element:Text"] = " privileged" or [#"s.Element:Text"] = " privileges" or [#"s.Element:Text"] = "privilege" or [#"s.Element:Text"] = "privileges"))
in
#"Filtered Rows1"
Ogni collegamento in questa risposta non è aggiornato. YouTube API 2.0 è stato sostituito da [API 3.0] (https://developers.google.com/youtube/v3/docs/captions) e il download di sottotitoli sotto questa API [comporta "un costo di quota di circa 200 unità"] (https://developers.google.com/youtube/v3/docs/captions/download). Non riescono a menzionare come viene allocata questa quota ea chi, quindi questa soluzione non sarà utile alla maggior parte delle persone che vogliono solo scaricare le didascalie piuttosto che ammirare alcune API. – 7vujy0f0hy
in qualche modo è possibile generare una trascrizione automatica tramite l'API di YouTube V3? – manish1706