mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 13:53:15 -07:00
Fix shutil.copyfileobj monkey patching
This commit is contained in:
parent
a6d2c6e96f
commit
5c644890e8
2 changed files with 13 additions and 9 deletions
|
@ -19,6 +19,7 @@ import subliminal
|
|||
import core
|
||||
from core import extractor, logger
|
||||
from core.utils.download_info import get_download_info, update_download_info_status
|
||||
from core.utils import shutil_custom
|
||||
from core.utils.network import test_connection, wake_on_lan, wake_up
|
||||
from core.utils.parsers import (
|
||||
parse_args,
|
||||
|
@ -47,15 +48,7 @@ except ImportError:
|
|||
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
|
||||
# Monkey Patch shutil.copyfileobj() to adjust the buffer length to 512KB rather than 4KB
|
||||
shutil.copyfileobjOrig = shutil.copyfileobj
|
||||
|
||||
|
||||
def copyfileobj_fast(fsrc, fdst, length=512 * 1024):
|
||||
shutil.copyfileobjOrig(fsrc, fdst, length=length)
|
||||
|
||||
|
||||
shutil.copyfileobj = copyfileobj_fast
|
||||
shutil_custom.monkey_patch()
|
||||
|
||||
|
||||
def sanitize_name(name):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue