Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!

cracked.io | Best Forum Around | Free Premium Accounts




 194

How to extract proxy from JSON format in .txt file?

by Yellou - 28 March, 2024 - 03:03 PM
This post is by a banned member (Yellou) - Unhide
Yellou  
Registered
277
Posts
51
Threads
4 Years of service
#1
(This post was last modified: 28 March, 2024 - 03:38 PM by Yellou. Edited 1 time in total.)
blank. sry
DO YOU NEED PAID KEYWORDS?
SEND ME PM. 
This post is by a banned member (UberFuck) - Unhide
UberFuck  
Godlike
1.428
Posts
368
Threads
4 Years of service
#2
You can reference the code in this thread: https://cracked.io/Thread-SOURCE-Base-Cl...n-Checkers
One of the functions is LoadJsonFile(), which will return either a dict or list depending on the json file. Assuming you have a simple json config like { "ProxyIP" : "192.168.0.1" }, the relevant code would be below.
 
Code:
import json

def LoadJsonFile(filePath: str) -> list | dict:
    with open(filePath, 'r', encoding='utf8') as f:
        return json.load(f)

configdata = LoadJsonFile('config.json')
proxyIP = configdata['ProxyIP']

The referenced thread also has a LoadProxyFile() function, which is intended for generic (non-json) proxy files like you would find in https://cracked.io/Forum-Proxies
This post is by a banned member (Yellou) - Unhide
Yellou  
Registered
277
Posts
51
Threads
4 Years of service
#3
(12 April, 2024 - 10:52 AM)UberFuck Wrote: Show More
You can reference the code in this thread: https://cracked.io/Thread-SOURCE-Base-Cl...n-Checkers
One of the functions is LoadJsonFile(), which will return either a dict or list depending on the json file. Assuming you have a simple json config like { "ProxyIP" : "192.168.0.1" }, the relevant code would be below.
 
Code:
import json

def LoadJsonFile(filePath: str) -> list | dict:
    with open(filePath, 'r', encoding='utf8') as f:
        return json.load(f)

configdata = LoadJsonFile('config.json')
proxyIP = configdata['ProxyIP']

The referenced thread also has a LoadProxyFile() function, which is intended for generic (non-json) proxy files like you would find in https://cracked.io/Forum-Proxies
I will check later, thanks
DO YOU NEED PAID KEYWORDS?
SEND ME PM. 

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)