Python AceStream
Python interface to interact with the AceStream Engine, HTTP API and Search API.
Installation
pip install acestream
Usage
import time
import subprocess
from acestream.server import Server
from acestream.engine import Engine
from acestream.stream import Stream
# Create an engine instance
engine = Engine('acestreamengine', client_console=True)
# Connect to a remote server
server = Server(host='streams.com', port=6880)
# If the remote server is not available, connect to a local server
if not server.available:
server = Server(host='127.0.0.1', port=6878)
# Start engine if the local server is not available
if not server.available:
engine.start()
# Wait for engine to start
while not engine.running:
time.sleep(1)
# Start a stream using an acestream channel ID
stream = Stream(server, id='ff36fce40a7d2042e327eaf9f215a1e9cb622b56')
stream.start()
# Open a media player to play the stream
player = subprocess.Popen(['mpv', stream.playback_url])
# Wait for player to close and stop the stream
player.communicate()
stream.stop()
# Stop acestream engine
engine.stop()
Search
import time
import random
import subprocess
from acestream.server import Server
from acestream.engine import Engine
from acestream.search import Search
# Create an engine instance
engine = Engine('acestreamengine', client_console=True)
# Connect to a local server
server = Server(host='127.0.0.1', port=6878)
# Start engine if the local server is not available
if not server.available:
engine.start(stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# Wait for engine to start
while not engine.running:
time.sleep(1)
# Start a search for the sport category
search = Search(server, category='sport')
search.get(page=1)
# Iterate and print search results
for result in search.results:
print("%40s %10s %40s" % (result.name, result.bitrate, result.infohash))
# Start a random stream from the search results
stream = random.choice(search.results).stream
stream.start(hls=True, transcode_audio=True)
# Open a media player to play the stream
player = subprocess.Popen(['mpv', stream.playback_url])
# Wait for player to close and stop the stream
player.communicate()
stream.stop()
# Stop acestream engine
engine.stop()
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/jonian/python-acestream.
License
Python AceStream is available as open source under the terms of the GPLv3
Metadata
Release files for acestream 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| acestream-0.2.0.tar.gz | 19.4 kB | Without provenance | Details for acestream-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| acestream-0.2.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for acestream-0.2.0-py2.py3-none-any.whl |
Total release size: 38.9 kB
Release files / acestream-0.2.0.tar.gz
| Download URL | acestream-0.2.0.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8422fc592b3001f662bafbf177ef8487fdc3c3a477aa9a6b173bccfafd2cd2d8
|
|
BLAKE2b-256 checksum How to use checksums |
f8b7378c2005e880e7b034e7b0a91fc04e2b36f1442a75e98059ce49c402eacd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
|
Release files / acestream-0.2.0-py2.py3-none-any.whl
| Download URL | acestream-0.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 19.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7878119108f11dd2462677a428f3f1e6a8a52719838ca4c4fe7eb067e05be390
|
|
BLAKE2b-256 checksum How to use checksums |
41a6a8ef419178b6bba4015c12daf2876d57204e74eb140711879eeabb7b476a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
|
Security for acestream 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.