Skip to main content

Tu dong tao video Sora theo batch voi nhieu Chrome profiles

Project description

dsora-gen

Công cụ tự động tạo video Sora theo batch với nhiều Chrome profile, hỗ trợ thông báo Telegram và theo dõi tiến trình.


Yêu cầu

  • Python 3.11+ — kiểm tra bằng python3 --version
  • Google Chrome đã được cài đặt trên máy
  • Tài khoản Sora đã đăng ký và được cấp quyền

Cài đặt

macOS / Linux:

pip3 install dsora-gen

Windows:

pip install dsora-gen

Lần đầu chạy lệnh dsg bất kỳ, tool sẽ tự động cài Playwright Chromium — bạn không cần thêm bước nào.


Hướng dẫn sử dụng

Bước 1 — Thiết lập ban đầu

dsg setup

Tool sẽ hỏi lần lượt các thông tin sau:

Thông tin Bắt buộc Mô tả
Số lượng profile Mỗi profile = 1 tài khoản Sora, xử lý tối đa 5 sản phẩm
Tên alias cho từng profile Tên gợi nhớ, ví dụ: tai_khoan_1
Username dsora Dùng để lấy danh sách sản phẩm từ API
Backend key Key xác thực để cập nhật trạng thái sản phẩm
Telegram Bot Token Nhận thông báo tự động qua Telegram
Telegram Channel ID ID kênh hoặc nhóm nhận thông báo

Sau khi nhập xong, Chrome sẽ tự mở từng cửa sổ. Bạn cần thao tác thủ công trong mỗi cửa sổ:

  1. Đăng nhập tài khoản Google
  2. Truy cập sora.comđăng nhập
  3. Vào Settings → đặt thời lượng 15 giây và số lượng 3 videos
  4. Đóng Chrome khi hoàn tất — session đăng nhập sẽ được lưu lại tự động

Bước 2 — Chạy tự động

dsg run

Khi chạy, tool sẽ thực hiện tuần tự:

  1. Gọi API lấy danh sách sản phẩm chưa xử lý (GET /products/pending)
  2. Tính số profile cần dùng — nếu sản phẩm ít hơn capacity thì chỉ mở đúng số profile cần thiết
  3. Với mỗi profile:
    • Mở Chrome sử dụng session đã đăng nhập
    • Lần lượt xử lý từng sản phẩm: điền prompt → upload ảnh → chọn cài đặt → tạo video
    • Sau mỗi sản phẩm: gọi API cập nhật trạng thái, gửi thông báo Telegram, chờ 10 phút
    • Sau khi xử lý xong 5 sản phẩm: đóng Chrome, ghi log, gửi thông báo tổng kết profile
  4. Hiển thị tổng kết toàn bộ khi hoàn tất

Đăng nhập lại một profile

Dùng khi một profile bị đăng xuất khỏi Google hoặc Sora:

dsg setup --retry

Tool sẽ hiển thị danh sách profile hiện có, nhập số thứ tự để mở Chrome đăng nhập lại.


Mở Chrome cho một profile cụ thể

dsg open <alias>

# Ví dụ:
dsg open tai_khoan_1

Xem danh sách lệnh

dsg help
dsg --help

Dữ liệu lưu trữ

Toàn bộ dữ liệu lưu tại ~/.sora-tool/không nằm trong thư mục cài đặt Python:

Đường dẫn Nội dung
~/.sora-tool/settings.json Cấu hình: username, backend key, telegram, danh sách profiles
~/.sora-tool/run_log.json Lịch sử chạy từng profile theo ngày
~/.sora-tool/profiles/profile_1/ Chrome session & cookies của profile 1
~/.sora-tool/profiles/profile_N/ Chrome session & cookies của profile N

⚠️ Không xóa thư mục profiles/ — đây là nơi lưu session đăng nhập. Nếu xóa, bạn phải đăng nhập lại toàn bộ.


Gỡ lỗi thường gặp

dsg: command not found

Thêm pip bin vào PATH. Trên macOS: thêm dòng sau vào ~/.zshrc rồi chạy source ~/.zshrc:

export PATH="$HOME/Library/Python/3.x/bin:$PATH"

Chrome không khởi động được

Đảm bảo Google Chrome đã được cài tại đường dẫn mặc định:

  • macOS: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
  • Linux: /usr/bin/google-chrome
  • Windows: C:\Program Files\Google\Chrome\Application\chrome.exe

Không tìm thấy nút tạo video / bị timeout

Profile có thể đã bị đăng xuất. Chạy dsg setup --retry để đăng nhập lại profile đó.

API trả về lỗi 401

Backend key không hợp lệ hoặc đã hết hạn. Chạy dsg setup và nhập lại backend key mới.

Lỗi Only 3 jobs can run at a time

Tool sẽ tự động chờ 5 phút rồi thử lại — không cần làm gì thêm.


Phát hành phiên bản mới (dành cho developer)

# Bump version trong pyproject.toml và __init__.py, sau đó:
rm -rf dist/
python3 -m build
twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dsora_gen-0.1.2.tar.gz (34.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dsora_gen-0.1.2-py3-none-any.whl (37.1 kB view details)

Uploaded Python 3

File details

Details for the file dsora_gen-0.1.2.tar.gz.

File metadata

  • Download URL: dsora_gen-0.1.2.tar.gz
  • Upload date:
  • Size: 34.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for dsora_gen-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0e7ee71c8b88bb40616fd9631a2158497cd54a68e11ca18c882de2947153e624
MD5 da8759098f91467867e0acc17fa21d65
BLAKE2b-256 559adef6cbfdf4020a47f93b4aded5cf6127512b92b8e33a4dd6b93163bb2d3b

See more details on using hashes here.

File details

Details for the file dsora_gen-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: dsora_gen-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 37.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for dsora_gen-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2226f8ca5c5ee46c8dc433c1eda2445a1f2ef167f04ed35ceacc65a70f72f412
MD5 ed2528c649ad771d6e8f35f82a7ea7a1
BLAKE2b-256 9bb43cfc1643ef48e77c63ba983a0cca8396648165dbd5369ad3ba722ca32ca7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page