Deployments
Python module to, stream videos via authenticated sessions using FastAPI
pip install stream-localhostimport asyncio
import os
import pystream
if __name__ == '__main__':
kwargs = dict(
authorization={"Alan Turing": "Pr0gRamM1ng", "Linus Torvalds": "LinuxOS"},
video_source=os.path.join(os.path.expanduser('~'), 'Downloads')
)
# Add the following to host on local IP address, skip for localhost (127.0.0.1)
# kwargs["video_host"] = pystream.utils.get_local_ip()
asyncio.run(pystream.start(**kwargs))💡 Environment variables can (optionally) be loaded from any plain text file.
Refer the wiki page for more information.
Mandatory
- AUTHORIZATION: Dictionary of key-value pairs with
usernameas key andpasswordas value. - VIDEO_SOURCE: Source path for video files.
💡 Files starting with
_(underscore) and.(dot) will be ignored
Optional
- VIDEO_HOST: IP address to host the video. Defaults to
127.0.0.1 - VIDEO_PORT: Port number to host the application. Defaults to
8000 - FILE_FORMATS: Sequence of supported video file formats. Defaults to
(.mp4, .mov) - WORKERS: Number of workers to spin up the
uvicornserver. Defaults to1 - WEBSITES: List of websites (supports regex) to add to CORS configuration. Required only if tunneled via CDN
- AUTO_THUMBNAIL: Boolean flag to auto generate thumbnail images for preview. Defaults to
True - KEY_FILE: Path to the private key file for SSL certificate. Defaults to
None - CERT_FILE: Path to the full chain file for SSL certificate. Defaults to
None - SECURE_SESSION: Boolean flag to secure the cookie
session_token. Defaults toFalse
💡 If
SECURE_SESSIONto set totrue, the cookiesession_tokenwill only be sent via HTTPS
This means that the server can ONLY be hosted viaHTTPSorlocalhost
Docstring format: Google
Styling conventions: PEP 8 and isort
Requirement
pip install gitverseUsage
gitverse-release reverse -f release_notes.rst -t 'Release Notes'pre-commit will ensure linting, run pytest, generate runbook & release notes, and validate hyperlinks in ALL
markdown files (including Wiki pages)
Requirement
pip install sphinx==5.1.1 pre-commit recommonmarkUsage
pre-commit run --all-fileshttps://pypi.org/project/stream-localhost/
https://thevickypedia.github.io/PyStream/
© Vignesh Rao
Licensed under the MIT License