Private GIT

Skip to content
Snippets Groups Projects
Commit 13360171 authored by Matt's avatar Matt
Browse files

Moved HTTP requests into 1 method to cleanup exception handling

parent 8619de9c
No related branches found
No related tags found
No related merge requests found
......@@ -72,6 +72,8 @@ class DelugeClient(TorrentClient):
'params': params
}).encode('utf-8')
self.send_log('Calling Deluge API with method {}'.format(method), 'debug')
req = self._add_common_headers(Request(self.url, data=data))
self.request_id += 1
......
__author__ = 'barry'
import urllib.request
from urllib.request import Request, urlopen, URLError
from urllib.parse import urlsplit
from bs4 import BeautifulSoup
import json
from urllib.request import urlopen, URLError
import sys
import re
import gzip
# TODO Deal with slashes in client URL
......@@ -95,7 +89,12 @@ class TorrentClient:
return res
def _process_response(self, res):
# TODO May only be needed for deluge. Remove from parent if that's the case
"""
Perform response handling for the specific torrent client. Each line requires different processing/decoding of
the response
:param res:
:return:
"""
raise NotImplementedError
def _authenticate(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment