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

my computer c'ant Authentificate #2348

Open
ShadowHedgehog76 opened this issue Feb 6, 2024 · 0 comments
Open

my computer c'ant Authentificate #2348

ShadowHedgehog76 opened this issue Feb 6, 2024 · 0 comments
Labels

Comments

@ShadowHedgehog76
Copy link

What do you need help with?

i writed this code but its retuning this

code :
`import asyncio
import sys
from pyatv import connect, scan
from pyatv.const import Protocol
import asyncio
import pyautogui
from PIL import Image
import io
import numpy as np
import pyatv

async def print_what_is_playing():
print("Discovering devices on network...")
loop = asyncio.get_event_loop()
atvs = await scan(loop=loop)

if not atvs:
    print("No devices found")
    return

for i in atvs:
    print(i.name, " : ", i.address)

# Connect to the first device found
atv = await connect(atvs[0], protocol=Protocol.DMAP, loop=loop)

screenshot = pyautogui.screenshot()

# Convert the screenshot to a NumPy array
screenshot_np = np.array(screenshot)

# Convert the NumPy array to a PIL Image object
screenshot_pil = Image.fromarray(screenshot_np)

buffer = io.BytesIO()
screenshot_pil.save(buffer, format='JPEG')
buffer.seek(0)
metadata = {'title': 'Screenshot'}

try:
    # Play the YouTube video
    url = "/home/user/BigBuckBunny.mp4"
    await atv.stream.play_url(url)
    await asyncio.sleep(60)
finally:
    # Always close the connection
    atv.close()

if name == "main":
# Setup event loop and connect
loop = asyncio.get_event_loop()
loop.run_until_complete(print_what_is_playing())`

result :
Traceback (most recent call last): File "c:\Users\kaeli\Bureau\bordel\code\python\apple.py", line 52, in <module> loop.run_until_complete(print_what_is_playing()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "c:\Users\kaeli\Bureau\bordel\code\python\apple.py", line 43, in print_what_is_playing await atv.stream.play_url(url) File "C:\Users\kaeli\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pyatv\core\facade.py", line 356, in play_url await self.relay("play_url")(url, **kwargs) File "C:\Users\kaeli\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pyatv\protocols\airplay\__init__.py", line 136, in play_url return await self._play_task ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\kaeli\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pyatv\protocols\airplay\player.py", line 66, in play_url raise exceptions.AuthenticationError(f"status code: {resp.code}") pyatv.exceptions.AuthenticationError: status code: 404

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

No branches or pull requests

1 participant