Настроил буфер кусков
parent
edd034bdbb
commit
b48f281c14
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<addon id="script.module.pyrrent2http" name="pyrrent2http" version="0.5.0" provider-name="inpos">
|
<addon id="script.module.pyrrent2http" name="pyrrent2http" version="0.6.0" provider-name="inpos">
|
||||||
<requires>
|
<requires>
|
||||||
<import addon="xbmc.python" version="2.14.0"/>
|
<import addon="xbmc.python" version="2.14.0"/>
|
||||||
<import addon="script.module.libtorrent" />
|
<import addon="script.module.libtorrent" />
|
||||||
|
|
|
@ -17,7 +17,7 @@ from . import SessionStatus, FileStatus, PeerInfo, MediaType, Encryption
|
||||||
from util import can_bind, find_free_port, ensure_fs_encoding
|
from util import can_bind, find_free_port, ensure_fs_encoding
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
LOGGING = True
|
LOGGING = False
|
||||||
|
|
||||||
class Engine:
|
class Engine:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -95,7 +95,7 @@ if not hasattr(os, 'getppid'):
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
|
||||||
AVOID_HTTP_SERVER_EXCEPTION_OUTPUT = True
|
AVOID_HTTP_SERVER_EXCEPTION_OUTPUT = True
|
||||||
VERSION = "0.5.0"
|
VERSION = "0.6.0"
|
||||||
USER_AGENT = "pyrrent2http/" + VERSION + " libtorrent/" + lt.version
|
USER_AGENT = "pyrrent2http/" + VERSION + " libtorrent/" + lt.version
|
||||||
|
|
||||||
VIDEO_EXTS={'.avi':'video/x-msvideo','.mp4':'video/mp4','.mkv':'video/x-matroska',
|
VIDEO_EXTS={'.avi':'video/x-msvideo','.mp4':'video/mp4','.mkv':'video/x-matroska',
|
||||||
|
@ -200,7 +200,7 @@ class TorrentFile(object):
|
||||||
def waitForPiece(self, piece):
|
def waitForPiece(self, piece):
|
||||||
def set_deadlines(p):
|
def set_deadlines(p):
|
||||||
next_piece = p + 1
|
next_piece = p + 1
|
||||||
BUF_SIZE = 20 # количество блоковв буфере
|
BUF_SIZE = 2 # Лучшее враг хорошего
|
||||||
for i in range(BUF_SIZE):
|
for i in range(BUF_SIZE):
|
||||||
if (next_piece + i < self.endPiece and
|
if (next_piece + i < self.endPiece and
|
||||||
not self.pieces_deadlined[(next_piece + i) - self.startPiece] and not self.havePiece(next_piece + i)):
|
not self.pieces_deadlined[(next_piece + i) - self.startPiece] and not self.havePiece(next_piece + i)):
|
||||||
|
|
Loading…
Reference in New Issue