DRMLab Project
This commit is contained in:
parent
c85b5dda48
commit
536c6d7f36
21
main.py
Normal file
21
main.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
from modules.generator import NetflixESNGenerator
|
||||||
|
import pyfiglet
|
||||||
|
import os
|
||||||
|
import platform
|
||||||
|
|
||||||
|
def clear_screen():
|
||||||
|
"""Clear the console screen."""
|
||||||
|
if platform.system() == "Windows":
|
||||||
|
os.system('cls')
|
||||||
|
else:
|
||||||
|
os.system('clear')
|
||||||
|
|
||||||
|
def main():
|
||||||
|
clear_screen()
|
||||||
|
title = pyfiglet.figlet_format("ESN Generator")
|
||||||
|
print(title)
|
||||||
|
generator = NetflixESNGenerator()
|
||||||
|
generator.run()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
BIN
modules/__pycache__/generator.cpython-313.pyc
Normal file
BIN
modules/__pycache__/generator.cpython-313.pyc
Normal file
Binary file not shown.
BIN
modules/__pycache__/model.cpython-313.pyc
Normal file
BIN
modules/__pycache__/model.cpython-313.pyc
Normal file
Binary file not shown.
BIN
modules/__pycache__/utils.cpython-313.pyc
Normal file
BIN
modules/__pycache__/utils.cpython-313.pyc
Normal file
Binary file not shown.
72
modules/generator.py
Normal file
72
modules/generator.py
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
import random
|
||||||
|
from modules.utils import Utils
|
||||||
|
from modules.model import DeviceType, DeviceSubType
|
||||||
|
|
||||||
|
class NetflixESNGenerator:
|
||||||
|
def __init__(self):
|
||||||
|
self.device_type = ""
|
||||||
|
self.device_subtype = ""
|
||||||
|
self.device_manufacturer = ""
|
||||||
|
self.device_model = ""
|
||||||
|
self.device_system_id = ""
|
||||||
|
self.uhd = False
|
||||||
|
self.esn_output = ""
|
||||||
|
|
||||||
|
def select_device_type(self):
|
||||||
|
print("Select Device Type:\n1. Android\n2. Browser")
|
||||||
|
choice = input("Enter your choice (1/2): ")
|
||||||
|
if choice == '1':
|
||||||
|
self.device_type = "Android"
|
||||||
|
elif choice == '2':
|
||||||
|
self.device_type = "Browser"
|
||||||
|
else:
|
||||||
|
print("Invalid choice. Please select again.")
|
||||||
|
self.select_device_type()
|
||||||
|
|
||||||
|
def select_device_subtype(self):
|
||||||
|
print("Select Device Sub Type:\n1. Phone\n2. Tablet\n3. TV")
|
||||||
|
choice = input("Enter your choice (1/2/3): ")
|
||||||
|
if choice == '1':
|
||||||
|
self.device_subtype = "Phone"
|
||||||
|
elif choice == '2':
|
||||||
|
self.device_subtype = "Tablet"
|
||||||
|
elif choice == '3':
|
||||||
|
self.device_subtype = "TV"
|
||||||
|
else:
|
||||||
|
print("Invalid choice. Please select again.")
|
||||||
|
self.select_device_subtype()
|
||||||
|
|
||||||
|
def input_device_info(self):
|
||||||
|
self.device_manufacturer = input("Enter Device Manufacturer: ")
|
||||||
|
self.device_model = input("Enter Device Model: ")
|
||||||
|
self.device_system_id = input("Enter Device System ID (e.g., 123456): ")
|
||||||
|
|
||||||
|
uhd_choice = input("Is this device 4K? (y/n): ")
|
||||||
|
self.uhd = uhd_choice.lower() == 'y'
|
||||||
|
|
||||||
|
def generate_esn(self):
|
||||||
|
if self.device_type == "Browser":
|
||||||
|
self.esn_output = DeviceType.Chrome + Utils.random_string(30)
|
||||||
|
return
|
||||||
|
|
||||||
|
random_number = random.randint(1000000000, 9999999999)
|
||||||
|
esn_parts = [
|
||||||
|
DeviceType.AndroidUHD if self.uhd else DeviceType.AndroidFHD,
|
||||||
|
DeviceSubType.AndroidPhone if self.device_subtype == "Phone" else
|
||||||
|
DeviceSubType.AndroidTablet if self.device_subtype == "Tablet" else
|
||||||
|
DeviceSubType.AndroidTV,
|
||||||
|
self.device_manufacturer[:3].upper(),
|
||||||
|
self.device_model[:3].upper(),
|
||||||
|
str(random_number)
|
||||||
|
]
|
||||||
|
self.esn_output = '-'.join(esn_parts)
|
||||||
|
|
||||||
|
def copy_esn(self):
|
||||||
|
print(f"ESN Output: {self.esn_output}")
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.select_device_type()
|
||||||
|
self.select_device_subtype()
|
||||||
|
self.input_device_info()
|
||||||
|
self.generate_esn()
|
||||||
|
self.copy_esn()
|
||||||
22
modules/model.py
Normal file
22
modules/model.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
class DeviceType:
|
||||||
|
Chrome = "NFCDCH-02-"
|
||||||
|
AndroidFHD = "NFANDROID1"
|
||||||
|
AndroidUHD = "NFANDROID2"
|
||||||
|
AndroidWear = "NFANDROIDW"
|
||||||
|
Roku = "NFRK-"
|
||||||
|
AppleTV = "NFAPPLETV-"
|
||||||
|
AmazonFireTV = "NFAFTV-"
|
||||||
|
SmartTV = "NFSTV-"
|
||||||
|
GameConsole = "NFGC-"
|
||||||
|
|
||||||
|
class DeviceSubType:
|
||||||
|
ChromeOS = "-PRV-C"
|
||||||
|
AndroidTablet = "-PRV-T"
|
||||||
|
AndroidPhone = "-PRV-P"
|
||||||
|
AndroidTV = "-PRV"
|
||||||
|
AndroidWearable = "-PRV-W"
|
||||||
|
RokuStreaming = "-PRV-RK"
|
||||||
|
AppleTVStreaming = "-PRV-AT"
|
||||||
|
FireTVStreaming = "-PRV-FTV"
|
||||||
|
SmartTVStreaming = "-PRV-STV"
|
||||||
|
GameConsoleStreaming = "-PRV-GC"
|
||||||
19
modules/utils.py
Normal file
19
modules/utils.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import random
|
||||||
|
|
||||||
|
class Utils:
|
||||||
|
@staticmethod
|
||||||
|
def to_int(txt):
|
||||||
|
return int(txt)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def random_string(length=64):
|
||||||
|
chars = "0123456789ABCDEF"
|
||||||
|
return ''.join(random.choice(chars) for _ in range(length))
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def take_char(txt, length):
|
||||||
|
"""Take a substring of a specified length from the string."""
|
||||||
|
if txt is None or txt == "":
|
||||||
|
raise ValueError("String is empty")
|
||||||
|
|
||||||
|
return txt[:length]
|
||||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
pyfiglet==1.0.2
|
||||||
Loading…
Reference in New Issue
Block a user