Skip to content

Commit

Permalink
Auto convert .srt to .vtt files for subtitles
Browse files Browse the repository at this point in the history
Add shutdown tasks to delete files created during runtime
Update README.md
  • Loading branch information
dormant-user committed Jan 16, 2024
1 parent 793ba17 commit 49337f4
Show file tree
Hide file tree
Showing 17 changed files with 183 additions and 65 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ python -m pip install stream-localhost

## Sample Usage
```python
import asyncio
import os
import pystream

Expand All @@ -28,7 +29,7 @@ if __name__ == '__main__':
)
# Add the following to host on local IP address, skip for localhost (127.0.0.1)
# kwargs["video_host"] = pystream.utils.get_local_ip()
pystream.start(**kwargs)
asyncio.run(pystream.start(**kwargs))
```

### Env Variables
Expand Down
7 changes: 7 additions & 0 deletions doc_gen/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ Stream
:members:
:undoc-members:

Subtitles
=========

.. automodule:: pystream.models.subtitles
:members:
:undoc-members:

Routers
=======
Authentication
Expand Down
5 changes: 3 additions & 2 deletions docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ <h2>Install<a class="headerlink" href="#install" title="Permalink to this headin
</section>
<section id="sample-usage">
<h2>Sample Usage<a class="headerlink" href="#sample-usage" title="Permalink to this heading"></a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">os</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">asyncio</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">pystream</span>

<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">&#39;__main__&#39;</span><span class="p">:</span>
Expand All @@ -70,7 +71,7 @@ <h2>Sample Usage<a class="headerlink" href="#sample-usage" title="Permalink to t
<span class="p">)</span>
<span class="c1"># Add the following to host on local IP address, skip for localhost (127.0.0.1)</span>
<span class="c1"># kwargs[&quot;video_host&quot;] = pystream.utils.get_local_ip()</span>
<span class="n">pystream</span><span class="o">.</span><span class="n">start</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="n">asyncio</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">pystream</span><span class="o">.</span><span class="n">start</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">))</span>
</pre></div>
</div>
<section id="env-variables">
Expand Down
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ python -m pip install stream-localhost

## Sample Usage
```python
import asyncio
import os
import pystream

Expand All @@ -28,7 +29,7 @@ if __name__ == '__main__':
)
# Add the following to host on local IP address, skip for localhost (127.0.0.1)
# kwargs["video_host"] = pystream.utils.get_local_ip()
pystream.start(**kwargs)
asyncio.run(pystream.start(**kwargs))
```

### Env Variables
Expand Down
3 changes: 2 additions & 1 deletion docs/_sources/README.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ python -m pip install stream-localhost

## Sample Usage
```python
import asyncio
import os
import pystream

Expand All @@ -28,7 +29,7 @@ if __name__ == '__main__':
)
# Add the following to host on local IP address, skip for localhost (127.0.0.1)
# kwargs["video_host"] = pystream.utils.get_local_ip()
pystream.start(**kwargs)
asyncio.run(pystream.start(**kwargs))
```

### Env Variables
Expand Down
7 changes: 7 additions & 0 deletions docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ Stream
:members:
:undoc-members:

Subtitles
=========

.. automodule:: pystream.models.subtitles
:members:
:undoc-members:

Routers
=======
Authentication
Expand Down
30 changes: 26 additions & 4 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ <h1 id="index">Index</h1>
<div class="genindex-jumpbox">
<a href="#A"><strong>A</strong></a>
| <a href="#C"><strong>C</strong></a>
| <a href="#D"><strong>D</strong></a>
| <a href="#E"><strong>E</strong></a>
| <a href="#F"><strong>F</strong></a>
| <a href="#G"><strong>G</strong></a>
Expand Down Expand Up @@ -77,6 +78,14 @@ <h2 id="C">C</h2>
</ul></td>
</tr></table>

<h2 id="D">D</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.models.config.Static.deletions">deletions (pystream.models.config.Static attribute)</a>
</li>
</ul></td>
</tr></table>

<h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
Expand Down Expand Up @@ -201,6 +210,8 @@ <h2 id="M">M</h2>
<li><a href="index.html#module-pystream.models.squire">pystream.models.squire</a>
</li>
<li><a href="index.html#module-pystream.models.stream">pystream.models.stream</a>
</li>
<li><a href="index.html#module-pystream.models.subtitles">pystream.models.subtitles</a>
</li>
<li><a href="index.html#module-pystream.routers.auth">pystream.routers.auth</a>
</li>
Expand Down Expand Up @@ -263,15 +274,15 @@ <h2 id="P">P</h2>
<li><a href="index.html#module-pystream.models.config">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
pystream.models.images

<ul>
<li><a href="index.html#module-pystream.models.images">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
pystream.models.squire

Expand All @@ -284,6 +295,13 @@ <h2 id="P">P</h2>

<ul>
<li><a href="index.html#module-pystream.models.stream">module</a>
</li>
</ul></li>
<li>
pystream.models.subtitles

<ul>
<li><a href="index.html#module-pystream.models.subtitles">module</a>
</li>
</ul></li>
<li>
Expand Down Expand Up @@ -348,12 +366,16 @@ <h2 id="S">S</h2>
</li>
<li><a href="index.html#pystream.models.config.Session">Session (class in pystream.models.config)</a>
</li>
<li><a href="index.html#pystream.main.start">start() (in module pystream.main)</a>
<li><a href="index.html#pystream.main.shutdown_tasks">shutdown_tasks() (in module pystream.main)</a>
</li>
<li><a href="index.html#pystream.main.startup_tasks">startup_tasks() (in module pystream.main)</a>
<li><a href="index.html#pystream.models.subtitles.srt_to_vtt">srt_to_vtt() (in module pystream.models.subtitles)</a>
</li>
<li><a href="index.html#pystream.main.start">start() (in module pystream.main)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.main.startup_tasks">startup_tasks() (in module pystream.main)</a>
</li>
<li><a href="index.html#pystream.models.config.Static">Static (class in pystream.models.config)</a>
</li>
<li><a href="index.html#pystream.models.config.Static.stream">stream (pystream.models.config.Static attribute)</a>
Expand Down
Loading

0 comments on commit 49337f4

Please sign in to comment.