Last active
May 29, 2018 20:26
-
-
Save jaketame/c99f165e76f129a9e1dd43477c742660 to your computer and use it in GitHub Desktop.
Nzbget Pause Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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