diff --git a/main.js b/main.js index 5d0e5eb..440aa34 100644 --- a/main.js +++ b/main.js @@ -588,12 +588,12 @@ var youtube_transcript_esm_default = YoutubeTranscript; var TRANSCRIPT_TYPE_VIEW = "transcript-view"; var formatTimestamp = (t) => { const fnum = (n) => n && n < 10 ? "0" + n.toFixed() : n.toFixed(); - const h = 3600 * 1e3; + const s = 1e3; + const m = 60 * s; + const h = 60 * m; const hours = Math.floor(t / h); - const m = 60 * 1e3; const minutes = Math.floor((t - hours * h) / m); - const ms = 1e3; - const seconds = Math.floor((t - minutes * m) / ms); + const seconds = Math.floor((t - minutes * m) / s); const time = hours ? [hours, minutes, seconds] : [minutes, seconds]; return time.map(fnum).join(":"); }; @@ -619,7 +619,8 @@ var TranscriptView = class extends import_obsidian.ItemView { if (i % timestampMod == 0) { div = createEl("div"); const button = createEl("button", { cls: "timestamp", attr: { "data-timestamp": line.offset.toFixed() } }); - button.innerText = formatTimestamp(line.offset); + const link = createEl("a", { text: formatTimestamp(line.offset), attr: { "href": url + "&t=" + Math.floor(line.offset / 1e3) } }); + button.appendChild(link); const span = this.contentEl.createEl("span", { cls: "transcript-line", text: line.text + " " }); div.appendChild(button); div.appendChild(span); @@ -704,4 +705,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsibm9kZV9tb2R1bGVzL2NlbnRyYS9tb2RlbC9DZW50cmFSZXNwb25zZS5qcyIsICJub2RlX21vZHVsZXMvY2VudHJhL21vZGVsL0NlbnRyYVJlcXVlc3QuanMiLCAibm9kZV9tb2R1bGVzL2NlbnRyYS9jcmVhdGVSZXF1ZXN0LmpzIiwgIm5vZGVfbW9kdWxlcy9waGluL2xpYi9waGluLmpzIiwg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uZmV0Y2hUcmFuc2NyaXB0ID0gZnVuY3Rpb24gKHZpZGVvSWQsIGNvbmZpZykge1xyXG4gICAgICAgIHJldHVybiBfX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgdmFyIGlkZW50aWZpZXIsIHZpZGVvUGFnZUJvZHksIGlubmVyVHViZUFwaUtleSwgYm9keSwgdHJhbnNjcmlwdHMsIGVfMTtcclxuICAgICAgICAgICAgcmV0dXJuIF9fZ2VuZXJhdG9yKHRoaXMsIGZ1bmN0aW9uIChfYSkge1xyXG4gICAgICAgICAgICAgICAgc3dpdGNoIChfYS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWRlbnRpZmllciA9IHRoaXMucmV0cmlldmVWaWRlb0lkKHZpZGVvSWQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBfYS5sYWJlbCA9IDE7XHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBfYS50cnlzLnB1c2goWzEsIDUsICwgNl0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCBwKFwiaHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1cIiArIGlkZW50aWZpZXIpXTtcclxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvUGFnZUJvZHkgPSAoX2Euc2VudCgpKS5ib2R5O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpbm5lclR1YmVBcGlLZXkgPSB2aWRlb1BhZ2VCb2R5XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAudG9TdHJpbmcoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNwbGl0KCdcIklOTkVSVFVCRV9BUElfS0VZXCI6XCInKVsxXVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNwbGl0KCdcIicpWzBdO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShpbm5lclR1YmVBcGlLZXkgJiYgaW5uZXJUdWJlQXBpS2V5Lmxlbmd0aCA+IDApKSByZXR1cm4gWzMgLypicmVhayovLCA0XTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFs0IC8qeWllbGQqLywgcCh7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcImh0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3lvdXR1YmVpL3YxL2dldF90cmFuc2NyaXB0P2tleT1cIiArIGlubmVyVHViZUFwaUtleSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiB0aGlzLmdlbmVyYXRlUmVxdWVzdCh2aWRlb1BhZ2VCb2R5LnRvU3RyaW5nKCksIGNvbmZpZyksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2U6ICdqc29uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXTtcclxuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHkgPSAoX2Euc2VudCgpKS5ib2R5O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYm9keS5yZXNwb25zZUNvbnRleHQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYm9keS5hY3Rpb25zKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdUcmFuc2NyaXB0IGlzIGRpc2FibGVkIG9uIHRoaXMgdmlkZW8nKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zY3JpcHRzID0gYm9keS5hY3Rpb25zWzBdLnVwZGF0ZUVuZ2FnZW1lbnRQYW5lbEFjdGlvbi5jb250ZW50XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRyYW5zY3JpcHRSZW5kZXJlci5ib2R5LnRyYW5zY3JpcHRCb2R5UmVuZGVyZXIuY3VlR3JvdXBzO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyIC8qcmV0dXJuKi8sIHRyYW5zY3JpcHRzLm1hcChmdW5jdGlvbiAoY3VlKSB7IHJldHVybiAoe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiBjdWUudHJhbnNjcmlwdEN1ZUdyb3VwUmVuZGVyZXIuY3Vlc1swXS50cmFuc2NyaXB0Q3VlUmVuZGVyZXJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jdWUuc2ltcGxlVGV4dCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHVyYXRpb246IHBhcnNlSW50KGN1ZS50cmFuc2NyaXB0Q3VlR3JvdXBSZW5kZXJlci5jdWVzWzBdLnRyYW5zY3JpcHRDdWVSZW5kZXJlclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmR1cmF0aW9uTXMpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQ6IHBhcnNlSW50KGN1ZS50cmFuc2NyaXB0Q3VlR3JvdXBSZW5kZXJlci5jdWVzWzBdLnRyYW5zY3JpcHRDdWVSZW5kZXJlclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0YXJ0T2Zmc2V0TXMpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOyB9KV07XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgX2EubGFiZWwgPSA0O1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNDogcmV0dXJuIFszIC8qYnJlYWsqLywgNl07XHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBlXzEgPSBfYS5zZW50KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBZb3V0dWJlVHJhbnNjcmlwdEVycm9yKGVfMSk7XHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OiByZXR1cm4gWzIgLypyZXR1cm4qL107XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfTtcclxuICAgIC8qKlxyXG4gICAgICogR2VuZXJhdGUgdHJhY2tpbmcgcGFyYW1zIGZvciBZVEIgQVBJXHJcbiAgICAgKiBAcGFyYW0gcGFnZVxyXG4gICAgICogQHBhcmFtIGNvbmZpZ1xyXG4gICAgICovXHJcbiAgICBZb3V0dWJlVHJhbnNjcmlwdC5nZW5lcmF0ZVJlcXVlc3QgPSBmdW5jdGlvbiAocGFnZSwgY29uZmlnKSB7XHJcbiAgICAgICAgdmFyIF9hLCBfYiwgX2MsIF9kO1xyXG4gICAgICAgIHZhciBwYXJhbXMgPSAoX2EgPSBwYWdlLnNwbGl0KCdcInNlcmlhbGl6ZWRTaGFyZUVudGl0eVwiOlwiJylbMV0pID09PSBudWxsIHx8IF9hID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfYS5zcGxpdCgnXCInKVswXTtcclxuICAgICAgICB2YXIgdmlzaXRvckRhdGEgPSAoX2IgPSBwYWdlLnNwbGl0KCdcIlZJU0lUT1JfREFUQVwiOlwiJylbMV0pID09PSBudWxsIHx8IF9iID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfYi5zcGxpdCgnXCInKVswXTtc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LFxyXG4gICAgICAgICAgICAgICAgICAgIGNsaWVudFZlcnNpb246ICcyLjIwMjAwOTI1LjAxLjAwJyxcclxuICAgICAgICAgICAgICAgICAgICBvc05hbWU6ICdNYWNpbnRvc2gnLFxyXG4gICAgICAgICAgICAgICAgICAgIG9zVmVyc2lvbjogJzEwXzE1XzQnLFxyXG4gICAgICAgICAgICAgICAgICAgIGJyb3dzZXJOYW1lOiAnQ2hyb21lJyxcclxuICAgICAgICAgICAgICAgICAgICBicm93c2VyVmVyc2lvbjogJzg1LjBmLjQxODMuODMnLFxyXG4gICAgICAgICAgICAgICAgICAgIHNjcmVlbldpZHRoUG9pbnRzOiAxNDQwLFxyXG4gICAgICAgICAgICAgICAgICAgIHNjcmVlbkhlaWdodFBvaW50czogNzcwLFxyXG4gICAgICAgICAgICAgICAgICAgIHNjcmVlblBpeGVsRGVuc2l0eTogMixcclxuICAgICAgICAgICAgICAgICAgICB1dGNPZmZzZXRNaW51dGVzOiAxMjAsXHJcbiAgICAgICAgICAgICAgICAgICAgdXNlckludGVyZmFjZVRoZW1lOiAnVVNFUl9JTlRFUkZBQ0VfVEhFTUVfTElHSFQnLFxyXG4gICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb25UeXBlOiAnQ09OTl9DRUxMVUxBUl8zRycsXHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgcmVxdWVzdDoge1xyXG4gICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZDogc2Vzc2lvbklkLFxyXG4gICAgICAgICAgICAgICAgICAgIGludGVybmFsRXhwZXJpbWVudEZsYWdzOiBbXSxcclxuICAgICAgICAgICAgICAgICAgICBjb25zaXN0ZW5jeVRva2VuSmFyczogW10sXHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgdXNlcjoge30sXHJcbiAgICAgICAgICAgICAgICBjbGllbnRTY3JlZW5Ob25jZTogdGhpcy5nZW5lcmF0ZU5vbmNlKCksXHJcbiAgICAgICAgICAgICAgICBjbGlja1RyYWNraW5nOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgY2xpY2tUcmFja2luZ1BhcmFtczogY2xpY2tUcmFja2luZ1BhcmFtcyxcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHBhcmFtczogcGFyYW1zLFxyXG4gICAgICAgIH07XHJcbiAgICB9O1xyXG4gICAgLyoqXHJcbiAgICAgKiAgJ2Jhc2UuanMnIGZ1bmN0aW9uXHJcbiAgICAgKi9cclxuICAgIFlvdXR1YmVUcmFuc2NyaXB0LmdlbmVyYXRlTm9uY2UgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgdmFyIHJuZCA9IE1hdGgucmFuZG9tKCkudG9TdHJpbmcoKTtcclxuICAgICAgICB2YXIgYWxwaGFiZXQgPSAnQUJDREVGR0hJSktMTU9QUVJTVFVWV1hZWmFiY2RlZmdoamlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODknO1xyXG4gICAgICAgIHZhciBqZGEgPSBbXHJcbiAgICAgICAgICAgIGFscGhhYmV0ICsgJysvPScsXHJcbiAgICAgICAgICAgIGFscGhhYmV0ICsgJysvJyxcclxuICAgICAgICAgICAgYWxwaGFiZXQgKyAnLV89JyxcclxuICAgICAgICAgICAgYWxwaGFiZXQgKyAnLV8uJyxcclxuICAgICAgICAgICAgYWxwaGFiZXQgKyAnLV8nLFxyXG4gICAgICAgIF07XHJcbiAgICAgICAgdmFyIGIgPSBqZGFbM107XHJcbiAgICAgICAgdmFyIGEgPSBbXTtcclxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHJuZC5sZW5ndGggLSAxOyBpKyspIHtcclxuICAgICAgICAgICAgYS5wdXNoKHJuZFtpXS5jaGFyQ29kZUF0KGkpKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdmFyIGMgPSAnJztcclxuICAgICAgICB2YXIgZCA9IDA7XHJcbiAgICAgICAgdmFyIG0sIG4sIHEsIHIsIGYsIGc7XHJcbiAgICAgICAgd2hpbGUgKGQgPCBhLmxlbmd0aCkge1xyXG4gICAgICAgICAgICBmID0gYVtkXTtcclxuICAgICAgICAgICAgZyA9IGQgKyAxIDwgYS5sZW5ndGg7XHJcbiAgICAgICAgICAgIGlmIChnKSB7XHJcbiAgICAgICAgICAgICAgICBtID0gYVtkICsgMV07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBtID0gMDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBuID0gZCArIDIgPCBhLmxlbmd0aDtcclxuICAgICAgICAgICAgaWYgKG4pIHtcclxuICAgICAgICAgICAgICAgIHEgPSBhW2QgKyAyXTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHEgPSAwO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHIgPSBmID4+IDI7XHJcbiAgICAgICAgICAgIGYgPSAoKGYgJiAzKSA8PCA0KSB8IChtID4+IDQpO1xyXG4gICAgICAgICAgICBtID0gKChtICYgMTUpIDw8IDIpIHwgKHEgPj4gNik7XHJcbiAgICAgICAgICAgIHEgJj0gNjM7XHJcbiAgICAgICAgICAgIGlmICghbikge1xyXG4gICAgICAgICAgICAgICAgcSA9IDY0O1xyXG4gICAgICAgICAgICAgICAgaWYgKCFxKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbSA9IDY0O1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGMgKz0gYltyXSArIGJbZl0gKyBiW21dICsgYltxXTtcclxuICAgICAgICAgICAgZCArPSAzO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gYztcclxuICAgIH07XHJcbiAgICAvKipcclxuICAgICAqIFJldHJpZXZlIHZpZGVvIGlkIGZyb20gdXJsIG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ICAgICAgICAgICAgY2FzZSA0OiBfLmxhYmVsKys7IHJldHVybiB7IHZhbHVlOiBvcFsxXSwgZG9uZTogZmFsc2UgfTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNTogXy5sYWJlbCsrOyB5ID0gb3BbMV07IG9wID0gWzBdOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNzogb3AgPSBfLm9wcy5wb3AoKTsgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEodCA9IF8udHJ5cywgdCA9IHQubGVuZ3RoID4gMCAmJiB0W3QubGVuZ3RoIC0gMV0pICYmIChvcFswXSA9PT0gNiB8fCBvcFswXSA9PT0gMikpIHsgXyA9IDA7IGNvbnRpbnVlOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wWzBdID09PSAzICYmICghdCB8fCAob3BbMV0gPiB0WzBdICYmIG9wWzFdIDwgdFszXSkpKSB7IF8ubGFiZWwgPSBvcFsxXTsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDYgJiYgXy5sYWJlbCA8IHRbMV0pIHsgXy5sYWJlbCA9IHRbMV07IHQgPSBvcDsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAodCAmJiBfLmxhYmVsIDwgdFsyXSkgeyBfLmxhYmVsID0gdFsyXTsgXy5vcHMucHVzaChvcCk7IGJyZWFrOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRbMl0pIF8ub3BzLnBvcCgpO1xyXG4gICAgICAgICAgICAgICAgICAgIF8udHJ5cy5wb3AoKTsgY29udGludWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgb3AgPSBib2R5LmNhbGwodGhpc0FyZywgXyk7XHJcbiAgICAgICAgfSBjYXRjaCAoZSkgeyBvcCA9IFs2LCBlXTsgeS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JcbiAgICAgKiBAcGFyYW0gdmlkZW9JZCBWaWRlbyB1cmwgb3IgdmlkZW8gaWRlbnRpZmllclxyXG4gICAgICogQHBhcmFtIGNvbmZpZyBHZXQgdHJhbnNjcmlwdCBpbiBhbm90aGVyIGNvdW50cnkgYW5kIGxhbmd1YWdlIElTT1xyXG4gICAgICovXHJcbiAgICBZb3V0dWJlVHJhbnNjcmlwdC5mZXRjaFRyYW5zY3JpcHQgPSBmdW5jdGlvbiAodmlkZW9JZCwgY29uZmlnKSB7XHJcbiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICB2YXIgaWRlbnRpZmllciwgdmlkZW9QYWdlQm9keSwgaW5uZXJUdWJlQXBpS2V5LCBib2R5LCB0cmFuc2NyaXB0cywgZV8xO1xyXG4gICAgICAgICAgICByZXR1cm4gX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24gKF9hKSB7XHJcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKF9hLmxhYmVsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZGVudGlmaWVyID0gdGhpcy5yZXRyaWV2ZVZpZGVvSWQodmlkZW9JZCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIF9hLmxhYmVsID0gMTtcclxuICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIF9hLnRyeXMucHVzaChbMSwgNSwgLCA2XSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHAoXCJodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PVwiICsgaWRlbnRpZmllcildO1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcclxuICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW9QYWdlQm9keSA9IChfYS5zZW50KCkpLmJvZHk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlubmVyVHViZUFwaUtleSA9IHZpZGVvUGFnZUJvZHlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50b1N0cmluZygpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3BsaXQoJ1wiSU5ORVJUVUJFX0FQSV9LRVlcIjpcIicpWzFdXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3BsaXQoJ1wiJylbMF07XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKGlubmVyVHViZUFwaUtleSAmJiBpbm5lclR1YmVBcGlLZXkubGVuZ3RoID4gMCkpIHJldHVybiBbMyAvKmJyZWFrKi8sIDRdO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCBwKHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFwiaHR0cHM6Ly93d3cueW91dHViZS5jb20veW91dHViZWkvdjEvZ2V0X3RyYW5zY3JpcHQ/a2V5PVwiICsgaW5uZXJUdWJlQXBpS2V5LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHRoaXMuZ2VuZXJhdGVSZXF1ZXN0KHZpZGVvUGFnZUJvZHkudG9TdHJpbmcoKSwgY29uZmlnKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZTogJ2pzb24nLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSldO1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcclxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keSA9IChfYS5zZW50KCkpLmJvZHk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChib2R5LnJlc3BvbnNlQ29udGV4dCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFib2R5LmFjdGlvbnMpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1RyYW5zY3JpcHQgaXMgZGlzYWJsZWQgb24gdGhpcyB2aWRlbycpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNjcmlwdHMgPSBib2R5LmFjdGlvbnNbMF0udXBkYXRlRW5nYWdlbWVudFBhbmVsQWN0aW9uLmNvbnRlbnRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudHJhbnNjcmlwdFJlbmRlcmVyLmJvZHkudHJhbnNjcmlwdEJvZHlSZW5kZXJlci5jdWVHcm91cHM7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qLywgdHJhbnNjcmlwdHMubWFwKGZ1bmN0aW9uIChjdWUpIHsgcmV0dXJuICh7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHQ6IGN1ZS50cmFuc2NyaXB0Q3VlR3JvdXBSZW5kZXJlci5jdWVzWzBdLnRyYW5zY3JpcHRDdWVSZW5kZXJlclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmN1ZS5zaW1wbGVUZXh0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkdXJhdGlvbjogcGFyc2VJbnQoY3VlLnRyYW5zY3JpcHRDdWVHcm91cFJlbmRlcmVyLmN1ZXNbMF0udHJhbnNjcmlwdEN1ZVJlbmRlcmVyXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZHVyYXRpb25NcyksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldDogcGFyc2VJbnQoY3VlLnRyYW5zY3JpcHRDdWVHcm91cFJlbmRlcmVyLmN1ZXNbMF0udHJhbnNjcmlwdEN1ZVJlbmRlcmVyXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3RhcnRPZmZzZXRNcyksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7IH0pXTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBfYS5sYWJlbCA9IDQ7XHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA0OiByZXR1cm4gWzMgLypicmVhayovLCA2XTtcclxuICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVfMSA9IF9hLnNlbnQoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFlvdXR1YmVUcmFuc2NyaXB0RXJyb3IoZV8xKTtcclxuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6IHJldHVybiBbMiAvKnJldHVybiovXTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9O1xyXG4gICAgLyoqXHJcbiAgICAgKiBHZW5lcmF0ZSB0cmFja2luZyBwYXJhbXMgZm9yIFlUQiBBUElcclxuICAgICAqIEBwYXJhbSBwYWdlXHJcbiAgICAgKiBAcGFyYW0gY29uZmlnXHJcbiAgICAgKi9cclxuICAgIFlvdXR1YmVUcmFuc2NyaXB0LmdlbmVyYXRlUmVxdWVzdCA9IGZ1bmN0aW9uIChwYWdlLCBjb25maWcpIHtcclxuICAgICAgICB2YXIgX2EsIF9iLCBfYywgX2Q7XHJcbiAgICAgICAgdmFyIHBhcmFtcyA9IChfYSA9IHBhZ2Uuc3BsaXQoJ1wic2VyaWFsaXplZFNoYXJlRW50aXR5XCI6XCInKVsxXSkgPT09IG51bGwgfHwgX2EgPT09IHZvaWQg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E1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTBfMTVfNCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzg1LjAuNDE4My44MyBTYWZhcmkvNTM3LjM2LGd6aXAoZ2ZlKScsXHJcbiAgICAgICAgICAgICAgICAgICAgY2xpZW50TmFtZTogJ1dFQicsXHJcbiAgICAgICAgICAgICAgICAgICAgY2xpZW50VmVyc2lvbjogJzIuMjAyMDA5MjUuMDEuMDAnLFxyXG4gICAgICAgICAgICAgICAgICAgIG9zTmFtZTogJ01hY2ludG9zaCcsXHJcbiAgICAgICAgICAgICAgICAgICAgb3NWZXJzaW9uOiAnMTBfMTVfNCcsXHJcbiAgICAgICAgICAgICAgICAgICAgYnJvd3Nlck5hbWU6ICdDaHJvbWUnLFxyXG4gICAgICAgICAgICAgICAgICAgIGJyb3dzZXJWZXJzaW9uOiAnODUuMGYuNDE4My44MycsXHJcbiAgICAgICAgICAgICAgICAgICAgc2NyZWVuV2lkdGhQb2ludHM6IDE0NDAsXHJcbiAgICAgICAgICAgICAgICAgICAgc2NyZWVuSGVpZ2h0UG9pbnRzOiA3NzAsXHJcbiAgICAgICAgICAgICAgICAgICAgc2NyZWVuUGl4ZWxEZW5zaXR5OiAyLFxyXG4gICAgICAgICAgICAgICAgICAgIHV0Y09mZnNldE1pbnV0ZXM6IDEyMCxcclxuICAgICAgICAgICAgICAgICAgICB1c2VySW50ZXJmYWNlVGhlbWU6ICdVU0VSX0lOVEVSRkFDRV9USEVNRV9MSUdIVCcsXHJcbiAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvblR5cGU6ICdDT05OX0NFTExVTEFSXzNHJyxcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICByZXF1ZXN0OiB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkOiBzZXNzaW9uSWQsXHJcbiAgICAgICAgICAgICAgICAgICAgaW50ZXJuYWxFeHBlcmltZW50RmxhZ3M6IFtdLFxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnNpc3RlbmN5VG9rZW5KYXJzOiBbXSxcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICB1c2VyOiB7fSxcclxuICAgICAgICAgICAgICAgIGNsaWVudFNjcmVlbk5vbmNlOiB0aGlzLmdlbmVyYXRlTm9uY2UoKSxcclxuICAgICAgICAgICAgICAgIGNsaWNrVHJhY2tpbmc6IHtcclxuICAgICAgICAgICAgICAgICAgICBjbGlja1RyYWNraW5nUGFyYW1zOiBjbGlja1RyYWNraW5nUGFyYW1zLFxyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgcGFyYW1zOiBwYXJhbXMsXHJcbiAgICAgICAgfTtcclxuICAgIH07XHJcbiAgICAvKipcclxuICAgICAqICAnYmFzZS5qcycgZnVuY3Rpb25cclxuICAgICAqL1xyXG4gICAgWW91dHViZVRyYW5zY3JpcHQuZ2VuZXJhdGVOb25jZSA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICB2YXIgcm5kID0gTWF0aC5yYW5kb20oKS50b1N0cmluZygpO1xyXG4gICAgICAgIHZhciBhbHBoYWJldCA9ICdBQkNERUZHSElKS0xNT1BRUlNUVVZXWFlaYWJjZGVmZ2hqaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSc7XHJcbiAgICAgICAgdmFyIGpkYSA9IFtcclxuICAgICAgICAgICAgYWxwaGFiZXQgKyAnKy89JyxcclxuICAgICAgICAgICAgYWxwaGFiZXQgKyAnKy8nLFxyXG4gICAgICAgICAgICBhbHBoYWJldCArICctXz0nLFxyXG4gICAgICAgICAgICBhbHBoYWJldCArICctXy4nLFxyXG4gICAgICAgICAgICBhbHBoYWJldCArICctXycsXHJcbiAgICAgICAgXTtcclxuICAgICAgICB2YXIgYiA9IGpkYVszXTtcclxuICAgICAgICB2YXIgYSA9IFtdO1xyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcm5kLmxlbmd0aCAtIDE7IGkrKykge1xyXG4gICAgICAgICAgICBhLnB1c2gocm5kW2ldLmNoYXJDb2RlQXQoaSkpO1xyXG4gICAgICAgIH1cclxuICAgICAgICB2YXIgYyA9ICcnO1xyXG4gICAgICAgIHZhciBkID0gMDtcclxuICAgICAgICB2YXIgbSwgbiwgcSwgciwgZiwgZztcclxuICAgICAgICB3aGlsZSAoZCA8IGEubGVuZ3RoKSB7XHJcbiAgICAgICAgICAgIGYgPSBhW2RdO1xyXG4gICAgICAgICAgICBnID0gZCArIDEgPCBhLmxlbmd0aDtcclxuICAgICAgICAgICAgaWYgKGcpIHtcclxuICAgICAgICAgICAgICAgIG0gPSBhW2QgKyAxXTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIG0gPSAwO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIG4gPSBkICsgMiA8IGEubGVuZ3RoO1xyXG4gICAgICAgICAgICBpZiAobikge1xyXG4gICAgICAgICAgICAgICAgcSA9IGFbZCArIDJdO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgcSA9IDA7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgciA9IGYgPj4gMjtcclxuICAgICAgICAgICAgZiA9ICgoZiAmIDMpIDw8IDQpIHwgKG0gPj4gNCk7XHJcbiAgICAgICAgICAgIG0gPSAoKG0gJiAxNSkgPDwgMikgfCAocSA+PiA2KTtcclxuICAgICAgICAgICAgcSAmPSA2MztcclxuICAgICAgICAgICAgaWYgKCFuKSB7XHJcbiAgICAgICAgICAgICAgICBxID0gNjQ7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXEpIHtcclxuICAgICAgICAgICAgICAgICAgICBtID0gNjQ7XHJcbiAgICAgICAgICAgICAgICB9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Q3pELFlBQU0sS0FBSyxPQUFPLGFBQWE7QUFBQSxJQUNqQyxDQUFDLENBQUM7QUFBQSxFQUNSO0FBQ0Y7IiwKICAibmFtZXMiOiBbXQp9Cg== diff --git a/manifest.json b/manifest.json index f3989e5..f6e3c43 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-ytranscript", "name": "YTranscript", - "version": "0.2.0", + "version": "0.3.0", "minAppVersion": "0.15.0", "description": "This is simple plugin to fetch transcription for Youtube.", "author": "Łukasz Strzępek", diff --git a/transcript-view.ts b/transcript-view.ts index 7a203f5..27b154b 100644 --- a/transcript-view.ts +++ b/transcript-view.ts @@ -4,12 +4,12 @@ import YoutubeTranscript from "youtube-transcript"; export const TRANSCRIPT_TYPE_VIEW = "transcript-view"; const formatTimestamp = (t: number): string => { const fnum = (n: number) => (n && n < 10) ? "0" + n.toFixed() : n.toFixed(); - const h = 3600 * 1000; + const s = 1000; + const m = 60 * s; + const h = 60 * m; const hours = Math.floor(t / h); - const m = 60 * 1000; const minutes = Math.floor((t - hours * h) / m); - const ms = 1000; - const seconds = Math.floor((t - minutes * m) / ms); + const seconds = Math.floor((t - minutes * m) / s); const time = hours ? [hours, minutes, seconds] : [minutes, seconds]; return time.map(fnum).join(':') } @@ -39,7 +39,9 @@ export class TranscriptView extends ItemView { if (i % timestampMod == 0) { div = createEl('div'); const button = createEl('button', { cls: "timestamp", attr: { "data-timestamp": line.offset.toFixed() } }); - button.innerText = formatTimestamp(line.offset); + const link = createEl('a', { text: formatTimestamp(line.offset), attr: { "href": url + '&t=' + Math.floor(line.offset / 1000) } }); + button.appendChild(link); + // button.innerText = formatTimestamp(line.offset); const span = this.contentEl.createEl('span', { cls: "transcript-line", text: line.text + " " }); div.appendChild(button); div.appendChild(span);