-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add window title to PotPlayer #2224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2224 +/- ##
==========================================
+ Coverage 52.36% 52.65% +0.28%
==========================================
Files 237 237
Lines 14712 14751 +39
==========================================
+ Hits 7704 7767 +63
+ Misses 7008 6984 -24 |
Codecov Report
@@ Coverage Diff @@
## master #2224 +/- ##
==========================================
- Coverage 52.36% 52.18% -0.19%
==========================================
Files 237 237
Lines 14712 14715 +3
==========================================
- Hits 7704 7679 -25
- Misses 7008 7036 +28 |
|
Added tests |
|
Thanks for the PR @RomanKornev. Does the titles work with named pipes too? Maybe PotPlayer doesn't work with named pipes anyway. Can you test it with a title that has some quote characters? eg. |
It doesn't work with named pipes: https://streamlink.github.io/players.html.
Upon further examination, PotPlayer just deletes any quotes anyway and doesn't recognize anything after closing quote. So |
src/streamlink_cli/constants.py
Outdated
| "vlc": ["vlc", "vlc.exe"], | ||
| "mpv": ["mpv", "mpv.exe"] | ||
| "mpv": ["mpv", "mpv.exe"], | ||
| "pot": ["potplayer", "potplayermini64.exe", "potplayermini.exe"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there even a potplayer binary? as this player is windows only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now tests are failing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failing test:
self.assertEqual("potplayer", PlayerOutput.supported_player("C:\\PotPlayer\\PotPlayerMini64.exe"))Unable to reproduce on Windows. Something to do with
streamlink/src/streamlink_cli/output.py
Lines 123 to 132 in 6df8835
| if not is_win32: | |
| # under a POSIX system use shlex to find the actual command | |
| # under windows this is not an issue because executables end in .exe | |
| cmd = shlex.split(cmd)[0] | |
| cmd = os.path.basename(cmd.lower()) | |
| for player, possiblecmds in SUPPORTED_PLAYERS.items(): | |
| for possiblecmd in possiblecmds: | |
| if cmd.startswith(possiblecmd): | |
| return player |
Is
.exe getting split?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can't work there with cmd.startswith(possiblecmd)
seems like you need potplayer as a binary here to avoid bigger code changes
this is the output on linux
_________________________________________________________________________________________________________ TestPlayerOutput.test_supported_player_args_win32 _________________________________________________________________________________________________________
self = <tests.test_output.TestPlayerOutput testMethod=test_supported_player_args_win32>
@patch("streamlink_cli.output.os.path.basename", new=ntpath.basename)
def test_supported_player_args_win32(self):
self.assertEqual("mpv",
PlayerOutput.supported_player("C:\\MPV\\mpv.exe --argh"))
self.assertEqual("vlc",
PlayerOutput.supported_player("C:\\VLC\\vlc.exe --argh"))
self.assertEqual("potplayer",
> PlayerOutput.supported_player("C:\\PotPlayer\\PotPlayerMini64.exe --argh"))
E AssertionError: 'potplayer' != None
tests/test_output.py:43: AssertionError
----------------------------------------------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------------------------------------------
---
player = vlc
cmd = mpvmpv.exe
possiblecmd = vlc
possiblecmd = vlc.exe
---
player = mpv
cmd = mpvmpv.exe
possiblecmd = mpv
---
player = vlc
cmd = vlcvlc.exe
possiblecmd = vlc
---
player = vlc
cmd = potplayerpotplayermini64.exe
possiblecmd = vlc
possiblecmd = vlc.exe
---
player = mpv
cmd = potplayerpotplayermini64.exe
possiblecmd = mpv
possiblecmd = mpv.exe
---
player = potplayer
cmd = potplayerpotplayermini64.exe
possiblecmd = potplayermini64.exe
possiblecmd = potplayermini.exe
___________________________________________________________________________________________________________ TestPlayerOutput.test_supported_player_win32 ____________________________________________________________________________________________________________
self = <tests.test_output.TestPlayerOutput testMethod=test_supported_player_win32>
@patch("streamlink_cli.output.os.path.basename", new=ntpath.basename)
def test_supported_player_win32(self):
self.assertEqual("mpv",
PlayerOutput.supported_player("C:\\MPV\\mpv.exe"))
self.assertEqual("vlc",
PlayerOutput.supported_player("C:\\VLC\\vlc.exe"))
self.assertEqual("potplayer",
> PlayerOutput.supported_player("C:\\PotPlayer\\PotPlayerMini64.exe"))
E AssertionError: 'potplayer' != None
tests/test_output.py:27: AssertionError
----------------------------------------------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------------------------------------------
---
player = vlc
cmd = mpvmpv.exe
possiblecmd = vlc
possiblecmd = vlc.exe
---
player = mpv
cmd = mpvmpv.exe
possiblecmd = mpv
---
player = vlc
cmd = vlcvlc.exe
possiblecmd = vlc
---
player = vlc
cmd = potplayerpotplayermini64.exe
possiblecmd = vlc
possiblecmd = vlc.exe
---
player = mpv
cmd = potplayerpotplayermini64.exe
possiblecmd = mpv
possiblecmd = mpv.exe
---
player = potplayer
cmd = potplayerpotplayermini64.exe
possiblecmd = potplayermini64.exe
possiblecmd = potplayermini.exeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted back to previous binary name.
src/streamlink_cli/constants.py
Outdated
| "vlc": ["vlc", "vlc.exe"], | ||
| "mpv": ["mpv", "mpv.exe"] | ||
| "mpv": ["mpv", "mpv.exe"], | ||
| "pot": ["potplayer", "potplayermini64.exe", "potplayermini.exe"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potplayer is always used as Potplayer
I can't find any references with just the name pot
so it should be named potplayer instead of pot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
-- Remove potplayer binary name -- Fix tests
After #1576 we can add window title support to other players.
Due to limitations of PotPlayer, titles can only be added to URL streams and there is no separate title argument.
PotPlayer command line documentation in
PotPlayer - About - Command Line:Because of this, the title needs to be appended at the end of the filename so args need to be formatted after player check.
Here's an example of it working on Windows 10:
