{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# WebVTT Reading and Chunking Test" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from functools import partial\n", "from html import escape\n", "from io import BytesIO\n", "from IPython.display import display_html\n", "from itertools import chain\n", "import re\n", "from webvtt import Caption, WebVTT\n", "\n", "display_html = partial(display_html, raw=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "FILE_PATH = #" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "with open(FILE_PATH, 'rb') as file:\n", " web_vtt = WebVTT.from_buffer(BytesIO(file.read()))" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "