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): ...@@ -72,6 +72,8 @@ class DelugeClient(TorrentClient):
'params': params 'params': params
}).encode('utf-8') }).encode('utf-8')
self.send_log('Calling Deluge API with method {}'.format(method), 'debug')
req = self._add_common_headers(Request(self.url, data=data)) req = self._add_common_headers(Request(self.url, data=data))
self.request_id += 1 self.request_id += 1
......
__author__ = 'barry' __author__ = 'barry'
import urllib.request from urllib.request import urlopen, URLError
from urllib.request import Request, urlopen, URLError
from urllib.parse import urlsplit
from bs4 import BeautifulSoup
import json
import sys import sys
import re
import gzip
# TODO Deal with slashes in client URL # TODO Deal with slashes in client URL
...@@ -95,7 +89,12 @@ class TorrentClient: ...@@ -95,7 +89,12 @@ class TorrentClient:
return res return res
def _process_response(self, 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 raise NotImplementedError
def _authenticate(self): def _authenticate(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment