mirror of
https://github.com/NohamR/Ratio.py.git
synced 2025-05-23 16:28:58 +00:00
Update Transmission version to (#1)
Co-authored-by: garnajee <garnajee@users.noreply.github.com>
This commit is contained in:
parent
a7a59f4bcc
commit
4cdfd779cb
@ -3,7 +3,7 @@
|
||||
Ratio.py is a small command line RatioMaster.Net like in Python3. It fakes upload stats of a torrent.
|
||||
Current emulators available are:
|
||||
|
||||
- Transmission 3.00
|
||||
- Transmission 4.0.6
|
||||
|
||||
### Requirements
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
from code.decoding_bencoded import bencoding
|
||||
from code.torrentclientfactory import Transmission300
|
||||
from code.torrentclientfactory import Transmission406
|
||||
from code.pretty import pretty_data, pretty_GET
|
||||
|
||||
from hashlib import sha1
|
||||
@ -19,7 +19,7 @@ class process_torrent():
|
||||
def __init__(self, configuration):
|
||||
self.configuration = configuration
|
||||
self.open_torrent()
|
||||
self.torrentclient = Transmission300(self.tracker_info_hash())
|
||||
self.torrentclient = Transmission406(self.tracker_info_hash())
|
||||
|
||||
def open_torrent(self):
|
||||
torrent_file = self.configuration['torrent']
|
||||
|
@ -1,9 +1,9 @@
|
||||
import random
|
||||
import string
|
||||
|
||||
class Transmission300():
|
||||
class Transmission406():
|
||||
def __init__(self, info_hash):
|
||||
self.name = "Transmission 3.00"
|
||||
self.name = "Transmission/4.0.6"
|
||||
parameters = {}
|
||||
# urlencoded 20-byte SHA1 hash of the value of the info key from the Metainfo file
|
||||
parameters['info_hash'] = info_hash
|
||||
@ -23,7 +23,7 @@ class Transmission300():
|
||||
|
||||
def get_headers(self):
|
||||
headers = {}
|
||||
headers['User-Agent'] = 'Transmission/3.00'
|
||||
headers['User-Agent'] = 'Transmission/4.0.6'
|
||||
headers['Accept'] = '*/*'
|
||||
headers['Accept-Encoding'] = 'Accept-Encoding: gzip;q=1.0, deflate, identity'
|
||||
return headers
|
||||
@ -51,7 +51,7 @@ class Transmission300():
|
||||
def generate_peer_id(self):
|
||||
chars = string.ascii_lowercase + string.digits
|
||||
rand_id = self.id_generator(chars, 12)
|
||||
peer_id = "-TR3000-" + rand_id
|
||||
peer_id = "-TR4060-" + rand_id
|
||||
return peer_id
|
||||
|
||||
def generate_key(self):
|
||||
|
0
update_transmission_version.sh
Normal file → Executable file
0
update_transmission_version.sh
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user