Skip to main content

PyPS4-2ndScreen

|BuildStatus| |PypiVersion| |PyPiPythonVersions| |CodeCov|

|Docs|

Description

A full Python implementation based on the Node.js package, ps4-waker, which is an unofficial API for the PS4 2nd Screen App.

This module is mainly targeted towards developers although the module does include a basic CLI.

Disclaimer: This project/module and I are not affiliated with or endorsed by Sony Interactive Entertainment LLC. As such this project may break at any time.

Features

This module can perform almost every feature found in the PS4 Second Screen App.

  • PS4 power and playing media state/status reporting
  • Remote control
  • Power on and standby control
  • Starting a specific game/media
  • Media information retrieval from the Playstation Store

Compatibility

Tested on:

  • Environment: Python 3.6/3.7/3.8

  • Operating System: Debian

Installation

Package can be installed with pip or from source.

It is advised to install the module in a virtual env.

Create virtual env first:

.. code:: bash

python -m venv .
source bin/activate

To install from pip:

.. code:: bash

pip install pyps4-2ndscreen

To install from source clone this repository and run from top-level:

.. code:: bash

pip install -r requirements.txt
python setup.py install

Protocol

UDP is used to get status updates and retrieve user credentials. TCP is used to send commands to the PS4 Console.

Ports

This module uses UDP port 1987 by default as the source port for polling the PS4.

PS4 listens on ports 987 (Priveleged) to fetch user PSN credentials.

In order to obtain user credentials, the Python Interpreter needs access to port 987 on the host system. The credential service pretends to be a PS4 console and will receive broadcast packets from the PS4 2nd Screen app on port 987.

Example:

.. code:: bash

sudo setcap 'cap_net_bind_service=+ep' /usr/bin/python3.5

This is so you do not need sudo/root priveleges to run.

Cover Art Issues

If you find that media art cannot be found. Please post an issue with your Region, Country, Title of game, an ID of game.

Known Issues

  • PS Command inconsistent.
  • On-Screen Keyboard is not implemented.

Credits

Thanks to hthiery for writing the underlying socket protocol in Python. https://github.com/hthiery/python-ps4

References

.. |BuildStatus| image:: https://circleci.com/gh/ktnrg45/pyps4-2ndscreen.svg?style=svg :target: https://circleci.com/gh/ktnrg45/pyps4-2ndscreen .. |PyPiVersion| image:: https://badge.fury.io/py/pyps4-2ndscreen.svg :target: http://badge.fury.io/py/pyps4-2ndscreen .. |PyPiPythonVersions| image:: https://img.shields.io/pypi/pyversions/pyps4-2ndscreen.svg :alt: Python versions :target: http://badge.fury.io/py/pyps4-2ndscreen .. |Docs| image:: https://readthedocs.org/projects/pyps4-2ndscreen/badge/?version=dev :target: https://pyps4-2ndscreen.readthedocs.io/en/dev/?badge=dev :alt: Documentation Status .. |CodeCov| image:: https://codecov.io/gh/ktnrg45/pyps4-2ndscreen/branch/dev/graph/badge.svg
:target: https://codecov.io/gh/ktnrg45/pyps4-2ndscreen/ :alt: Code Coverage

Metadata

Release files for pyps4-2ndscreen 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyps4-2ndscreen 1.3.1
File Size Uploaded
pyps4_2ndscreen-1.3.1.tar.gz 41.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyps4-2ndscreen 1.3.1
File Interpreter ABI Platform
pyps4_2ndscreen-1.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 86.2 kB

Release files / pyps4_2ndscreen-1.3.1.tar.gz

Download URL pyps4_2ndscreen-1.3.1.tar.gz
Size 41.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d275cd9c270bf59f2c1501ce1aec7daa4212eefcffa19aeab7b5e5508ea5d05c
BLAKE2b-256 checksum
How to use checksums
f6a257d7fc4eb36aae838e068ea26f297407257d4a972c8b5d4c019b7b95d93f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.10

Release files / pyps4_2ndscreen-1.3.1-py3-none-any.whl

Download URL pyps4_2ndscreen-1.3.1-py3-none-any.whl
Size 44.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb56d7bbb2811a2ea767c344035cd5c11608f676dcc30f2ed2b6b2c55e29f447
BLAKE2b-256 checksum
How to use checksums
402ead17678c2345aa9c5cf673b2098a5a5e81f6703d21ef7fb7426197987c16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.3.1 This release

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.9.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page