Skip to content

Instantly share code, notes, and snippets.

@rubyon
Created April 1, 2017 12:38
Show Gist options
  • Save rubyon/8b9f941ed2b9607e371882d5b69ed83d to your computer and use it in GitHub Desktop.
Save rubyon/8b9f941ed2b9607e371882d5b69ed83d to your computer and use it in GitHub Desktop.
# Send request to Synology
srpc = SynologyRPC(host[0], host[1], self.conf('username'), self.conf('password'), self.conf('destination'))
if data['protocol'] == 'torrent_magnet':
log.info('Adding torrent URL %s', data['url'])
response = srpc.create_task(url = data['url'])
elif data['protocol'] in ['nzb', 'torrent']:
log.info('Adding torrent URL %s', data['url'])
response = srpc.create_task(url = data['url'])
# log.info('Adding %s' % data['protocol'])
# if not filedata:
# log.error('No %s data found', data['protocol'])
# else:
# filename = data['name'] + '.' + data['protocol']
# response = srpc.create_task(filename = filename, filedata = filedata)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment