Eittipat / pyrtmp

PyRTMP: Pure Python RTMP server
MIT License
90 stars 20 forks source link

Fixing breaking bitstring import #7

Closed KneeNinetySeven closed 1 year ago

KneeNinetySeven commented 1 year ago

Fixing breaking bitstring import

Situation

The library was unable to be used in python 3.x environments.

Reproduction

RUN mkdir -p /application

WORKDIR /application COPY . /application/

RUN python -m pip install --upgrade pip && \ apk add git build-base linux-headers RUN --mount=type=cache,target=~/.cache/pip pip install -r requirements.txt

ENTRYPOINT [ "python", "main.py" ]

- Build image
- Run container

## Fix
Change: 

from bitstring import tokenparser, BitStream

To: 

from bitstring import BitStream from bitstring.bitstream import tokenparser



Tested in: 
Python 3.10 on Alpine 3.18
DEBUG set to True and False checked.

To test, simply replace the `pyrtmp==0.2.0` in the `requirements.txt` by `pyrtmp @ git+https://github.com/KneeNinetySeven/pyrtmp` 
Eittipat commented 1 year ago

Thank you for contribution