diff options
-rw-r--r-- | module/network/HTTPChunk.py | 11 | ||||
-rwxr-xr-x | pyLoadCore.py | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py index 1cc9841a6..07012d072 100644 --- a/module/network/HTTPChunk.py +++ b/module/network/HTTPChunk.py @@ -128,6 +128,9 @@ class HTTPChunk(HTTPRequest): self.initHandle() self.setInterface(self.p.interface, self.p.proxies) + self.BOMChecked = False + # check and remove byte order mark + @property def cj(self): return self.p.cj @@ -174,6 +177,14 @@ class HTTPChunk(HTTPRequest): self.headerParsed = True def writeBody(self, buf): + + #ignore BOM, it confuses unrar + if not self.BOMChecked: + byte = bytearray(buf[:3]) + if tuple(byte) == (239,187,191): + buf = buf[3:] + self.BOMChecked = True + size = len(buf) self.arrived += size diff --git a/pyLoadCore.py b/pyLoadCore.py index 259e2cd0c..5923a3d7f 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -373,8 +373,6 @@ class Core(object): self.scheduler.addJob(0, self.accountManager.getAccountInfos) - self.server_methods.delete_finished() - while True: sleep(2) if self.do_restart: |