Cambo Souce Code Python
283 subscribers
1 photo
1 file
5 links
ប្រសិនបើលោកអ្នកយល់ថាវាមានប្រយោជន៍សម្រាប់អ្នក សូមជួយគាំទ្រពួកយើងតាមរយៈ
My ABA : 001916722
My Name : YOUT CHENG
Download Telegram
import imaplib
import email
from email.header import decode_header

# Your Gmail credentials
username = 'your_email@gmail.com'
password = 'your_password'

# Connect to the Gmail IMAP server
mail = imaplib.IMAP4_SSL('imap.gmail.com')

# Log in to your account
mail.login(username, password)

# Select the mailbox you want to check (in this case, the inbox)
mail.select('inbox')

# Search for emails from Facebook
status, messages = mail.search(None, 'FROM "facebookmail.com"')

# Convert messages to a list of email IDs
email_ids = messages[0].split()

# Loop through the email IDs and fetch the latest email
for email_id in email_ids[-1:]: # Get the most recent email
# Fetch the email by ID
res, msg = mail.fetch(email_id, '(RFC822)')
for response_part in msg:
if isinstance(response_part, tuple):
# Parse the email content
msg = email.message_from_bytes(response_part[1])
subject, encoding = decode_header(msg['Subject'])[0]
if isinstance(subject, bytes):
subject = subject.decode(encoding if encoding else 'utf-8')

# Print the subject
print('Subject:', subject)

# If the email is multipart
if msg.is_multipart():
for part in msg.walk():
# Get the email body
if part.get_content_type() == 'text/plain':
body = part.get_payload(decode=True).decode()
print('Body:', body)
# Here you can extract the code from the body
else:
# If the email is not multipart
body = msg.get_payload(decode=True).decode()
print('Body:', body)
# Here you can extract the code from the body

# Logout
mail.logout()
pip install openai-whisper
pip install ffmpeg-python

import whisper

# Load model (small = លឿន, large = ត្រឹមត្រូវខ្ពស់)
model = whisper.load_model("base")

# Transcribe audio
result = model.transcribe("audio.mp3")

print("Text:", result["text"])


Model Speed Accuracy
tiny លឿនខ្លាំង ទាប
base លឿន មធ្យម
small មធ្យម ល្អ
medium យឺត ខ្ពស់
large យឺតខ្លាំង ល្អបំផុត
1
Import requests 
#GraphAPI Link
URL = "https://graph2.facebook.com/v3.3/100031408481819/picture?redirect=0" #Requests API
UID = requests.get(URL).text
#Print UID
print(UID)
#Gach print unname height - VID Live indusina height
UID esias
import requests

# API endpoint និង Key
api_url = "https://www.cambo-kh.com/api/img-gen"
params = {
"key": "KD2AJ-1Z2RI-FRK2D-UIXL9",
"prompt": "my_profile"
}

# ជំហានទី ១៖ ហៅទៅ API ដើម្បីយក JSON ដែលមាន URL រូបភាព
try:
response = requests.get(api_url, params=params)
response.raise_for_status() # ពិនិត្យមើលថាតើមាន error ទេ

data = response.json()

if data.get("status") == "success":
image_url = data.get("image_url")
print(f"ទទួលបាន URL រូបភាព: {image_url}")

# ជំហានទី ២៖ ទាញយករូបភាពពី URL ដែលបានមកពី API
img_response = requests.get(image_url)
if img_response.status_code == 200:
with open("generated_image.jpg", "wb") as f:
f.write(img_response.content)
print("រូបភាពត្រូវបានរក្សាទុកជោគជ័យជា 'generated_image.jpg'!")
else:
print(f"បរាជ័យក្នុងការទាញយករូបភាព. Status code: {img_response.status_code}")
else:
print(f"API បានឆ្លើយតបថា: {data.get('message', 'បរាជ័យ')}")

except requests.exceptions.RequestException as e:
print(f"មានបញ្ហាក្នុងការភ្ជាប់ទៅ API: {e}")



```Josn
{
    "status": "success",
    "image_url": "https://www.cambo-kh.com/img/uploads/6a0dc9c84aa41.png",
    "image_size": "51.59 KB",
    "join": "@CamboKhComChannel on Telegram",
    "support": "@youtcheng1266"
}
`


👇URL API

https://www.cambo-kh.com/api/img-gen?key=KD2AJ-1Z2RI-FRK2D-UIXL9&prompt=my_profile
import requests

headers = {
    "Authorization": "Bearer api_token"
}

params = {
    "type": "generate_qr",
    "amount": 5,
}

response = requests.get(
    "https://www.payment-system.dev/api/v2/",
    params=params,
    headers=headers
)

data = response.json()

khqr_code = data['data'][0]
print(khqr_code)
import requests

headers = {
"Authorization": "Bearer api_token"
}

params = {
"type": "check_md5",
"md5": "c5804e7cf6d652b4582da46c04ea3269"
}

response = requests.get(
"https://www.payment-system.dev/api/v2/",
params=params,
headers=headers
)

data = response.json()

print(data)
from bakong_khqr import KHQR

       
        # Initialize KHQR
        khqr = KHQR()
        khqr.token = token_here
       
        qr_bakong = khqr.create_qr(
            bank_account='username@aclb',
            merchant_name='',
            merchant_city='Phnom Penh',
            amount=,
            currency='USD',
            store_label='',
            phone_number='',
            bill_number=,
            terminal_label=""
        )

        # Generate MD5 using our own function
        md5 = generate_md5(qr_bakong)
        qr_bakong

print(md5)
print(qr_bakong)
from flask import Flask, request, jsonify
import requests

app = Flask(__name__)

ACCESS_TOKEN = ""
BAKONG_URL = "https://api-bakong.nbc.gov.kh/v1/check_transaction_by_md5"

@app.route('/check')
def check():
    md5 = request.args.get("md5")
    if not md5:
        return jsonify({"error": "Missing md5"}), 400
    try:
        r = requests.post(BAKONG_URL, headers={"Authorization": f"Bearer {ACCESS_TOKEN}"}, json={"md5": md5})
        return jsonify(r.json()), r.status_code
    except Exception as e:
        return jsonify({"error": str(e)}), 500

if __name__ == "__main__":
    app.run(debug=True)
2
បើសិនចង់ចេះដាក់ប្រាក់តាមមក api
Join បាន

https://t.me/+QNNx1iY9qrk4OWY1