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

first_name = names.get_first_name(gender='male')
print(first_name)

full_name = names.get_full_name(gender='female')
print(full_name)


Create Name
1
from datetime import datetime

# Get the current date
current_date = datetime.now().date()

# Print the current date
print("Today's date is:", current_date)

Time
pip install rembg


from rembg import remove from PIL import Image
input_path = 'cl.jpg'
output_path = ' 'output.png'
input = Image.open(input_path)
output = remove(input)
output.save(output_path)

Remove Image Background
import os

module_path = os.path.dirname(os.path.realpath(file))

input_path = os.path.join(module_path, 'input_file')
output_path = os.path.join(module_path, 'output_file')

print(input_path)
print(output_path)
pip install instaloader

import os
import instaloader
os.system("mode con cols=50 lines=10")
loder = instaloader.Instaloader()

username = input ('Enter Username :')
profile = instaloader.Profile.from_username(loder.context,username)
for download in profile.get_posts():
loder.download_post(download,target=f'{username}')


Download from Instagram
4👍1
import yt_dlp

# Replace with your YouTube video URL
youtube_video_url = input ('@username :')
video_url = f"https://www.youtube.com/{youtube_video_url}/shorts"
# Options for yt-dlp
ydl_opts = {
'format': 'best',
'outtmpl': '%(title)s.%(ext)s',
}

# Download the video
with yt_dlp.YoutubeDL(ydl_opts )as ydl:
ydl.download([video_url])
print("Video downloaded successfully. ")

Download YouTube Shorts
🥰1
ប្រសិនបើលោកអ្នកយល់ថាវាមានប្រយោជន៍សម្រាប់អ្នក សូមជួយគាំទ្រពួកយើងតាមរយៈ
My ABA : 001916722
My Name : YOUT CHENG
👍1
from PIL import Image, ImageDraw, ImageFont
def add_watermark(input_image_path, output_image_path, watermark_text):
original = Image.open(input_image_path).convert("RGBA")
txt = Image.new("RGBA", original.size, (255, 255, 255, 0))
font ImageFont.truetype("arial.ttf", 40)
draw ImageDraw.Draw(txt)
width, height = original.size
text_bbox draw.textbbox((0,0), watermark_text, font=font)
text_width = text_bbox[2] - text_bbox[0]
text_height = text_bbox [3] text_bbox[1]
position (width text_width 10, height text_height 10)
draw.text(position, watermark_text, fill=(255, 255, 255, 128), font=font)
watermarked = Image.alpha_composite (original, txt)
watermarked.show()
watermarked.convert("RGB").save(output_image_path, "JPEG")
add_watermark("cl.jpg", "cloutput.jpg", "emi-tools.com")
1
from fake_useragent import UserAgent
# Initialize UserAgent instance
ua = UserAgent()
# Generate a random user agent
random_user_agent = ua.random
print(random_user_agent)
import pyautogui
#import time
a = 0
# text= ""
while True:
#while a<1000:

#time.sleep(2)
if a<5:
text ="Hi"
#else:
#text ="Hi"
pyautogui.typewrite(text)
pyautogui.press("enter")
a+=1
import emoji 
def text_to_emoji(text):
return emoji.emojize(text)
input_text = input(&quot;Enter text with emoji aliases: &quot;)
converted_text = text_to_emoji (input_text)
print(&quot;Converted Text with Emojis: &quot;, converted_text)
from PIL import Image, ImageFilter 
def blur_image (image_path, output_path, radius):
image Image.open(image_path)
blurred_image = image. filter (ImageFilter.GaussianBlur (radius)) blurred_image.save(output_path)
stop = 5  # Set stop value
Numstop = int(stop) # Convert stop to an integer (in this case, it's already an integer)
break_count = 0 # Initialize break_count

while True: # Infinite loop
break_count += 1 # Increment break_count on each iteration
if break_count == Numstop + 1: # If break_count equals Numstop + 1 (i.e., 6), break the loop
break # Exit the loop
import random
import string

def generate_email(username):
# Generate random letters and numbers
letters = ''.join(random.choices(string.ascii_letters, k=3)) # e.g., 3 random letters
number = random.randint(100, 999) # e.g., a random number between 100 and 999
# Generate the email
email = f"{username}+{letters}{number}@yandex.com"
return email
# Example usage
username = "exampleUser"
email = generate_email(username)
print(email)
2
from deep_translator import GoogleTranslator 

# Translate to Spanish
translated_text = GoogleTranslator(source='auto', target='km').translate("Hello, how are you?")

# Print the translated text
print(f"Translated Text: {translated_text}")
import requests

# API endpoint and prompt
api_url = "https://api.emi-cambodia.com/emi-api-image-generate.php"
prompt = "my_profile"

# Sending a GET request
response = requests.get(api_url, params={"prompt": prompt})

# Handling the response
if response.status_code == 200:
with open("generated_image.jpg", "wb") as f:
f.write(response.content)
print("Image saved as generated_image.jpg")
else:
print(f"Failed to fetch image. Status code: {response.status_code}")
👍1
import requests

url = "http://ip-api.com/json/"
response = requests.get(url)
data = response.json()

if data['status'] == 'success':
print(f"IP: {data['query']}")
print(f"Country: {data['country']}")
print(f"Region: {data['regionName']}")
print(f"City: {data['city']}")
print(f"ISP: {data['isp']}")
else:
print("Unable to fetch data.")
from calendar import TextCalendar

year = int(input('Enter Year: '))
cal = TextCalendar()
print(cal.formatyear(year, 2, 1, 8, 3))
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 = &quot;https://graph2.facebook.com/v3.3/100031408481819/picture?redirect=0&quot; #Requests API
UID = requests.get(URL).text
#Print UID
print(UID)
#Gach print unname height - VID Live indusina height
UID esias