mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 13:53:15 -07:00
add remote path handling for LazyLibrarian #1223
This commit is contained in:
parent
52cae37609
commit
5375d46c32
3 changed files with 26 additions and 2 deletions
|
@ -12,7 +12,12 @@ import requests
|
|||
import core
|
||||
from core import logger
|
||||
from core.auto_process.common import ProcessResult
|
||||
from core.utils import convert_to_ascii, server_responding
|
||||
from core.utils import (
|
||||
convert_to_ascii,
|
||||
remote_dir,
|
||||
server_responding,
|
||||
)
|
||||
|
||||
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
|
||||
|
@ -28,6 +33,7 @@ def process(section, dir_name, input_name=None, status=0, client_agent='manual',
|
|||
ssl = int(cfg.get('ssl', 0))
|
||||
web_root = cfg.get('web_root', '')
|
||||
protocol = 'https://' if ssl else 'http://'
|
||||
remote_path = int(cfg.get('remote_path', 0))
|
||||
|
||||
url = '{0}{1}:{2}{3}/api'.format(protocol, host, port, web_root)
|
||||
if not server_responding(url):
|
||||
|
@ -42,7 +48,7 @@ def process(section, dir_name, input_name=None, status=0, client_agent='manual',
|
|||
params = {
|
||||
'apikey': apikey,
|
||||
'cmd': 'forceProcess',
|
||||
'dir': dir_name,
|
||||
'dir': remote_dir(dir_name) if remote_path else dir_name,
|
||||
}
|
||||
logger.debug('Opening URL: {0} with params: {1}'.format(url, params), section)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue