Support BSPlayer Subtitles provider
Thank you for the contribution. I'll review this whenever I can
Is there any way how to help with merging this? The code seams clean enough, but I'm not familiar with the code enough.
bump
As subliminal seems alive again, I'm working again on this to sync with the latest changes
I think is ready to review :smiley:
Thanks!
You can find some guidance about the tools we use for linting and typing (ruff/pre-commit and mypy) in the CONTRIBUTING file
The errors with the tests for python < 3.12 seem to be a missing line at the top of the files: from __future__ import annotations
It's seems that there is something wrong with Python 3.9 and below, the response from BSPlayer is recorded as "binary", but from Python 3.10, is correctly recorded as a string (check tests/cassettes/bsplayer/test_login.yaml and tests/cassettes/bsplayer.py3.9/test_login.yaml)
The solution I found is to have two different recordings, one for Python <=3.9 (named bsplayer.py3.9) and another for python >=3.10 (named bsplayer)
Do you have any thoughts about this?
You can try adding the decode_compressed_response=True argument when initializing VCR in test_bsplayer.py, see the other providers.
You can try adding the
decode_compressed_response=Trueargument when initializingVCRintest_bsplayer.py, see the other providers.
That is! Thank you! I didn't see that.
I also fixed the mypy warnigns, so now is really ready for review
Pd. The mypy analysis is not documented on the contribution guide
Coverage report
This report was generated by python-coverage-comment-action
Click to see where and how coverage changed
File Statements Missing Coverage Coverage
(new stmts)Lines missing
subliminal/providers
bsplayer.py
107-111, 116-120, 125-129, 171-175, 177, 193, 218
subliminal/refiners
hash.py
Project Total
Hey! Anything else I need to do before this PR can be reviewed/merged?
Hi @Nyaran, Thanks a lot for your contribution!
I made some modifications about types and making sure connection errors are correctly handled.
I have one question though, you initialize a self.server attribute to a ServerProxy but it is never used, was it a remnant of older code?
(failing CI for docs does not seem to be related to this PR)
I have one question though, you initialize a
self.serverattribute to aServerProxybut it is never used, was it a remnant of older code?
Looks like remnant code, should be safe to remove it
Ok, LGTM! @ptrcnull do you have time to have a quick look?
Merged!
Thanks again @Nyaran for the PR and updating to the latest change!!
Congrats! Long time coming