Skip to content

Instantly share code, notes, and snippets.

@jaketame
Last active May 29, 2018 20:26
Show Gist options
  • Save jaketame/c99f165e76f129a9e1dd43477c742660 to your computer and use it in GitHub Desktop.
Save jaketame/c99f165e76f129a9e1dd43477c742660 to your computer and use it in GitHub Desktop.
Nzbget Pause Script
#!/usr/bin/python
import requests
#jsonrpclib-pelix
from jsonrpclib import jsonrpc
username = ''
password = ''
# site address
host = ''
class Nzbget(object):
def __init__(self, username, password, host):
if username and password:
authstring = '%s:%s@' % (username, password)
else:
authstring = ''
self.url = 'https://%s%s/jsonrpc' % (authstring, host)
self.action = jsonrpc.ServerProxy(self.url)
def pause(self):
print('Paused nzbget')
return self.action.pause()
def resume(self):
print('Resumed nbzbget')
return self.action.resume()
client = Nzbget(host=host, username=username, password=password)
client.resume()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment