stigger / trakt-for-appletv

Trakt.tv scrobbler for Apple TV
49 stars 7 forks source link

YAMLLoadWarning #15

Closed wolverine30008 closed 3 years ago

wolverine30008 commented 3 years ago

Hi Stigger,

My ATV states that trakt scrobbler is connected but when I start a show or movie it is not scrobbling with trakt. Here is my terminal log for review. The only error I am receiving is the YAMLLoadWarning.

I neglected to mention in my previous post that I am running TVOS 14. Is TVOS 14 currently supported?

python3 ./tvscrobbler.py ./tvscrobbler.py:21: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. config = yaml.load(open('data/config.yml', 'r')) ready!

stigger commented 3 years ago

No, I haven't updated my Apple TV to the beta yet, so haven't tested with it. Which app are you using on Apple TV?

wolverine30008 commented 3 years ago

I have tried the Apple TV app, iTunes TV Shows and Movies, Amazon and Netflix but nothing works.

wolverine30008 commented 3 years ago

Hi Stigger,

In addition to the log above I am now receiving these errors

Fatal error: protocol.data_received() call failed. protocol: <scrobbling.ScrobblingRemoteProtocol object at 0x102138400> transport: <_SelectorSocketTransport fd=7 read=polling write=<idle, bufsize=0>> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/selector_events.py", line 824, in _read_ready__data_received self._protocol.data_received(data) File "/Users//Desktop/trakt-for-appletv-master/media_remote.py", line 75, in data_received decrypted = self.decrypt(data) File "/Users//Desktop/trakt-for-appletv-master/media_remote.py", line 35, in decrypt res, self.input_nonce = self.do_encryption_operation(self.input_key.decrypt, data, self.input_nonce) File "/Users//Desktop/trakt-for-appletv-master/media_remote.py", line 24, in do_encryption_operation res = operation(b'\0\0\0\0' + nonce.to_bytes(8, sys.byteorder), data, None) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/cryptography/hazmat/primitives/ciphers/aead.py", line 55, in decrypt backend, self, nonce, data, associated_data, 16 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/aead.py", line 160, in _decrypt raise InvalidTag cryptography.exceptions.InvalidTag

intrepidsilence commented 3 years ago

I am seeing this error too (YAMLLoadWarning). Will it be fixed as described by the maintainer of that module?

stigger commented 3 years ago

Yes, I don't see why not.

intrepidsilence commented 3 years ago

Here is the fix. I might submit a pull at some point.

diff --git a/data/config.yml b/data/config.yml
index dd5dea7..31e0259 100644
--- a/data/config.yml
+++ b/data/config.yml
@@ -1,2 +1,4 @@
 device_info:
+  device_id: 3e:bb:1c:26:a7:21
   name: Trakt Scrobbler
+  unique_identifier: 4129efc6-9935-11eb-af70-acde48001122
diff --git a/tvscrobbler.py b/tvscrobbler.py
index 8cd1160..bd0922a 100644
--- a/tvscrobbler.py
+++ b/tvscrobbler.py
@@ -18,7 +18,7 @@ def on_service_state_change(zeroconf, service_type, name, state_change):

 def load_config():
-    config = yaml.load(open('data/config.yml', 'r'))
+    config = yaml.load(open('data/config.yml', 'r'), Loader=yaml.FullLoader)

     changed = False
     if 'unique_identifier' not in config['device_info']:
stigger commented 3 years ago

@intrepidsilence Thank you!

intrepidsilence commented 3 years ago

@wolverine30008 This is a closed ticket. It would be better if you opened a new issue with details of what you are facing.