Skip to content
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

play_url start and stop any video #99

Closed
deepch opened this issue Jul 17, 2017 · 11 comments
Closed

play_url start and stop any video #99

deepch opened this issue Jul 17, 2017 · 11 comments

Comments

@deepch
Copy link

deepch commented Jul 17, 2017

I tried both avi and mp4 and still get the same

DEBUG: media playback ended

bash-3.2$ atvremote --debug -a --airplay_credentials EE109CBFE1CFE549:1E88A3CC55584CFF2DE7DB4463A2C8E34F81B0FBC843275B65329FB413CA2F11  play_url=http://171.25.232.20:8080/api/v1/stream/20_FvZ3oYGWmY7HiwsJAPygB8SFOT5kxa/hls/index.m3u8,0
DEBUG: Discovering devices for 3 seconds
DEBUG: Auto-discovered service Apple TV at 192.168.1.130 (hsgid: 00000000-7552-80fc-81b6-e38bf8864aec)
DEBUG: Aborting since a device was found
INFO: Auto-discovered Apple TV at 192.168.1.130
DEBUG: Authentication keys (Private=1e88a3cc55584cff2de7db4463a2c8e34f81b0fbc843275b65329fb413ca2f11, Public=b419c8c05a7ebc6e0abffa3f6afa010fcce036a39a63d1e8efd0cdd180be9816)
DEBUG: Loaded AirPlay credentials: EE109CBFE1CFE549:1E88A3CC55584CFF2DE7DB4463A2C8E34F81B0FBC843275B65329FB413CA2F11
DEBUG: Verification keys (Private=1888a3cc55584cff2de7db4463a2c8e34f81b0fbc843275b65329fb413ca2f51, Public=3250d94ea71ac3641ec6fd919a986d318bb35e9d1e9e4d2648530ea5af8d2f57)
DEBUG: POST URL: http://192.168.1.130:7000/pair-verify
DEBUG: -> Data[68]: b'010000003250d94ea71ac3641ec6fd919a986d318bb35e9d1e9e4d2648530ea5af8d2f57b419c8c05a7ebc6e0abffa3f6afa010fcce036a39a63d1e8efd0cdd180be9816'
DEBUG: <- Data[96]: b'9721f07891310b4d4310ed4ef8f88b420a590eba278ce833870ec1ec19a9df2a70b7d2e34fc6203ae5a8a37d2ff6a29afc00e4274f5abeb0a25d9d48a3a447a066371ba896727aad3fe57714b741ac7fad67264c24ff33b6ca81bde363a7f38b'
DEBUG: Verify (PublicSecret=9721f07891310b4d4310ed4ef8f88b420a590eba278ce833870ec1ec19a9df2a, Data=70b7d2e34fc6203ae5a8a37d2ff6a29afc00e4274f5abeb0a25d9d48a3a447a066371ba896727aad3fe57714b741ac7fad67264c24ff33b6ca81bde363a7f38b)
DEBUG: Shared secret (Secret=3aa309a7fb8552e4c7b5deab015141381b22e07733148328c495e9caa0fd1d5c)
DEBUG: Pair-Verify-AES (Key=fb79c523e23e05e316a9f1a611893bd3, IV=f4e9767c31d47da1a608565ce446a0dc)
DEBUG: Signature (Signature=6a37b4847491cc309cb5165879fe058e84f3301541938c1f768cd35415a1559e804f96ef75d3280d3d8128edc1b3b0843c7d5e7e4571c33967a8d75e1fa1fd23)
DEBUG: POST URL: http://192.168.1.130:7000/pair-verify
DEBUG: -> Data[68]: b'000000006a37b4847491cc309cb5165879fe058e84f3301541938c1f768cd35415a1559e804f96ef75d3280d3d8128edc1b3b0843c7d5e7e4571c33967a8d75e1fa1fd23'
DEBUG: AirPlay 0 to http://192.168.1.130:7000/play
DEBUG: media playback ended
bash-3.2$ 

I see how the player appears on the download screen and then interrupts.

@postlund
Copy link
Owner

Can you try if this one works:
http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4
It is very, very picky about what it plays.

@postlund
Copy link
Owner

Oh, also please try removing ,0 at the end. It might work and I might have broken something without realizing it.

@deepch
Copy link
Author

deepch commented Jul 17, 2017

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pyatv/main.py", line 416, in _run_application
return (yield from cli_handler(loop))
File "/usr/local/lib/python3.6/site-packages/pyatv/main.py", line 255, in cli_handler
return (yield from _handle_autodiscover(args, loop))
File "/usr/local/lib/python3.6/site-packages/pyatv/main.py", line 299, in _handle_autodiscover
return (yield from _handle_commands(args, loop))
File "/usr/local/lib/python3.6/site-packages/pyatv/main.py", line 331, in _handle_commands
ret = yield from _handle_device_command(args, cmd, atv, loop)
File "/usr/local/lib/python3.6/site-packages/pyatv/main.py", line 367, in _handle_device_command
return (yield from _exec_command(atv.airplay, cmd, *cmd_args))
File "/usr/local/lib/python3.6/site-packages/pyatv/main.py", line 381, in _exec_command
value = yield from tmp(*args)
TypeError: play_url() missing 1 required positional argument: 'url'

@deepch
Copy link
Author

deepch commented Jul 17, 2017

def play_url(self, url, position=0):

So, as it is broken url I've tried to custom url, and it was working.

But I've checked what is get from your url param. It was always 0.

Thank you very much for your help, but I think U should fix it.

@postlund
Copy link
Owner

Humm, this is weird. The method you should look at is the one in interface,py, the one you listed is from the internal implementation which is not what atvremote is calling. Can you paste something that does work including your CLI arguments?

@deepch
Copy link
Author

deepch commented Jul 17, 2017

I just checked
def play_url(self, url, position=0):
print(url)
And got 0

I thought that this is not true and indicated this manually.

bash-3.2$ atvremote -a --airplay_credentials EE109CBFE1CFE549:1E88A3CC55584CFF2DE7DB4463A2C8E34F81B0FBC843275B65329FB413CA2F11 play_url=http://171.25.232.20:8080/api/v1/stream/7APGKT890RFDK5tGByECRGDaSgjmaQ/hls/index.m3u8,0

I tried differently. But always there was a result of 0.

@postlund
Copy link
Owner

Did you try without ,0 at the end?

@deepch
Copy link
Author

deepch commented Jul 17, 2017

yes I try and error

TypeError: play_url() missing 1 required positional argument: 'url'

@lightbord
Copy link

lightbord commented Jul 18, 2017

If it helps at all, I have discovered that adding "0," then the url you want to play solves the problem. Possibly related to the function being defined with "self" in play_url(self, url, **kwargs). Though I'm not great with python so that may break something else. But I've had this issue with other things I've written in python too.

I thought I was doing something wrong then saw someone append a ,0 to the end in a previous issue, then thought "what if I try it with the 0, before, maybe play_url is just taking everything after the = int the command as its arguments, which would mean the URL is being passed to self instead of url". So essentially it will pass 0 to the self argument, and then whatever is after the , in the command line to the url

@postlund
Copy link
Owner

I found the problem to be an optional argument which was a problem due to the generic argument passing I use (atvremote is more or less a wrapper on top o the public API, so I just pass arguments over to the API). Since play_url lives inside a class, the self must always be the first argument (can be called anything, but self is more or less standard). Problem will be fixed by #101 and a release out soon. I have another bug that I need to fix

@deepch
Copy link
Author

deepch commented Jul 18, 2017

Thank you so much. Your code is excellent. Thanks for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants