KODI addon structure
parent
284a2cd01a
commit
34b5af6214
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<addon id="script.module.tinybt" name="tinybt" version="0.9.0" provider-name="inpos">
|
||||
<requires>
|
||||
<import addon="xbmc.python" version="2.25.0"/>
|
||||
</requires>
|
||||
<extension point="xbmc.python.module" library="lib"/>
|
||||
<extension point="xbmc.addon.metadata">
|
||||
<platform>all</platform>
|
||||
<language>en_GB ru_RU</language>
|
||||
<summary lang="en_GB">tiny Bittorrent client</summary>
|
||||
<description lang="en">Implementation of the Bittorrent and Mainline DHT protocol for Distributed Computing applications</description>
|
||||
<email>roman@ukamnya.ru</email>
|
||||
<source>https://git.ukamnya.ru/roman/script.module.tinybt</source></extension>
|
||||
</addon>
|
|
@ -23,15 +23,16 @@ THE SOFTWARE.
|
|||
"""
|
||||
|
||||
import os, time, socket, hashlib, hmac, threading, logging, random, inspect
|
||||
from bencode import bencode, bdecode
|
||||
from utils import encode_uint32, encode_ip, encode_connection, encode_nodes, AsyncTimeout
|
||||
from utils import decode_uint32, decode_ip, decode_connection, decode_nodes, start_thread, ThreadManager
|
||||
from krpc import KRPCPeer, KRPCError
|
||||
from bencode import bdecode
|
||||
from lib.tinybt import bencode.bencode
|
||||
from lib.tinybt.utils import encode_uint32, encode_ip, encode_connection, encode_nodes, AsyncTimeout
|
||||
from lib.tinybt.utils import decode_uint32, decode_ip, decode_connection, decode_nodes, start_thread, ThreadManager
|
||||
from lib.tinybt.krpc import KRPCPeer, KRPCError
|
||||
|
||||
# BEP #0042 - prefix is based on ip and last byte of the node id - 21 most significant bits must match
|
||||
# * ip = ip address in string format eg. "127.0.0.1"
|
||||
def bep42_prefix(ip, crc32_salt, first_node_bits): # first_node_bits determines the last 3 bits
|
||||
from crc32c import crc32c
|
||||
from lib.tinybt import crc32c.crc32c
|
||||
ip_asint = decode_uint32(encode_ip(ip))
|
||||
value = crc32c(bytearray(encode_uint32((ip_asint & 0x030f3fff) | ((crc32_salt & 0x7) << 29))))
|
||||
return (value & 0xfffff800) | ((first_node_bits << 8) & 0x00000700)
|
|
@ -23,8 +23,9 @@ THE SOFTWARE.
|
|||
"""
|
||||
|
||||
import socket, threading, logging
|
||||
from bencode import bencode, bdecode, BTFailure
|
||||
from utils import client_version, AsyncResult, AsyncTimeout, encode_uint64, UDPSocket, ThreadManager
|
||||
from bencode import bdecode, BTFailure
|
||||
from lib.tinybt import bencode.bencode
|
||||
from lib.tinybt.utils import client_version, AsyncResult, AsyncTimeout, encode_uint64, UDPSocket, ThreadManager
|
||||
|
||||
krpc_version = bytes(client_version[0] + bytearray([client_version[1], client_version[2]]))
|
||||
|
|
@ -23,10 +23,10 @@ THE SOFTWARE.
|
|||
"""
|
||||
|
||||
import sys, socket, random
|
||||
from bencode import bdecode
|
||||
from utils import UDPSocket, encode_int32, decode_connection
|
||||
from utils import encode_ip, encode_uint64, encode_uint32, encode_uint16
|
||||
from utils import decode_ip, decode_uint64, decode_uint32
|
||||
from lib.tinybt.bencode import bdecode
|
||||
from lib.tinybt.utils import UDPSocket, encode_int32, decode_connection
|
||||
from lib.tinybt.utils import encode_ip, encode_uint64, encode_uint32, encode_uint16
|
||||
from lib.tinybt.utils import decode_ip, decode_uint64, decode_uint32
|
||||
|
||||
class TrackerException(Exception):
|
||||
pass
|
Loading…
Reference in New Issue