mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
Fix PEP8 whitespace violations
This commit is contained in:
parent
e490f97a05
commit
52c6096b6a
14 changed files with 237 additions and 225 deletions
|
@ -35,13 +35,14 @@ def process_torrent(input_directory, input_name, input_category, input_hash, inp
|
||||||
pass
|
pass
|
||||||
|
|
||||||
control_value_dict = {"input_directory": text_type(input_directory1)}
|
control_value_dict = {"input_directory": text_type(input_directory1)}
|
||||||
new_value_dict = {"input_name": text_type(input_name1),
|
new_value_dict = {
|
||||||
"input_hash": text_type(input_hash),
|
"input_name": text_type(input_name1),
|
||||||
"input_id": text_type(input_id),
|
"input_hash": text_type(input_hash),
|
||||||
"client_agent": text_type(client_agent),
|
"input_id": text_type(input_id),
|
||||||
"status": 0,
|
"client_agent": text_type(client_agent),
|
||||||
"last_update": datetime.date.today().toordinal()
|
"status": 0,
|
||||||
}
|
"last_update": datetime.date.today().toordinal(),
|
||||||
|
}
|
||||||
my_db.upsert("downloads", new_value_dict, control_value_dict)
|
my_db.upsert("downloads", new_value_dict, control_value_dict)
|
||||||
|
|
||||||
logger.debug("Received Directory: {0} | Name: {1} | Category: {2}".format(input_directory, input_name, input_category))
|
logger.debug("Received Directory: {0} | Name: {1} | Category: {2}".format(input_directory, input_name, input_category))
|
||||||
|
|
232
core/__init__.py
232
core/__init__.py
|
@ -77,9 +77,9 @@ FORKS[FORK_FAILED_TORRENT] = {"dir": None, "failed": None, "process_method": Non
|
||||||
FORKS[FORK_SICKRAGE] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None}
|
FORKS[FORK_SICKRAGE] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None}
|
||||||
FORKS[FORK_SICKCHILL] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None, "force_next": None}
|
FORKS[FORK_SICKCHILL] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None, "force_next": None}
|
||||||
FORKS[FORK_SICKBEARD_API] = {"path": None, "failed": None, "process_method": None, "force_replace": None, "return_data": None, "type": None, "delete": None, "force_next": None}
|
FORKS[FORK_SICKBEARD_API] = {"path": None, "failed": None, "process_method": None, "force_replace": None, "return_data": None, "type": None, "delete": None, "force_next": None}
|
||||||
FORKS[FORK_MEDUSA] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None, "ignore_subs":None}
|
FORKS[FORK_MEDUSA] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None, "ignore_subs": None}
|
||||||
FORKS[FORK_SICKGEAR] = {"dir": None, "failed": None, "process_method": None, "force": None}
|
FORKS[FORK_SICKGEAR] = {"dir": None, "failed": None, "process_method": None, "force": None}
|
||||||
ALL_FORKS = {k:None for k in set(list(itertools.chain.from_iterable([FORKS[x].keys() for x in FORKS.keys()])))}
|
ALL_FORKS = {k: None for k in set(list(itertools.chain.from_iterable([FORKS[x].keys() for x in FORKS.keys()])))}
|
||||||
|
|
||||||
# NZBGet Exit Codes
|
# NZBGet Exit Codes
|
||||||
NZBGET_POSTPROCESS_PARCHECK = 92
|
NZBGET_POSTPROCESS_PARCHECK = 92
|
||||||
|
@ -361,7 +361,7 @@ def initialize(section=None):
|
||||||
|
|
||||||
NZB_CLIENTAGENT = CFG["Nzb"]["clientAgent"] # sabnzbd
|
NZB_CLIENTAGENT = CFG["Nzb"]["clientAgent"] # sabnzbd
|
||||||
SABNZBDHOST = CFG["Nzb"]["sabnzbd_host"]
|
SABNZBDHOST = CFG["Nzb"]["sabnzbd_host"]
|
||||||
SABNZBDPORT = int(CFG["Nzb"]["sabnzbd_port"] or 8080) # defaults to accomodate NzbGet
|
SABNZBDPORT = int(CFG["Nzb"]["sabnzbd_port"] or 8080) # defaults to accomodate NzbGet
|
||||||
SABNZBDAPIKEY = CFG["Nzb"]["sabnzbd_apikey"]
|
SABNZBDAPIKEY = CFG["Nzb"]["sabnzbd_apikey"]
|
||||||
NZB_DEFAULTDIR = CFG["Nzb"]["default_downloadDirectory"]
|
NZB_DEFAULTDIR = CFG["Nzb"]["default_downloadDirectory"]
|
||||||
GROUPS = CFG["Custom"]["remove_group"]
|
GROUPS = CFG["Custom"]["remove_group"]
|
||||||
|
@ -398,7 +398,7 @@ def initialize(section=None):
|
||||||
DELUGEUSR = CFG["Torrent"]["DelugeUSR"] # mysecretusr
|
DELUGEUSR = CFG["Torrent"]["DelugeUSR"] # mysecretusr
|
||||||
DELUGEPWD = CFG["Torrent"]["DelugePWD"] # mysecretpwr
|
DELUGEPWD = CFG["Torrent"]["DelugePWD"] # mysecretpwr
|
||||||
|
|
||||||
QBITTORRENTHOST = CFG["Torrent"]["qBittorrenHost"] # localhost
|
QBITTORRENTHOST = CFG["Torrent"]["qBittorrenHost"] # localhost
|
||||||
QBITTORRENTPORT = int(CFG["Torrent"]["qBittorrentPort"]) # 8080
|
QBITTORRENTPORT = int(CFG["Torrent"]["qBittorrentPort"]) # 8080
|
||||||
QBITTORRENTUSR = CFG["Torrent"]["qBittorrentUSR"] # mysecretusr
|
QBITTORRENTUSR = CFG["Torrent"]["qBittorrentUSR"] # mysecretusr
|
||||||
QBITTORRENTPWD = CFG["Torrent"]["qBittorrentPWD"] # mysecretpwr
|
QBITTORRENTPWD = CFG["Torrent"]["qBittorrentPWD"] # mysecretpwr
|
||||||
|
@ -574,118 +574,118 @@ def initialize(section=None):
|
||||||
'libfaac': ['libfaac', 'aac', 'faac']
|
'libfaac': ['libfaac', 'aac', 'faac']
|
||||||
}
|
}
|
||||||
transcode_defaults = {
|
transcode_defaults = {
|
||||||
'iPad':{
|
'iPad': {
|
||||||
'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None,'VCRF':None,'VLEVEL':None,
|
'VEXTENSION': '.mp4', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': None, 'VCRF': None, 'VLEVEL': None,
|
||||||
'VRESOLUTION':None,'VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
'VRESOLUTION': None, 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
||||||
'ACODEC':'aac','ACODEC_ALLOW':['libfaac'],'ABITRATE':None, 'ACHANNELS':2,
|
'ACODEC': 'aac', 'ACODEC_ALLOW': ['libfaac'], 'ABITRATE': None, 'ACHANNELS': 2,
|
||||||
'ACODEC2':'ac3','ACODEC2_ALLOW':['ac3'],'ABITRATE2':None, 'ACHANNELS2':6,
|
'ACODEC2': 'ac3', 'ACODEC2_ALLOW': ['ac3'], 'ABITRATE2': None, 'ACHANNELS2': 6,
|
||||||
'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None,
|
'ACODEC3': None, 'ACODEC3_ALLOW': [], 'ABITRATE3': None, 'ACHANNELS3': None,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
},
|
},
|
||||||
'iPad-1080p':{
|
'iPad-1080p': {
|
||||||
'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None,'VCRF':None,'VLEVEL':None,
|
'VEXTENSION': '.mp4', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': None, 'VCRF': None, 'VLEVEL': None,
|
||||||
'VRESOLUTION':'1920:1080','VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
'VRESOLUTION': '1920:1080', 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
||||||
'ACODEC':'aac','ACODEC_ALLOW':['libfaac'],'ABITRATE':None, 'ACHANNELS':2,
|
'ACODEC': 'aac', 'ACODEC_ALLOW': ['libfaac'], 'ABITRATE': None, 'ACHANNELS': 2,
|
||||||
'ACODEC2':'ac3','ACODEC2_ALLOW':['ac3'],'ABITRATE2':None, 'ACHANNELS2':6,
|
'ACODEC2': 'ac3', 'ACODEC2_ALLOW': ['ac3'], 'ABITRATE2': None, 'ACHANNELS2': 6,
|
||||||
'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None,
|
'ACODEC3': None, 'ACODEC3_ALLOW': [], 'ABITRATE3': None, 'ACHANNELS3': None,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
},
|
},
|
||||||
'iPad-720p':{
|
'iPad-720p': {
|
||||||
'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None,'VCRF':None,'VLEVEL':None,
|
'VEXTENSION': '.mp4', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': None, 'VCRF': None, 'VLEVEL': None,
|
||||||
'VRESOLUTION':'1280:720','VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
'VRESOLUTION': '1280:720', 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
||||||
'ACODEC':'aac','ACODEC_ALLOW':['libfaac'],'ABITRATE':None, 'ACHANNELS':2,
|
'ACODEC': 'aac', 'ACODEC_ALLOW': ['libfaac'], 'ABITRATE': None, 'ACHANNELS': 2,
|
||||||
'ACODEC2':'ac3','ACODEC2_ALLOW':['ac3'],'ABITRATE2':None, 'ACHANNELS2':6,
|
'ACODEC2': 'ac3', 'ACODEC2_ALLOW': ['ac3'], 'ABITRATE2': None, 'ACHANNELS2': 6,
|
||||||
'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None,
|
'ACODEC3': None, 'ACODEC3_ALLOW': [], 'ABITRATE3': None, 'ACHANNELS3': None,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
},
|
},
|
||||||
'Apple-TV':{
|
'Apple-TV': {
|
||||||
'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None,'VCRF':None,'VLEVEL':None,
|
'VEXTENSION': '.mp4', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': None, 'VCRF': None, 'VLEVEL': None,
|
||||||
'VRESOLUTION':'1280:720','VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
'VRESOLUTION': '1280:720', 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
||||||
'ACODEC':'ac3','ACODEC_ALLOW':['ac3'],'ABITRATE':None, 'ACHANNELS':6,
|
'ACODEC': 'ac3', 'ACODEC_ALLOW': ['ac3'], 'ABITRATE': None, 'ACHANNELS': 6,
|
||||||
'ACODEC2':'aac','ACODEC2_ALLOW':['libfaac'],'ABITRATE2':None, 'ACHANNELS2':2,
|
'ACODEC2': 'aac', 'ACODEC2_ALLOW': ['libfaac'], 'ABITRATE2': None, 'ACHANNELS2': 2,
|
||||||
'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None,
|
'ACODEC3': None, 'ACODEC3_ALLOW': [], 'ABITRATE3': None, 'ACHANNELS3': None,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
},
|
},
|
||||||
'iPod':{
|
'iPod': {
|
||||||
'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None,'VCRF':None,'VLEVEL':None,
|
'VEXTENSION': '.mp4', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': None, 'VCRF': None, 'VLEVEL': None,
|
||||||
'VRESOLUTION':'1280:720','VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
'VRESOLUTION': '1280:720', 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
||||||
'ACODEC':'aac','ACODEC_ALLOW':['libfaac'],'ABITRATE':128000, 'ACHANNELS':2,
|
'ACODEC': 'aac', 'ACODEC_ALLOW': ['libfaac'], 'ABITRATE': 128000, 'ACHANNELS': 2,
|
||||||
'ACODEC2':None,'ACODEC2_ALLOW':[],'ABITRATE2':None, 'ACHANNELS2':None,
|
'ACODEC2': None, 'ACODEC2_ALLOW': [], 'ABITRATE2': None, 'ACHANNELS2': None,
|
||||||
'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None,
|
'ACODEC3': None, 'ACODEC3_ALLOW': [], 'ABITRATE3': None, 'ACHANNELS3': None,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
},
|
},
|
||||||
'iPhone':{
|
'iPhone': {
|
||||||
'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None,'VCRF':None,'VLEVEL':None,
|
'VEXTENSION': '.mp4', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': None, 'VCRF': None, 'VLEVEL': None,
|
||||||
'VRESOLUTION':'460:320','VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
'VRESOLUTION': '460:320', 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
||||||
'ACODEC':'aac','ACODEC_ALLOW':['libfaac'],'ABITRATE':128000, 'ACHANNELS':2,
|
'ACODEC': 'aac', 'ACODEC_ALLOW': ['libfaac'], 'ABITRATE': 128000, 'ACHANNELS': 2,
|
||||||
'ACODEC2':None,'ACODEC2_ALLOW':[],'ABITRATE2':None, 'ACHANNELS2':None,
|
'ACODEC2': None, 'ACODEC2_ALLOW': [], 'ABITRATE2': None, 'ACHANNELS2': None,
|
||||||
'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None,
|
'ACODEC3': None, 'ACODEC3_ALLOW': [], 'ABITRATE3': None, 'ACHANNELS3': None,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
},
|
},
|
||||||
'PS3':{
|
'PS3': {
|
||||||
'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None,'VCRF':None,'VLEVEL':None,
|
'VEXTENSION': '.mp4', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': None, 'VCRF': None, 'VLEVEL': None,
|
||||||
'VRESOLUTION':None,'VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
'VRESOLUTION': None, 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
||||||
'ACODEC':'ac3','ACODEC_ALLOW':['ac3'],'ABITRATE':None, 'ACHANNELS':6,
|
'ACODEC': 'ac3', 'ACODEC_ALLOW': ['ac3'], 'ABITRATE': None, 'ACHANNELS': 6,
|
||||||
'ACODEC2':'aac','ACODEC2_ALLOW':['libfaac'],'ABITRATE2':None, 'ACHANNELS2':2,
|
'ACODEC2': 'aac', 'ACODEC2_ALLOW': ['libfaac'], 'ABITRATE2': None, 'ACHANNELS2': 2,
|
||||||
'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None,
|
'ACODEC3': None, 'ACODEC3_ALLOW': [], 'ABITRATE3': None, 'ACHANNELS3': None,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
},
|
},
|
||||||
'xbox':{
|
'xbox': {
|
||||||
'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None,'VCRF':None,'VLEVEL':None,
|
'VEXTENSION': '.mp4', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': None, 'VCRF': None, 'VLEVEL': None,
|
||||||
'VRESOLUTION':None,'VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
'VRESOLUTION': None, 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
||||||
'ACODEC':'ac3','ACODEC_ALLOW':['ac3'],'ABITRATE':None, 'ACHANNELS':6,
|
'ACODEC': 'ac3', 'ACODEC_ALLOW': ['ac3'], 'ABITRATE': None, 'ACHANNELS': 6,
|
||||||
'ACODEC2':None,'ACODEC2_ALLOW':[],'ABITRATE2':None, 'ACHANNELS2':None,
|
'ACODEC2': None, 'ACODEC2_ALLOW': [], 'ABITRATE2': None, 'ACHANNELS2': None,
|
||||||
'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None,
|
'ACODEC3': None, 'ACODEC3_ALLOW': [], 'ABITRATE3': None, 'ACHANNELS3': None,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
},
|
},
|
||||||
'Roku-480p':{
|
'Roku-480p': {
|
||||||
'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None,'VCRF':None,'VLEVEL':None,
|
'VEXTENSION': '.mp4', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': None, 'VCRF': None, 'VLEVEL': None,
|
||||||
'VRESOLUTION':None,'VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
'VRESOLUTION': None, 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
||||||
'ACODEC':'aac','ACODEC_ALLOW':['libfaac'],'ABITRATE':128000, 'ACHANNELS':2,
|
'ACODEC': 'aac', 'ACODEC_ALLOW': ['libfaac'], 'ABITRATE': 128000, 'ACHANNELS': 2,
|
||||||
'ACODEC2':'ac3','ACODEC2_ALLOW':['ac3'],'ABITRATE2':None, 'ACHANNELS2':6,
|
'ACODEC2': 'ac3', 'ACODEC2_ALLOW': ['ac3'], 'ABITRATE2': None, 'ACHANNELS2': 6,
|
||||||
'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None,
|
'ACODEC3': None, 'ACODEC3_ALLOW': [], 'ABITRATE3': None, 'ACHANNELS3': None,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
},
|
},
|
||||||
'Roku-720p':{
|
'Roku-720p': {
|
||||||
'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None,'VCRF':None,'VLEVEL':None,
|
'VEXTENSION': '.mp4', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': None, 'VCRF': None, 'VLEVEL': None,
|
||||||
'VRESOLUTION':None,'VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
'VRESOLUTION': None, 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
||||||
'ACODEC':'aac','ACODEC_ALLOW':['libfaac'],'ABITRATE':128000, 'ACHANNELS':2,
|
'ACODEC': 'aac', 'ACODEC_ALLOW': ['libfaac'], 'ABITRATE': 128000, 'ACHANNELS': 2,
|
||||||
'ACODEC2':'ac3','ACODEC2_ALLOW':['ac3'],'ABITRATE2':None, 'ACHANNELS2':6,
|
'ACODEC2': 'ac3', 'ACODEC2_ALLOW': ['ac3'], 'ABITRATE2': None, 'ACHANNELS2': 6,
|
||||||
'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None,
|
'ACODEC3': None, 'ACODEC3_ALLOW': [], 'ABITRATE3': None, 'ACHANNELS3': None,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
},
|
},
|
||||||
'Roku-1080p':{
|
'Roku-1080p': {
|
||||||
'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None,'VCRF':None,'VLEVEL':None,
|
'VEXTENSION': '.mp4', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': None, 'VCRF': None, 'VLEVEL': None,
|
||||||
'VRESOLUTION':None,'VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
'VRESOLUTION': None, 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
||||||
'ACODEC':'aac','ACODEC_ALLOW':['libfaac'],'ABITRATE':160000, 'ACHANNELS':2,
|
'ACODEC': 'aac', 'ACODEC_ALLOW': ['libfaac'], 'ABITRATE': 160000, 'ACHANNELS': 2,
|
||||||
'ACODEC2':'ac3','ACODEC2_ALLOW':['ac3'],'ABITRATE2':None, 'ACHANNELS2':6,
|
'ACODEC2': 'ac3', 'ACODEC2_ALLOW': ['ac3'], 'ABITRATE2': None, 'ACHANNELS2': 6,
|
||||||
'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None,
|
'ACODEC3': None, 'ACODEC3_ALLOW': [], 'ABITRATE3': None, 'ACHANNELS3': None,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
},
|
},
|
||||||
'mkv':{
|
'mkv': {
|
||||||
'VEXTENSION':'.mkv','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None,'VCRF':None,'VLEVEL':None,
|
'VEXTENSION': '.mkv', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': None, 'VCRF': None, 'VLEVEL': None,
|
||||||
'VRESOLUTION':None,'VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4', 'mpeg2video'],
|
'VRESOLUTION': None, 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4', 'mpeg2video'],
|
||||||
'ACODEC':'dts','ACODEC_ALLOW':['libfaac', 'dts', 'ac3', 'mp2', 'mp3'],'ABITRATE':None, 'ACHANNELS':8,
|
'ACODEC': 'dts', 'ACODEC_ALLOW': ['libfaac', 'dts', 'ac3', 'mp2', 'mp3'], 'ABITRATE': None, 'ACHANNELS': 8,
|
||||||
'ACODEC2':None,'ACODEC2_ALLOW':[],'ABITRATE2':None, 'ACHANNELS2':None,
|
'ACODEC2': None, 'ACODEC2_ALLOW': [], 'ABITRATE2': None, 'ACHANNELS2': None,
|
||||||
'ACODEC3':'ac3','ACODEC3_ALLOW':['libfaac', 'dts', 'ac3', 'mp2', 'mp3'],'ABITRATE3':None, 'ACHANNELS3':8,
|
'ACODEC3': 'ac3', 'ACODEC3_ALLOW': ['libfaac', 'dts', 'ac3', 'mp2', 'mp3'], 'ABITRATE3': None, 'ACHANNELS3': 8,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
},
|
},
|
||||||
'mp4-scene-release':{
|
'mp4-scene-release': {
|
||||||
'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None,'VCRF':19,'VLEVEL':'3.1',
|
'VEXTENSION': '.mp4', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': None, 'VCRF': 19, 'VLEVEL': '3.1',
|
||||||
'VRESOLUTION':None,'VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4', 'mpeg2video'],
|
'VRESOLUTION': None, 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4', 'mpeg2video'],
|
||||||
'ACODEC':'dts','ACODEC_ALLOW':['libfaac', 'dts', 'ac3', 'mp2', 'mp3'],'ABITRATE':None, 'ACHANNELS':8,
|
'ACODEC': 'dts', 'ACODEC_ALLOW': ['libfaac', 'dts', 'ac3', 'mp2', 'mp3'], 'ABITRATE': None, 'ACHANNELS': 8,
|
||||||
'ACODEC2':None,'ACODEC2_ALLOW':[],'ABITRATE2':None, 'ACHANNELS2':None,
|
'ACODEC2': None, 'ACODEC2_ALLOW': [], 'ABITRATE2': None, 'ACHANNELS2': None,
|
||||||
'ACODEC3':'ac3','ACODEC3_ALLOW':['libfaac', 'dts', 'ac3', 'mp2', 'mp3'],'ABITRATE3':None, 'ACHANNELS3':8,
|
'ACODEC3': 'ac3', 'ACODEC3_ALLOW': ['libfaac', 'dts', 'ac3', 'mp2', 'mp3'], 'ABITRATE3': None, 'ACHANNELS3': 8,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
},
|
},
|
||||||
'MKV-SD':{
|
'MKV-SD': {
|
||||||
'VEXTENSION':'.mkv','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':'1200k','VCRF':None,'VLEVEL':None,
|
'VEXTENSION': '.mkv', 'VCODEC': 'libx264', 'VPRESET': None, 'VFRAMERATE': None, 'VBITRATE': '1200k', 'VCRF': None, 'VLEVEL': None,
|
||||||
'VRESOLUTION':'720:-1','VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
'VRESOLUTION': '720: -1', 'VCODEC_ALLOW': ['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'],
|
||||||
'ACODEC':'aac','ACODEC_ALLOW':['libfaac'],'ABITRATE':128000, 'ACHANNELS':2,
|
'ACODEC': 'aac', 'ACODEC_ALLOW': ['libfaac'], 'ABITRATE': 128000, 'ACHANNELS': 2,
|
||||||
'ACODEC2':'ac3','ACODEC2_ALLOW':['ac3'],'ABITRATE2':None, 'ACHANNELS2':6,
|
'ACODEC2': 'ac3', 'ACODEC2_ALLOW': ['ac3'], 'ABITRATE2': None, 'ACHANNELS2': 6,
|
||||||
'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None,
|
'ACODEC3': None, 'ACODEC3_ALLOW': [], 'ABITRATE3': None, 'ACHANNELS3': None,
|
||||||
'SCODEC':'mov_text'
|
'SCODEC': 'mov_text'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if DEFAULTS and DEFAULTS in transcode_defaults:
|
if DEFAULTS and DEFAULTS in transcode_defaults:
|
||||||
VEXTENSION = transcode_defaults[DEFAULTS]['VEXTENSION']
|
VEXTENSION = transcode_defaults[DEFAULTS]['VEXTENSION']
|
||||||
|
|
|
@ -26,9 +26,9 @@ class Movie(object):
|
||||||
method = cfg["method"]
|
method = cfg["method"]
|
||||||
else:
|
else:
|
||||||
method = None
|
method = None
|
||||||
#added importMode for Radarr config
|
# added importMode for Radarr config
|
||||||
if section == "Radarr":
|
if section == "Radarr":
|
||||||
import_mode = cfg.get("importMode","Move")
|
import_mode = cfg.get("importMode", "Move")
|
||||||
else:
|
else:
|
||||||
import_mode = None
|
import_mode = None
|
||||||
delete_failed = int(cfg["delete_failed"])
|
delete_failed = int(cfg["delete_failed"])
|
||||||
|
@ -147,7 +147,7 @@ class Movie(object):
|
||||||
logger.debug('Renaming: {0} to: {1}'.format(video, video2))
|
logger.debug('Renaming: {0} to: {1}'.format(video, video2))
|
||||||
os.rename(video, video2)
|
os.rename(video, video2)
|
||||||
|
|
||||||
if not apikey: #If only using Transcoder functions, exit here.
|
if not apikey: # If only using Transcoder functions, exit here.
|
||||||
logger.info('No CouchPotato or Radarr apikey entered. Processing completed.')
|
logger.info('No CouchPotato or Radarr apikey entered. Processing completed.')
|
||||||
return [0, "{0}: Successfully post-processed {1}".format(section, input_name)]
|
return [0, "{0}: Successfully post-processed {1}".format(section, input_name)]
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ class Movie(object):
|
||||||
logger.postprocess("Starting {0} scan for {1}".format(method, input_name), section)
|
logger.postprocess("Starting {0} scan for {1}".format(method, input_name), section)
|
||||||
|
|
||||||
if section == "Radarr":
|
if section == "Radarr":
|
||||||
payload = {'name': 'DownloadedMoviesScan', 'path': params['media_folder'], 'downloadClientId': download_id,'importMode' : import_mode}
|
payload = {'name': 'DownloadedMoviesScan', 'path': params['media_folder'], 'downloadClientId': download_id, 'importMode': import_mode}
|
||||||
if not download_id:
|
if not download_id:
|
||||||
payload.pop("downloadClientId")
|
payload.pop("downloadClientId")
|
||||||
logger.debug("Opening URL: {0} with PARAMS: {1}".format(base_url, payload), section)
|
logger.debug("Opening URL: {0} with PARAMS: {1}".format(base_url, payload), section)
|
||||||
|
|
|
@ -61,9 +61,9 @@ class Music(object):
|
||||||
core.extract_files(dir_name)
|
core.extract_files(dir_name)
|
||||||
input_name, dir_name = convert_to_ascii(input_name, dir_name)
|
input_name, dir_name = convert_to_ascii(input_name, dir_name)
|
||||||
|
|
||||||
#if listMediaFiles(dir_name, media=False, audio=True, meta=False, archives=False) and status:
|
# if listMediaFiles(dir_name, media=False, audio=True, meta=False, archives=False) and status:
|
||||||
# logger.info("Status shown as failed from Downloader, but valid video files found. Setting as successful.", section)
|
# logger.info("Status shown as failed from Downloader, but valid video files found. Setting as successful.", section)
|
||||||
# status = 0
|
# status = 0
|
||||||
|
|
||||||
if status == 0 and section == "HeadPhones":
|
if status == 0 and section == "HeadPhones":
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ class TV(object):
|
||||||
delete_failed = int(cfg.get("delete_failed", 0))
|
delete_failed = int(cfg.get("delete_failed", 0))
|
||||||
nzb_extraction_by = cfg.get("nzbExtractionBy", "Downloader")
|
nzb_extraction_by = cfg.get("nzbExtractionBy", "Downloader")
|
||||||
process_method = cfg.get("process_method")
|
process_method = cfg.get("process_method")
|
||||||
if client_agent == core.TORRENT_CLIENTAGENT and core.USELINK == "move-sym":
|
if client_agent == core.TORRENT_CLIENTAGENT and core.USELINK == "move-sym":
|
||||||
process_method = "symlink"
|
process_method = "symlink"
|
||||||
remote_path = int(cfg.get("remote_path", 0))
|
remote_path = int(cfg.get("remote_path", 0))
|
||||||
wait_for = int(cfg.get("wait_for", 2))
|
wait_for = int(cfg.get("wait_for", 2))
|
||||||
|
@ -56,8 +56,8 @@ class TV(object):
|
||||||
extract = 0
|
extract = 0
|
||||||
else:
|
else:
|
||||||
extract = int(cfg.get("extract", 0))
|
extract = int(cfg.get("extract", 0))
|
||||||
#get importmode, default to "Move" for consistency with legacy
|
# get importmode, default to "Move" for consistency with legacy
|
||||||
import_mode = cfg.get("importMode","Move")
|
import_mode = cfg.get("importMode", "Move")
|
||||||
|
|
||||||
if not os.path.isdir(dir_name) and os.path.isfile(dir_name): # If the input directory is a file, assume single file download and split dir/name.
|
if not os.path.isdir(dir_name) and os.path.isfile(dir_name): # If the input directory is a file, assume single file download and split dir/name.
|
||||||
dir_name = os.path.split(os.path.normpath(dir_name))[0]
|
dir_name = os.path.split(os.path.normpath(dir_name))[0]
|
||||||
|
@ -256,7 +256,7 @@ class TV(object):
|
||||||
if not apikey and username and password:
|
if not apikey and username and password:
|
||||||
login = "{0}{1}:{2}{3}/login".format(protocol, host, port, web_root)
|
login = "{0}{1}:{2}{3}/login".format(protocol, host, port, web_root)
|
||||||
login_params = {'username': username, 'password': password}
|
login_params = {'username': username, 'password': password}
|
||||||
r = s.get(login, verify=False, timeout=(30,60))
|
r = s.get(login, verify=False, timeout=(30, 60))
|
||||||
if r.status_code == 401 and r.cookies.get('_xsrf'):
|
if r.status_code == 401 and r.cookies.get('_xsrf'):
|
||||||
login_params['_xsrf'] = r.cookies.get('_xsrf')
|
login_params['_xsrf'] = r.cookies.get('_xsrf')
|
||||||
s.post(login, data=login_params, stream=True, verify=False, timeout=(30, 60))
|
s.post(login, data=login_params, stream=True, verify=False, timeout=(30, 60))
|
||||||
|
|
|
@ -239,7 +239,7 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
process_section(section, subsection)
|
process_section(section, subsection)
|
||||||
|
|
||||||
# create a backup of our old config
|
# create a backup of our old config
|
||||||
CFG_OLD.filename ="{config}.old".format(config=core.CONFIG_FILE)
|
CFG_OLD.filename = "{config}.old".format(config=core.CONFIG_FILE)
|
||||||
CFG_OLD.write()
|
CFG_OLD.write()
|
||||||
|
|
||||||
# write our new config to autoProcessMedia.cfg
|
# write our new config to autoProcessMedia.cfg
|
||||||
|
@ -299,9 +299,9 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
section = "CouchPotato"
|
section = "CouchPotato"
|
||||||
env_cat_key = 'NZBPO_CPSCATEGORY'
|
env_cat_key = 'NZBPO_CPSCATEGORY'
|
||||||
env_keys = ['ENABLED', 'APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT', 'METHOD', 'DELETE_FAILED', 'REMOTE_PATH',
|
env_keys = ['ENABLED', 'APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT', 'METHOD', 'DELETE_FAILED', 'REMOTE_PATH',
|
||||||
'WAIT_FOR', 'WATCH_DIR', 'OMDBAPIKEY']
|
'WAIT_FOR', 'WATCH_DIR', 'OMDBAPIKEY']
|
||||||
cfg_keys = ['enabled', 'apikey', 'host', 'port', 'ssl', 'web_root', 'method', 'delete_failed', 'remote_path',
|
cfg_keys = ['enabled', 'apikey', 'host', 'port', 'ssl', 'web_root', 'method', 'delete_failed', 'remote_path',
|
||||||
'wait_for', 'watch_dir', 'omdbapikey']
|
'wait_for', 'watch_dir', 'omdbapikey']
|
||||||
if env_cat_key in os.environ:
|
if env_cat_key in os.environ:
|
||||||
for index in range(len(env_keys)):
|
for index in range(len(env_keys)):
|
||||||
key = 'NZBPO_CPS{index}'.format(index=env_keys[index])
|
key = 'NZBPO_CPS{index}'.format(index=env_keys[index])
|
||||||
|
@ -318,9 +318,9 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
section = "SickBeard"
|
section = "SickBeard"
|
||||||
env_cat_key = 'NZBPO_SBCATEGORY'
|
env_cat_key = 'NZBPO_SBCATEGORY'
|
||||||
env_keys = ['ENABLED', 'HOST', 'PORT', 'APIKEY', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK',
|
env_keys = ['ENABLED', 'HOST', 'PORT', 'APIKEY', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK',
|
||||||
'DELETE_FAILED', 'TORRENT_NOLINK', 'NZBEXTRACTIONBY', 'REMOTE_PATH', 'PROCESS_METHOD']
|
'DELETE_FAILED', 'TORRENT_NOLINK', 'NZBEXTRACTIONBY', 'REMOTE_PATH', 'PROCESS_METHOD']
|
||||||
cfg_keys = ['enabled', 'host', 'port', 'apikey', 'username', 'password', 'ssl', 'web_root', 'watch_dir', 'fork',
|
cfg_keys = ['enabled', 'host', 'port', 'apikey', 'username', 'password', 'ssl', 'web_root', 'watch_dir', 'fork',
|
||||||
'delete_failed', 'Torrent_NoLink', 'nzbExtractionBy', 'remote_path', 'process_method']
|
'delete_failed', 'Torrent_NoLink', 'nzbExtractionBy', 'remote_path', 'process_method']
|
||||||
if env_cat_key in os.environ:
|
if env_cat_key in os.environ:
|
||||||
for index in range(len(env_keys)):
|
for index in range(len(env_keys)):
|
||||||
key = 'NZBPO_SB{index}'.format(index=env_keys[index])
|
key = 'NZBPO_SB{index}'.format(index=env_keys[index])
|
||||||
|
@ -354,9 +354,9 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
section = "Mylar"
|
section = "Mylar"
|
||||||
env_cat_key = 'NZBPO_MYCATEGORY'
|
env_cat_key = 'NZBPO_MYCATEGORY'
|
||||||
env_keys = ['ENABLED', 'HOST', 'PORT', 'USERNAME', 'PASSWORD', 'APIKEY', 'SSL', 'WEB_ROOT', 'WATCH_DIR',
|
env_keys = ['ENABLED', 'HOST', 'PORT', 'USERNAME', 'PASSWORD', 'APIKEY', 'SSL', 'WEB_ROOT', 'WATCH_DIR',
|
||||||
'REMOTE_PATH']
|
'REMOTE_PATH']
|
||||||
cfg_keys = ['enabled', 'host', 'port', 'username', 'password', 'apikey', 'ssl', 'web_root', 'watch_dir',
|
cfg_keys = ['enabled', 'host', 'port', 'username', 'password', 'apikey', 'ssl', 'web_root', 'watch_dir',
|
||||||
'remote_path']
|
'remote_path']
|
||||||
if env_cat_key in os.environ:
|
if env_cat_key in os.environ:
|
||||||
for index in range(len(env_keys)):
|
for index in range(len(env_keys)):
|
||||||
key = 'NZBPO_MY{index}'.format(index=env_keys[index])
|
key = 'NZBPO_MY{index}'.format(index=env_keys[index])
|
||||||
|
@ -386,10 +386,10 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
section = "NzbDrone"
|
section = "NzbDrone"
|
||||||
env_cat_key = 'NZBPO_NDCATEGORY'
|
env_cat_key = 'NZBPO_NDCATEGORY'
|
||||||
env_keys = ['ENABLED', 'HOST', 'APIKEY', 'PORT', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED',
|
env_keys = ['ENABLED', 'HOST', 'APIKEY', 'PORT', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED',
|
||||||
'TORRENT_NOLINK', 'NZBEXTRACTIONBY', 'WAIT_FOR', 'DELETE_FAILED', 'REMOTE_PATH', 'IMPORTMODE']
|
'TORRENT_NOLINK', 'NZBEXTRACTIONBY', 'WAIT_FOR', 'DELETE_FAILED', 'REMOTE_PATH', 'IMPORTMODE']
|
||||||
#new cfgKey added for importMode
|
# new cfgKey added for importMode
|
||||||
cfg_keys = ['enabled', 'host', 'apikey', 'port', 'ssl', 'web_root', 'watch_dir', 'fork', 'delete_failed',
|
cfg_keys = ['enabled', 'host', 'apikey', 'port', 'ssl', 'web_root', 'watch_dir', 'fork', 'delete_failed',
|
||||||
'Torrent_NoLink', 'nzbExtractionBy', 'wait_for', 'delete_failed', 'remote_path','importMode']
|
'Torrent_NoLink', 'nzbExtractionBy', 'wait_for', 'delete_failed', 'remote_path', 'importMode']
|
||||||
if env_cat_key in os.environ:
|
if env_cat_key in os.environ:
|
||||||
for index in range(len(env_keys)):
|
for index in range(len(env_keys)):
|
||||||
key = 'NZBPO_ND{index}'.format(index=env_keys[index])
|
key = 'NZBPO_ND{index}'.format(index=env_keys[index])
|
||||||
|
@ -406,10 +406,10 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
section = "Radarr"
|
section = "Radarr"
|
||||||
env_cat_key = 'NZBPO_RACATEGORY'
|
env_cat_key = 'NZBPO_RACATEGORY'
|
||||||
env_keys = ['ENABLED', 'HOST', 'APIKEY', 'PORT', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED',
|
env_keys = ['ENABLED', 'HOST', 'APIKEY', 'PORT', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED',
|
||||||
'TORRENT_NOLINK', 'NZBEXTRACTIONBY', 'WAIT_FOR', 'DELETE_FAILED', 'REMOTE_PATH', 'OMDBAPIKEY', 'IMPORTMODE']
|
'TORRENT_NOLINK', 'NZBEXTRACTIONBY', 'WAIT_FOR', 'DELETE_FAILED', 'REMOTE_PATH', 'OMDBAPIKEY', 'IMPORTMODE']
|
||||||
#new cfgKey added for importMode
|
# new cfgKey added for importMode
|
||||||
cfg_keys = ['enabled', 'host', 'apikey', 'port', 'ssl', 'web_root', 'watch_dir', 'fork', 'delete_failed',
|
cfg_keys = ['enabled', 'host', 'apikey', 'port', 'ssl', 'web_root', 'watch_dir', 'fork', 'delete_failed',
|
||||||
'Torrent_NoLink', 'nzbExtractionBy', 'wait_for', 'delete_failed', 'remote_path', 'omdbapikey','importMode']
|
'Torrent_NoLink', 'nzbExtractionBy', 'wait_for', 'delete_failed', 'remote_path', 'omdbapikey', 'importMode']
|
||||||
if env_cat_key in os.environ:
|
if env_cat_key in os.environ:
|
||||||
for index in range(len(env_keys)):
|
for index in range(len(env_keys)):
|
||||||
key = 'NZBPO_RA{index}'.format(index=env_keys[index])
|
key = 'NZBPO_RA{index}'.format(index=env_keys[index])
|
||||||
|
@ -426,9 +426,9 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
section = "Lidarr"
|
section = "Lidarr"
|
||||||
env_cat_key = 'NZBPO_LICATEGORY'
|
env_cat_key = 'NZBPO_LICATEGORY'
|
||||||
env_keys = ['ENABLED', 'HOST', 'APIKEY', 'PORT', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED',
|
env_keys = ['ENABLED', 'HOST', 'APIKEY', 'PORT', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED',
|
||||||
'TORRENT_NOLINK', 'NZBEXTRACTIONBY', 'WAIT_FOR', 'DELETE_FAILED', 'REMOTE_PATH']
|
'TORRENT_NOLINK', 'NZBEXTRACTIONBY', 'WAIT_FOR', 'DELETE_FAILED', 'REMOTE_PATH']
|
||||||
cfg_keys = ['enabled', 'host', 'apikey', 'port', 'ssl', 'web_root', 'watch_dir', 'fork', 'delete_failed',
|
cfg_keys = ['enabled', 'host', 'apikey', 'port', 'ssl', 'web_root', 'watch_dir', 'fork', 'delete_failed',
|
||||||
'Torrent_NoLink', 'nzbExtractionBy', 'wait_for', 'delete_failed', 'remote_path']
|
'Torrent_NoLink', 'nzbExtractionBy', 'wait_for', 'delete_failed', 'remote_path']
|
||||||
if env_cat_key in os.environ:
|
if env_cat_key in os.environ:
|
||||||
for index in range(len(env_keys)):
|
for index in range(len(env_keys)):
|
||||||
key = 'NZBPO_LI{index}'.format(index=env_keys[index])
|
key = 'NZBPO_LI{index}'.format(index=env_keys[index])
|
||||||
|
@ -464,25 +464,25 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
|
|
||||||
section = "Transcoder"
|
section = "Transcoder"
|
||||||
env_keys = ['TRANSCODE', 'DUPLICATE', 'IGNOREEXTENSIONS', 'OUTPUTFASTSTART', 'OUTPUTVIDEOPATH',
|
env_keys = ['TRANSCODE', 'DUPLICATE', 'IGNOREEXTENSIONS', 'OUTPUTFASTSTART', 'OUTPUTVIDEOPATH',
|
||||||
'PROCESSOUTPUT', 'AUDIOLANGUAGE', 'ALLAUDIOLANGUAGES', 'SUBLANGUAGES',
|
'PROCESSOUTPUT', 'AUDIOLANGUAGE', 'ALLAUDIOLANGUAGES', 'SUBLANGUAGES',
|
||||||
'ALLSUBLANGUAGES', 'EMBEDSUBS', 'BURNINSUBTITLE', 'EXTRACTSUBS', 'EXTERNALSUBDIR',
|
'ALLSUBLANGUAGES', 'EMBEDSUBS', 'BURNINSUBTITLE', 'EXTRACTSUBS', 'EXTERNALSUBDIR',
|
||||||
'OUTPUTDEFAULT', 'OUTPUTVIDEOEXTENSION', 'OUTPUTVIDEOCODEC', 'VIDEOCODECALLOW',
|
'OUTPUTDEFAULT', 'OUTPUTVIDEOEXTENSION', 'OUTPUTVIDEOCODEC', 'VIDEOCODECALLOW',
|
||||||
'OUTPUTVIDEOPRESET', 'OUTPUTVIDEOFRAMERATE', 'OUTPUTVIDEOBITRATE', 'OUTPUTAUDIOCODEC',
|
'OUTPUTVIDEOPRESET', 'OUTPUTVIDEOFRAMERATE', 'OUTPUTVIDEOBITRATE', 'OUTPUTAUDIOCODEC',
|
||||||
'AUDIOCODECALLOW', 'OUTPUTAUDIOBITRATE', 'OUTPUTQUALITYPERCENT', 'GETSUBS',
|
'AUDIOCODECALLOW', 'OUTPUTAUDIOBITRATE', 'OUTPUTQUALITYPERCENT', 'GETSUBS',
|
||||||
'OUTPUTAUDIOTRACK2CODEC', 'AUDIOCODEC2ALLOW', 'OUTPUTAUDIOTRACK2BITRATE',
|
'OUTPUTAUDIOTRACK2CODEC', 'AUDIOCODEC2ALLOW', 'OUTPUTAUDIOTRACK2BITRATE',
|
||||||
'OUTPUTAUDIOOTHERCODEC', 'AUDIOOTHERCODECALLOW', 'OUTPUTAUDIOOTHERBITRATE',
|
'OUTPUTAUDIOOTHERCODEC', 'AUDIOOTHERCODECALLOW', 'OUTPUTAUDIOOTHERBITRATE',
|
||||||
'OUTPUTSUBTITLECODEC', 'OUTPUTAUDIOCHANNELS', 'OUTPUTAUDIOTRACK2CHANNELS',
|
'OUTPUTSUBTITLECODEC', 'OUTPUTAUDIOCHANNELS', 'OUTPUTAUDIOTRACK2CHANNELS',
|
||||||
'OUTPUTAUDIOOTHERCHANNELS','OUTPUTVIDEORESOLUTION']
|
'OUTPUTAUDIOOTHERCHANNELS', 'OUTPUTVIDEORESOLUTION']
|
||||||
cfg_keys = ['transcode', 'duplicate', 'ignoreExtensions', 'outputFastStart', 'outputVideoPath',
|
cfg_keys = ['transcode', 'duplicate', 'ignoreExtensions', 'outputFastStart', 'outputVideoPath',
|
||||||
'processOutput', 'audioLanguage', 'allAudioLanguages', 'subLanguages',
|
'processOutput', 'audioLanguage', 'allAudioLanguages', 'subLanguages',
|
||||||
'allSubLanguages', 'embedSubs', 'burnInSubtitle', 'extractSubs', 'externalSubDir',
|
'allSubLanguages', 'embedSubs', 'burnInSubtitle', 'extractSubs', 'externalSubDir',
|
||||||
'outputDefault', 'outputVideoExtension', 'outputVideoCodec', 'VideoCodecAllow',
|
'outputDefault', 'outputVideoExtension', 'outputVideoCodec', 'VideoCodecAllow',
|
||||||
'outputVideoPreset', 'outputVideoFramerate', 'outputVideoBitrate', 'outputAudioCodec',
|
'outputVideoPreset', 'outputVideoFramerate', 'outputVideoBitrate', 'outputAudioCodec',
|
||||||
'AudioCodecAllow', 'outputAudioBitrate', 'outputQualityPercent', 'getSubs',
|
'AudioCodecAllow', 'outputAudioBitrate', 'outputQualityPercent', 'getSubs',
|
||||||
'outputAudioTrack2Codec', 'AudioCodec2Allow', 'outputAudioTrack2Bitrate',
|
'outputAudioTrack2Codec', 'AudioCodec2Allow', 'outputAudioTrack2Bitrate',
|
||||||
'outputAudioOtherCodec', 'AudioOtherCodecAllow', 'outputAudioOtherBitrate',
|
'outputAudioOtherCodec', 'AudioOtherCodecAllow', 'outputAudioOtherBitrate',
|
||||||
'outputSubtitleCodec', 'outputAudioChannels', 'outputAudioTrack2Channels',
|
'outputSubtitleCodec', 'outputAudioChannels', 'outputAudioTrack2Channels',
|
||||||
'outputAudioOtherChannels', 'outputVideoResolution']
|
'outputAudioOtherChannels', 'outputVideoResolution']
|
||||||
for index in range(len(env_keys)):
|
for index in range(len(env_keys)):
|
||||||
key = 'NZBPO_{index}'.format(index=env_keys[index])
|
key = 'NZBPO_{index}'.format(index=env_keys[index])
|
||||||
if key in os.environ:
|
if key in os.environ:
|
||||||
|
@ -503,9 +503,9 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
section = "UserScript"
|
section = "UserScript"
|
||||||
env_cat_key = 'NZBPO_USCATEGORY'
|
env_cat_key = 'NZBPO_USCATEGORY'
|
||||||
env_keys = ['USER_SCRIPT_MEDIAEXTENSIONS', 'USER_SCRIPT_PATH', 'USER_SCRIPT_PARAM', 'USER_SCRIPT_RUNONCE',
|
env_keys = ['USER_SCRIPT_MEDIAEXTENSIONS', 'USER_SCRIPT_PATH', 'USER_SCRIPT_PARAM', 'USER_SCRIPT_RUNONCE',
|
||||||
'USER_SCRIPT_SUCCESSCODES', 'USER_SCRIPT_CLEAN', 'USDELAY', 'USREMOTE_PATH']
|
'USER_SCRIPT_SUCCESSCODES', 'USER_SCRIPT_CLEAN', 'USDELAY', 'USREMOTE_PATH']
|
||||||
cfg_keys = ['user_script_mediaExtensions', 'user_script_path', 'user_script_param', 'user_script_runOnce',
|
cfg_keys = ['user_script_mediaExtensions', 'user_script_path', 'user_script_param', 'user_script_runOnce',
|
||||||
'user_script_successCodes', 'user_script_clean', 'delay', 'remote_path']
|
'user_script_successCodes', 'user_script_clean', 'delay', 'remote_path']
|
||||||
if env_cat_key in os.environ:
|
if env_cat_key in os.environ:
|
||||||
for index in range(len(env_keys)):
|
for index in range(len(env_keys)):
|
||||||
key = 'NZBPO_{index}'.format(index=env_keys[index])
|
key = 'NZBPO_{index}'.format(index=env_keys[index])
|
||||||
|
|
|
@ -20,7 +20,7 @@ def auto_fork(section, input_category):
|
||||||
apikey = cfg.get("apikey")
|
apikey = cfg.get("apikey")
|
||||||
ssl = int(cfg.get("ssl", 0))
|
ssl = int(cfg.get("ssl", 0))
|
||||||
web_root = cfg.get("web_root", "")
|
web_root = cfg.get("web_root", "")
|
||||||
replace = {'sickrage':'SickRage', 'sickchill':'SickChill', 'sickgear':'SickGear', 'medusa':'Medusa', 'sickbeard-api':'SickBeard-api'}
|
replace = {'sickrage': 'SickRage', 'sickchill': 'SickChill', 'sickgear': 'SickGear', 'medusa': 'Medusa', 'sickbeard-api': 'SickBeard-api'}
|
||||||
f1 = replace[cfg.get("fork", "auto")] if cfg.get("fork", "auto") in replace else cfg.get("fork", "auto")
|
f1 = replace[cfg.get("fork", "auto")] if cfg.get("fork", "auto") in replace else cfg.get("fork", "auto")
|
||||||
try:
|
try:
|
||||||
fork = f1, core.FORKS[f1]
|
fork = f1, core.FORKS[f1]
|
||||||
|
@ -68,7 +68,7 @@ def auto_fork(section, input_category):
|
||||||
login = "{protocol}{host}:{port}{root}/login".format(
|
login = "{protocol}{host}:{port}{root}/login".format(
|
||||||
protocol=protocol, host=host, port=port, root=web_root)
|
protocol=protocol, host=host, port=port, root=web_root)
|
||||||
login_params = {'username': username, 'password': password}
|
login_params = {'username': username, 'password': password}
|
||||||
r = s.get(login, verify=False, timeout=(30,60))
|
r = s.get(login, verify=False, timeout=(30, 60))
|
||||||
if r.status_code == 401 and r.cookies.get('_xsrf'):
|
if r.status_code == 401 and r.cookies.get('_xsrf'):
|
||||||
login_params['_xsrf'] = r.cookies.get('_xsrf')
|
login_params['_xsrf'] = r.cookies.get('_xsrf')
|
||||||
s.post(login, data=login_params, stream=True, verify=False)
|
s.post(login, data=login_params, stream=True, verify=False)
|
||||||
|
|
|
@ -146,6 +146,7 @@ def rename_script(dirname):
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
logger.error("Unable to rename file due to: {error}".format(error=error), "EXCEPTION")
|
logger.error("Unable to rename file due to: {error}".format(error=error), "EXCEPTION")
|
||||||
|
|
||||||
|
|
||||||
def par2(dirname):
|
def par2(dirname):
|
||||||
newlist = []
|
newlist = []
|
||||||
sofar = 0
|
sofar = 0
|
||||||
|
|
|
@ -208,8 +208,8 @@ def build_commands(file, new_dir, movie_name, bitbucket):
|
||||||
sub_streams = [item for item in video_details["streams"] if item["codec_type"] == "subtitle"]
|
sub_streams = [item for item in video_details["streams"] if item["codec_type"] == "subtitle"]
|
||||||
if core.VEXTENSION not in ['.mkv', '.mpegts']:
|
if core.VEXTENSION not in ['.mkv', '.mpegts']:
|
||||||
sub_streams = [item for item in video_details["streams"] if
|
sub_streams = [item for item in video_details["streams"] if
|
||||||
item["codec_type"] == "subtitle" and item["codec_name"] != "hdmv_pgs_subtitle" and item[
|
item["codec_type"] == "subtitle" and item["codec_name"] != "hdmv_pgs_subtitle" and item[
|
||||||
"codec_name"] != "pgssub"]
|
"codec_name"] != "pgssub"]
|
||||||
|
|
||||||
for video in video_streams:
|
for video in video_streams:
|
||||||
codec = video["codec_name"]
|
codec = video["codec_name"]
|
||||||
|
@ -262,7 +262,7 @@ def build_commands(file, new_dir, movie_name, bitbucket):
|
||||||
if audio_streams:
|
if audio_streams:
|
||||||
for i, val in reversed(list(enumerate(audio_streams))):
|
for i, val in reversed(list(enumerate(audio_streams))):
|
||||||
try:
|
try:
|
||||||
if "Commentary" in val.get("tags").get("title"): # Split out commentry tracks.
|
if "Commentary" in val.get("tags").get("title"): # Split out commentry tracks.
|
||||||
commentary.append(val)
|
commentary.append(val)
|
||||||
del audio_streams[i]
|
del audio_streams[i]
|
||||||
except:
|
except:
|
||||||
|
@ -380,13 +380,13 @@ def build_commands(file, new_dir, movie_name, bitbucket):
|
||||||
if audio_cmd2[1] in ['aac', 'dts']:
|
if audio_cmd2[1] in ['aac', 'dts']:
|
||||||
audio_cmd2[2:2] = ['-strict', '-2']
|
audio_cmd2[2:2] = ['-strict', '-2']
|
||||||
|
|
||||||
if a_mapped[1] == a_mapped[0] and audio_cmd2[1:] == audio_cmd[1:]: #check for duplicate output track.
|
if a_mapped[1] == a_mapped[0] and audio_cmd2[1:] == audio_cmd[1:]: # check for duplicate output track.
|
||||||
del map_cmd[-2:]
|
del map_cmd[-2:]
|
||||||
else:
|
else:
|
||||||
audio_cmd.extend(audio_cmd2)
|
audio_cmd.extend(audio_cmd2)
|
||||||
|
|
||||||
if core.AINCLUDE and core.ACODEC3:
|
if core.AINCLUDE and core.ACODEC3:
|
||||||
audio_streams.extend(commentary) #add commentry tracks back here.
|
audio_streams.extend(commentary) # add commentry tracks back here.
|
||||||
for audio in audio_streams:
|
for audio in audio_streams:
|
||||||
if audio["index"] in a_mapped:
|
if audio["index"] in a_mapped:
|
||||||
continue
|
continue
|
||||||
|
@ -443,7 +443,7 @@ def build_commands(file, new_dir, movie_name, bitbucket):
|
||||||
burnt = 1
|
burnt = 1
|
||||||
if not core.ALLOWSUBS:
|
if not core.ALLOWSUBS:
|
||||||
break
|
break
|
||||||
if sub["codec_name"] in ["dvd_subtitle", "VobSub"] and core.SCODEC == "mov_text": # We can't convert these.
|
if sub["codec_name"] in ["dvd_subtitle", "VobSub"] and core.SCODEC == "mov_text": # We can't convert these.
|
||||||
continue
|
continue
|
||||||
map_cmd.extend(['-map', '0:{index}'.format(index=sub["index"])])
|
map_cmd.extend(['-map', '0:{index}'.format(index=sub["index"])])
|
||||||
s_mapped.extend([sub["index"]])
|
s_mapped.extend([sub["index"]])
|
||||||
|
@ -454,7 +454,7 @@ def build_commands(file, new_dir, movie_name, bitbucket):
|
||||||
break
|
break
|
||||||
if sub["index"] in s_mapped:
|
if sub["index"] in s_mapped:
|
||||||
continue
|
continue
|
||||||
if sub["codec_name"] in ["dvd_subtitle", "VobSub"] and core.SCODEC == "mov_text": # We can't convert these.
|
if sub["codec_name"] in ["dvd_subtitle", "VobSub"] and core.SCODEC == "mov_text": # We can't convert these.
|
||||||
continue
|
continue
|
||||||
map_cmd.extend(['-map', '0:{index}'.format(index=sub["index"])])
|
map_cmd.extend(['-map', '0:{index}'.format(index=sub["index"])])
|
||||||
s_mapped.extend([sub["index"]])
|
s_mapped.extend([sub["index"]])
|
||||||
|
@ -478,7 +478,7 @@ def build_commands(file, new_dir, movie_name, bitbucket):
|
||||||
continue
|
continue
|
||||||
if core.SCODEC == "mov_text":
|
if core.SCODEC == "mov_text":
|
||||||
subcode = [stream["codec_name"] for stream in sub_details["streams"]]
|
subcode = [stream["codec_name"] for stream in sub_details["streams"]]
|
||||||
if set(subcode).intersection(["dvd_subtitle", "VobSub"]): # We can't convert these.
|
if set(subcode).intersection(["dvd_subtitle", "VobSub"]): # We can't convert these.
|
||||||
continue
|
continue
|
||||||
command.extend(['-i', subfile])
|
command.extend(['-i', subfile])
|
||||||
lan = os.path.splitext(os.path.splitext(subfile)[0])[1][1:].split('-')[0]
|
lan = os.path.splitext(os.path.splitext(subfile)[0])[1][1:].split('-')[0]
|
||||||
|
@ -542,12 +542,12 @@ def extract_subs(file, newfile_path, bitbucket):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sub_streams = [item for item in video_details["streams"] if
|
sub_streams = [item for item in video_details["streams"] if
|
||||||
item["codec_type"] == "subtitle" and item["tags"]["language"] in core.SLANGUAGES and item[
|
item["codec_type"] == "subtitle" and item["tags"]["language"] in core.SLANGUAGES and item[
|
||||||
"codec_name"] != "hdmv_pgs_subtitle" and item["codec_name"] != "pgssub"]
|
"codec_name"] != "hdmv_pgs_subtitle" and item["codec_name"] != "pgssub"]
|
||||||
except:
|
except:
|
||||||
sub_streams = [item for item in video_details["streams"] if
|
sub_streams = [item for item in video_details["streams"] if
|
||||||
item["codec_type"] == "subtitle" and item["codec_name"] != "hdmv_pgs_subtitle" and item[
|
item["codec_type"] == "subtitle" and item["codec_name"] != "hdmv_pgs_subtitle" and item[
|
||||||
"codec_name"] != "pgssub"]
|
"codec_name"] != "pgssub"]
|
||||||
num = len(sub_streams)
|
num = len(sub_streams)
|
||||||
for n in range(num):
|
for n in range(num):
|
||||||
sub = sub_streams[n]
|
sub = sub_streams[n]
|
||||||
|
@ -650,7 +650,7 @@ def rip_iso(item, new_dir, bitbucket):
|
||||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=bitbucket)
|
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=bitbucket)
|
||||||
out, err = proc.communicate()
|
out, err = proc.communicate()
|
||||||
file_list = [re.match(".+(VIDEO_TS[\\\/]VTS_[0-9][0-9]_[0-9].[Vv][Oo][Bb])", line).groups()[0] for line in
|
file_list = [re.match(".+(VIDEO_TS[\\\/]VTS_[0-9][0-9]_[0-9].[Vv][Oo][Bb])", line).groups()[0] for line in
|
||||||
out.splitlines() if re.match(".+VIDEO_TS[\\\/]VTS_[0-9][0-9]_[0-9].[Vv][Oo][Bb]", line)]
|
out.splitlines() if re.match(".+VIDEO_TS[\\\/]VTS_[0-9][0-9]_[0-9].[Vv][Oo][Bb]", line)]
|
||||||
combined = []
|
combined = []
|
||||||
for n in range(99):
|
for n in range(99):
|
||||||
concat = []
|
concat = []
|
||||||
|
|
|
@ -45,10 +45,15 @@ requests.packages.urllib3.disable_warnings()
|
||||||
|
|
||||||
# Monkey Patch shutil.copyfileobj() to adjust the buffer length to 512KB rather than 4KB
|
# Monkey Patch shutil.copyfileobj() to adjust the buffer length to 512KB rather than 4KB
|
||||||
shutil.copyfileobjOrig = shutil.copyfileobj
|
shutil.copyfileobjOrig = shutil.copyfileobj
|
||||||
|
|
||||||
|
|
||||||
def copyfileobj_fast(fsrc, fdst, length=512 * 1024):
|
def copyfileobj_fast(fsrc, fdst, length=512 * 1024):
|
||||||
shutil.copyfileobjOrig(fsrc, fdst, length=length)
|
shutil.copyfileobjOrig(fsrc, fdst, length=length)
|
||||||
|
|
||||||
|
|
||||||
shutil.copyfileobj = copyfileobj_fast
|
shutil.copyfileobj = copyfileobj_fast
|
||||||
|
|
||||||
|
|
||||||
def report_nzb(failure_link, client_agent):
|
def report_nzb(failure_link, client_agent):
|
||||||
# Contact indexer site
|
# Contact indexer site
|
||||||
logger.info("Sending failure notification to indexer site")
|
logger.info("Sending failure notification to indexer site")
|
||||||
|
@ -605,6 +610,7 @@ def parse_vuze(args):
|
||||||
|
|
||||||
return input_directory, input_name, input_category, input_hash, input_id
|
return input_directory, input_name, input_category, input_hash, input_id
|
||||||
|
|
||||||
|
|
||||||
def parse_qbittorrent(args):
|
def parse_qbittorrent(args):
|
||||||
# qbittorrent usage: C:\full\path\to\nzbToMedia\TorrentToMedia.py "%D|%N|%L|%I"
|
# qbittorrent usage: C:\full\path\to\nzbToMedia\TorrentToMedia.py "%D|%N|%L|%I"
|
||||||
try:
|
try:
|
||||||
|
@ -612,28 +618,29 @@ def parse_qbittorrent(args):
|
||||||
except:
|
except:
|
||||||
input = []
|
input = []
|
||||||
try:
|
try:
|
||||||
input_directory = os.path.normpath(input[0].replace('"',''))
|
input_directory = os.path.normpath(input[0].replace('"', ''))
|
||||||
except:
|
except:
|
||||||
input_directory = ''
|
input_directory = ''
|
||||||
try:
|
try:
|
||||||
input_name = input[1].replace('"','')
|
input_name = input[1].replace('"', '')
|
||||||
except:
|
except:
|
||||||
input_name = ''
|
input_name = ''
|
||||||
try:
|
try:
|
||||||
input_category = input[2].replace('"','')
|
input_category = input[2].replace('"', '')
|
||||||
except:
|
except:
|
||||||
input_category = ''
|
input_category = ''
|
||||||
try:
|
try:
|
||||||
input_hash = input[3].replace('"','')
|
input_hash = input[3].replace('"', '')
|
||||||
except:
|
except:
|
||||||
input_hash = ''
|
input_hash = ''
|
||||||
try:
|
try:
|
||||||
input_id = input[3].replace('"','')
|
input_id = input[3].replace('"', '')
|
||||||
except:
|
except:
|
||||||
input_id = ''
|
input_id = ''
|
||||||
|
|
||||||
return input_directory, input_name, input_category, input_hash, input_id
|
return input_directory, input_name, input_category, input_hash, input_id
|
||||||
|
|
||||||
|
|
||||||
def parse_args(client_agent, args):
|
def parse_args(client_agent, args):
|
||||||
clients = {
|
clients = {
|
||||||
'other': parse_other,
|
'other': parse_other,
|
||||||
|
@ -1309,6 +1316,7 @@ def get_download_info(input_name, status):
|
||||||
|
|
||||||
return sql_results
|
return sql_results
|
||||||
|
|
||||||
|
|
||||||
class WindowsProcess(object):
|
class WindowsProcess(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.mutex = None
|
self.mutex = None
|
||||||
|
@ -1385,6 +1393,7 @@ class PosixProcess(object):
|
||||||
if os.path.isfile(self.pidpath):
|
if os.path.isfile(self.pidpath):
|
||||||
os.unlink(self.pidpath)
|
os.unlink(self.pidpath)
|
||||||
|
|
||||||
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
RunningProcess = WindowsProcess
|
RunningProcess = WindowsProcess
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -19,6 +19,7 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import simplejson as json
|
import simplejson as json
|
||||||
|
|
||||||
|
|
||||||
class UTorrentClient(object):
|
class UTorrentClient(object):
|
||||||
|
|
||||||
def __init__(self, base_url, username, password):
|
def __init__(self, base_url, username, password):
|
||||||
|
@ -27,7 +28,7 @@ class UTorrentClient(object):
|
||||||
self.password = password
|
self.password = password
|
||||||
self.opener = self._make_opener('uTorrent', base_url, username, password)
|
self.opener = self._make_opener('uTorrent', base_url, username, password)
|
||||||
self.token = self._get_token()
|
self.token = self._get_token()
|
||||||
#TODO refresh token, when necessary
|
# TODO refresh token, when necessary
|
||||||
|
|
||||||
def _make_opener(self, realm, base_url, username, password):
|
def _make_opener(self, realm, base_url, username, password):
|
||||||
'''uTorrent API need HTTP Basic Auth and cookie support for token verify.'''
|
'''uTorrent API need HTTP Basic Auth and cookie support for token verify.'''
|
||||||
|
@ -60,25 +61,25 @@ class UTorrentClient(object):
|
||||||
return self._action(params)
|
return self._action(params)
|
||||||
|
|
||||||
def start(self, *hashes):
|
def start(self, *hashes):
|
||||||
params = [('action', 'start'),]
|
params = [('action', 'start'), ]
|
||||||
for hash in hashes:
|
for hash in hashes:
|
||||||
params.append(('hash', hash))
|
params.append(('hash', hash))
|
||||||
return self._action(params)
|
return self._action(params)
|
||||||
|
|
||||||
def stop(self, *hashes):
|
def stop(self, *hashes):
|
||||||
params = [('action', 'stop'),]
|
params = [('action', 'stop'), ]
|
||||||
for hash in hashes:
|
for hash in hashes:
|
||||||
params.append(('hash', hash))
|
params.append(('hash', hash))
|
||||||
return self._action(params)
|
return self._action(params)
|
||||||
|
|
||||||
def pause(self, *hashes):
|
def pause(self, *hashes):
|
||||||
params = [('action', 'pause'),]
|
params = [('action', 'pause'), ]
|
||||||
for hash in hashes:
|
for hash in hashes:
|
||||||
params.append(('hash', hash))
|
params.append(('hash', hash))
|
||||||
return self._action(params)
|
return self._action(params)
|
||||||
|
|
||||||
def forcestart(self, *hashes):
|
def forcestart(self, *hashes):
|
||||||
params = [('action', 'forcestart'),]
|
params = [('action', 'forcestart'), ]
|
||||||
for hash in hashes:
|
for hash in hashes:
|
||||||
params.append(('hash', hash))
|
params.append(('hash', hash))
|
||||||
return self._action(params)
|
return self._action(params)
|
||||||
|
@ -94,8 +95,8 @@ class UTorrentClient(object):
|
||||||
def setprops(self, hash, **kvpairs):
|
def setprops(self, hash, **kvpairs):
|
||||||
params = [('action', 'setprops'), ('hash', hash)]
|
params = [('action', 'setprops'), ('hash', hash)]
|
||||||
for k, v in iteritems(kvpairs):
|
for k, v in iteritems(kvpairs):
|
||||||
params.append( ("s", k) )
|
params.append(("s", k))
|
||||||
params.append( ("v", v) )
|
params.append(("v", v))
|
||||||
|
|
||||||
return self._action(params)
|
return self._action(params)
|
||||||
|
|
||||||
|
@ -111,7 +112,7 @@ class UTorrentClient(object):
|
||||||
|
|
||||||
form = MultiPartForm()
|
form = MultiPartForm()
|
||||||
if filepath is not None:
|
if filepath is not None:
|
||||||
file_handler = open(filepath,'rb')
|
file_handler = open(filepath, 'rb')
|
||||||
else:
|
else:
|
||||||
file_handler = StringIO(bytes)
|
file_handler = StringIO(bytes)
|
||||||
|
|
||||||
|
@ -124,19 +125,19 @@ class UTorrentClient(object):
|
||||||
self._action(params)
|
self._action(params)
|
||||||
|
|
||||||
def remove(self, *hashes):
|
def remove(self, *hashes):
|
||||||
params = [('action', 'remove'),]
|
params = [('action', 'remove'), ]
|
||||||
for hash in hashes:
|
for hash in hashes:
|
||||||
params.append(('hash', hash))
|
params.append(('hash', hash))
|
||||||
return self._action(params)
|
return self._action(params)
|
||||||
|
|
||||||
def removedata(self, *hashes):
|
def removedata(self, *hashes):
|
||||||
params = [('action', 'removedata'),]
|
params = [('action', 'removedata'), ]
|
||||||
for hash in hashes:
|
for hash in hashes:
|
||||||
params.append(('hash', hash))
|
params.append(('hash', hash))
|
||||||
return self._action(params)
|
return self._action(params)
|
||||||
|
|
||||||
def _action(self, params, body=None, content_type=None):
|
def _action(self, params, body=None, content_type=None):
|
||||||
#about token, see https://github.com/bittorrent/webui/wiki/TokenSystem
|
# about token, see https://github.com/bittorrent/webui/wiki/TokenSystem
|
||||||
url = self.base_url + '?token=' + self.token + '&' + urlencode(params)
|
url = self.base_url + '?token=' + self.token + '&' + urlencode(params)
|
||||||
request = Request(url)
|
request = Request(url)
|
||||||
|
|
||||||
|
|
|
@ -42,29 +42,28 @@ class MultiPartForm(object):
|
||||||
|
|
||||||
# Add the form fields
|
# Add the form fields
|
||||||
parts.extend(
|
parts.extend(
|
||||||
[ part_boundary,
|
[part_boundary,
|
||||||
'Content-Disposition: form-data; name="%s"' % name,
|
'Content-Disposition: form-data; name="%s"' % name,
|
||||||
'',
|
'',
|
||||||
value,
|
value,
|
||||||
]
|
]
|
||||||
for name, value in self.form_fields
|
for name, value in self.form_fields
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add the files to upload
|
# Add the files to upload
|
||||||
parts.extend(
|
parts.extend(
|
||||||
[ part_boundary,
|
[part_boundary,
|
||||||
'Content-Disposition: file; name="%s"; filename="%s"' % \
|
'Content-Disposition: file; name="%s"; filename="%s"' % (field_name, filename),
|
||||||
(field_name, filename),
|
'Content-Type: %s' % content_type,
|
||||||
'Content-Type: %s' % content_type,
|
'',
|
||||||
'',
|
body,
|
||||||
body,
|
]
|
||||||
]
|
|
||||||
for field_name, filename, content_type, body in self.files
|
for field_name, filename, content_type, body in self.files
|
||||||
)
|
)
|
||||||
|
|
||||||
# Flatten the list and add closing boundary marker,
|
# Flatten the list and add closing boundary marker,
|
||||||
# then return CR+LF separated data
|
# then return CR+LF separated data
|
||||||
flattened = list(itertools.chain(*parts))
|
flattened = list(itertools.chain(*parts))
|
||||||
flattened.append('--' + self.boundary + '--')
|
flattened.append('--' + self.boundary + '--')
|
||||||
flattened.append('')
|
flattened.append('')
|
||||||
return '\r\n'.join(flattened)
|
return '\r\n'.join(flattened)
|
||||||
|
|
|
@ -668,13 +668,14 @@ def process(input_directory, input_name=None, status=0, client_agent='manual', d
|
||||||
pass
|
pass
|
||||||
|
|
||||||
control_value_dict = {"input_directory": text_type(input_directory1)}
|
control_value_dict = {"input_directory": text_type(input_directory1)}
|
||||||
new_value_dict = {"input_name": text_type(input_name1),
|
new_value_dict = {
|
||||||
"input_hash": text_type(download_id),
|
"input_name": text_type(input_name1),
|
||||||
"input_id": text_type(download_id),
|
"input_hash": text_type(download_id),
|
||||||
"client_agent": text_type(client_agent),
|
"input_id": text_type(download_id),
|
||||||
"status": 0,
|
"client_agent": text_type(client_agent),
|
||||||
"last_update": datetime.date.today().toordinal()
|
"status": 0,
|
||||||
}
|
"last_update": datetime.date.today().toordinal(),
|
||||||
|
}
|
||||||
my_db.upsert("downloads", new_value_dict, control_value_dict)
|
my_db.upsert("downloads", new_value_dict, control_value_dict)
|
||||||
|
|
||||||
# auto-detect section
|
# auto-detect section
|
||||||
|
|
|
@ -14,15 +14,15 @@ from core.utils import server_responding
|
||||||
# Initialize the config
|
# Initialize the config
|
||||||
core.initialize()
|
core.initialize()
|
||||||
|
|
||||||
#label = core.TORRENT_CLASS.core.get_torrent_status("f33a9c4b15cbd9170722d700069af86746817ade", ["label"]).get()['label']
|
# label = core.TORRENT_CLASS.core.get_torrent_status("f33a9c4b15cbd9170722d700069af86746817ade", ["label"]).get()['label']
|
||||||
#print label
|
# print label
|
||||||
|
|
||||||
if transcoder.is_video_good(core.TEST_FILE, 0):
|
if transcoder.is_video_good(core.TEST_FILE, 0):
|
||||||
print("FFPROBE Works")
|
print("FFPROBE Works")
|
||||||
else:
|
else:
|
||||||
print("FFPROBE FAILED")
|
print("FFPROBE FAILED")
|
||||||
|
|
||||||
test = core.CFG['SickBeard','NzbDrone']['tv'].isenabled()
|
test = core.CFG['SickBeard', 'NzbDrone']['tv'].isenabled()
|
||||||
print(test)
|
print(test)
|
||||||
section = core.CFG.findsection('tv').isenabled()
|
section = core.CFG.findsection('tv').isenabled()
|
||||||
print(section)
|
print(section)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue