jcarbaugh / python-roku

Screw remotes. Control your Roku with Python.
https://pypi.python.org/pypi/roku
BSD 3-Clause "New" or "Revised" License
288 stars 94 forks source link

Question. Is there a way to open a deep link? #83

Open Pinball3D opened 1 year ago

Pinball3D commented 1 year ago

I need to be able to open deep links with this library. Is this possible? if so, how?

jcarbaugh commented 1 year ago

Hello! I think so, but it depends whether the specific app supports it and you know the correct metadata about the content https://sdkdocs-archive.roku.com/Deep-Linking_4264420.html The contentId and mediaType parameters can be passed to the launch method.

roku.launch(123, {"contentId": 987, "mediaType": "movie"})
jpoet commented 1 week ago

Hi.

This works:

curl -d '' "http://192.168.1.22:8060/launch/195316?contentId=g5Wdv42YrFI&mediaType=live"`

But this does not:

roku = Roku('192.168.1.22')
roku.launch(195316, {"contentId": "g5Wdv42YrFI", "mediaType": "live"})
  File "/usr/local/lib/python3.12/site-packages/roku/core.py", line 299, in launch
    if app.roku and app.roku != self:
       ^^^^^^^^
AttributeError: 'int' object has no attribute 'roku'

Am I missing a step?

TIA