Add configuration file

This commit is contained in:
MisterDaneel committed 2019-02-16 18:03:01 +01:00
1 parent 363aafe901
commit 8316712c75
2 files changed
+36 -5

No files matched your search

+4 -2
View File
@@ -16,8 +16,10 @@ logging.basicConfig(level=logging.DEBUG)
class torrent():
def __init__(self, torrent_tile):
with open(torrent_tile, 'rb') as tf:
def __init__(self, configuration):
self.configuration = configuration
torrent_file = self.configuration['torrent:']
with open(torrent_file, 'rb') as tf:
data = tf.read()
self.b_enc = bencoding()
self.metainfo = self.b_enc.bdecode(data)