mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
Updated requests lib.
More code cleanup done.
This commit is contained in:
parent
504ea8ac45
commit
086eaaa516
19 changed files with 347 additions and 123 deletions
|
@ -6,6 +6,7 @@ import struct
|
|||
import shutil
|
||||
import sys
|
||||
import time
|
||||
from lib import requests
|
||||
import nzbtomedia
|
||||
|
||||
from nzbtomedia.linktastic import linktastic
|
||||
|
@ -495,4 +496,18 @@ def find_download(clientAgent, nzbName, download_id):
|
|||
if clientAgent == 'deluge':
|
||||
pass
|
||||
if clientAgent == 'sabnzbd':
|
||||
baseURL = "http://%s:%s/api" % (nzbtomedia.SABNZBDHOST, nzbtomedia.SABNZBDPORT)
|
||||
url = baseURL
|
||||
params = {}
|
||||
params['apikey'] = nzbtomedia.SABNZBDAPIKEY
|
||||
params['mode'] = "history"
|
||||
params['output'] = 'json'
|
||||
|
||||
try:
|
||||
r = requests.get(url, params=params)
|
||||
except requests.ConnectionError:
|
||||
logger.error("Unable to open URL")
|
||||
return 1 # failure
|
||||
|
||||
result = r.json()
|
||||
pass
|
Loading…
Add table
Add a link
Reference in a new issue