Metadata-Version: 2.4
Name: scl-minhv1
Version: 1.1.1
Summary: SoundCloud search & MP3 downloader
Home-page: https://vippro88.shop
Author: Ho Duc Minh
Author-email: hoducminh@vippro88.shop
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Dynamic: license-file

# scl-minh

🎵 **SoundCloud Search & MP3 Downloader Library (Python)**

Thư viện Python giúp **tìm kiếm bài hát trên SoundCloud theo từ khóa**
và **tải file MP3 trực tiếp** thông qua API.

---

## 👤 Author
**Ho Duc Minh**

🌐 Website: https://vippro88.shop

📜 License: MIT

---

## 🚀 Cài đặt

```bash
pip install scl-minh

"""
Example usage for scl-minh
Author : Ho Duc Minh
Website: https://vippro88.shop
"""

from scl import search, scl


def main():
    print("🎵 scl-minh SoundCloud Tool")
    print("1️⃣ Nhập từ khóa để tìm kiếm")
    print("2️⃣ Dán link SoundCloud để tải trực tiếp")
    print("-" * 40)

    user_input = input("👉 Nhập từ khóa hoặc link SoundCloud: ").strip()

    if not user_input:
        print("❌ Không được để trống")
        return

    # Nếu là link SoundCloud → tải luôn
    if user_input.startswith("http"):
        print("\n⬇️ Đang tải từ link...\n")
        scl(user_input)
        print("\n✅ Tải xong!")
        return

    # Nếu là từ khóa → tìm kiếm
    print(f"\n🔍 Đang tìm kiếm: '{user_input}'...\n")
    results = search(user_input, limit=5)

    if not results:
        print("❌ Không tìm thấy kết quả")
        return

    # Hiển thị kết quả
    for i, song in enumerate(results, 1):
        print(f"{i}. {song['title']}")
        print("   Duration:", song["duration"])
        print("   URL     :", song["url"])
        print("-" * 40)

    # Người dùng chọn bài để tải
    choice = input("\n👉 Chọn số bài muốn tải (0 để hủy): ").strip()

    if not choice.isdigit():
        print("❌ Lựa chọn không hợp lệ")
        return

    choice = int(choice)

    if choice == 0:
        print("🚫 Đã hủy")
        return

    if choice < 1 or choice > len(results):
        print("❌ Số không hợp lệ")
        return

    print("\n⬇️ Đang tải bài đã chọn...\n")
    scl(results[choice - 1]["url"])

    print("\n✅ Hoàn tất!")


if __name__ == "__main__":
    main()
