Skip to content

ngl mag sender #7

Description

@whylahb

import random
import requests
import time

固定不變的 API 網址

URL = "https://ngl.link/api/submit"

def send_simple_message(username, message):
"""簡易版發送訊息"""

# 隨機使用者代理
user_agents = [
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0"
]

# 請求標頭
headers = {
    "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    "Referer": f"https://ngl.link/{username}",
    "User-Agent": random.choice(user_agents),
}

# 請求資料
data = {
    "username": username,
    "question": message,
    "deviceId": "".join(random.choices("0123456789abcdef", k=16)),
}

try:
    # 發送請求
    response = requests.post(URL, headers=headers, data=data, timeout=5)

    if response.status_code == 200:
        print(f"✓ 訊息發送成功: {message}")
        return True
    else:
        print(f"✗ 發送失敗 (狀態碼: {response.status_code})")
        return False

except Exception as e:
    print(f"✗ 錯誤: {e}")
    return False

def main():
print("=== NGL 簡易訊息發送器 ===")

# 輸入使用者名稱
username = input("請輸入目標使用者名稱: ").strip()

# 輸入訊息
message = input("請輸入要發送的訊息: ").strip()

# 輸入發送次數
try:
    count = int(input("請輸入發送次數: ").strip())
except:
    count = 1

print(f"\n開始發送...")
success_count = 0

for i in range(count):
    print(f"進度: {i + 1}/{count}")

    if send_simple_message(username, message):
        success_count += 1

    # 每次發送間隔 1 秒(修改這裡!)
    if i < count - 1:
        wait_time = 1.0  # 固定 1 秒
        print(f"等待 {wait_time} 秒後繼續...")
        time.sleep(wait_time)

print(f"\n=== 完成 ===")
print(f"成功發送: {success_count}/{count} 條訊息")

if
name_
==_"main":
main ()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions