summaryrefslogtreecommitdiff
path: root/libmat2/torrent.py
diff options
context:
space:
mode:
authordkg2018-09-01 05:14:32 -0700
committerjvoisin2018-09-01 05:14:32 -0700
commite2634f7a5052f0507b245b30e2f2bc25963f863f (patch)
treeec8b62ae6a726751f34e74efbce7afbbc3ccc5ef /libmat2/torrent.py
parentaba9b72d2c9defc253f954d30dfeb3ae3e46d2cc (diff)
Logging cleanup
Diffstat (limited to 'libmat2/torrent.py')
-rw-r--r--libmat2/torrent.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/libmat2/torrent.py b/libmat2/torrent.py
index 90f83f8..049807b 100644
--- a/libmat2/torrent.py
+++ b/libmat2/torrent.py
@@ -3,9 +3,6 @@ from typing import Union, Tuple, Dict
3 3
4from . import abstract 4from . import abstract
5 5
6logging.basicConfig(level=logging.ERROR)
7
8
9class TorrentParser(abstract.AbstractParser): 6class TorrentParser(abstract.AbstractParser):
10 mimetypes = {'application/x-bittorrent', } 7 mimetypes = {'application/x-bittorrent', }
11 whitelist = {b'announce', b'announce-list', b'info'} 8 whitelist = {b'announce', b'announce-list', b'info'}
@@ -123,9 +120,9 @@ class _BencodeHandler(object):
123 try: 120 try:
124 ret, trail = self.__decode_func[s[0]](s) 121 ret, trail = self.__decode_func[s[0]](s)
125 except (IndexError, KeyError, ValueError) as e: 122 except (IndexError, KeyError, ValueError) as e:
126 logging.debug("Not a valid bencoded string: %s", e) 123 logging.warning("Not a valid bencoded string: %s", e)
127 return None 124 return None
128 if trail != b'': 125 if trail != b'':
129 logging.debug("Invalid bencoded value (data after valid prefix)") 126 logging.warning("Invalid bencoded value (data after valid prefix)")
130 return None 127 return None
131 return ret 128 return ret