Commits

Blue  committed 3fd236f

Minor bit of work on decoding (probably) nzb posts.

  • Participants
  • Parent commits cf8f49f

Comments (0)

Files changed (2)

File spotnet/connection.py

                 # TODO: find a way to check if we're really disconnected
                 # and rethrow the exception if not
                 pass
+            except socket.error as e:
+                if e.errno != errno.EPIPE:
+                    raise
             self._nntp = None
 
     def update(self, logger=noop):

File spotnet/post.py

     def check_content_is_nzb(self):
         if self._content_is_nzb is None:
             content = self.get_content()
-            try:
-                # TODO: yenc decoding and possibly some more
-                # because this alone never seems to work
-                decode_nzb(content)
-            except DecodeNzbError:
+            if content.startswith('=ybegin'):
+                try:
+                    # TODO: yenc decoding and possibly some more
+                    # because this alone never seems to work
+                    ydecoded = content  # TODO
+                    decode_nzb(ydecoded)
+                except DecodeNzbError:
+                    self._content_is_nzb = False
+                else:
+                    self._content_is_nzb = True
+                self._content_is_nzb = True  # TODO
+            else:
                 self._content_is_nzb = False
-            else:
-                self._content_is_nzb = True
         return self._content_is_nzb
 
     # public properties