Spaces:
Runtime error
Runtime error
Update bot/ui/texts.py
Browse files- bot/ui/texts.py +42 -65
bot/ui/texts.py
CHANGED
|
@@ -1,74 +1,51 @@
|
|
| 1 |
-
#
|
| 2 |
-
START_TEXT = (
|
| 3 |
-
"β
**StudyTube Online**\n\n"
|
| 4 |
-
"Send a **video/document** in private chat.\n"
|
| 5 |
-
"I will show a preview (title/desc/privacy) and upload to your private YouTube.\n\n"
|
| 6 |
-
"π₯ **Link archive (admin/owner only)**\n"
|
| 7 |
-
"β’ `/archive <t.me link>` (also works with `/yt` or `/dl`)\n"
|
| 8 |
-
"β’ `/batch <start_link> <end_link>`\n\n"
|
| 9 |
-
"**Quick**\n"
|
| 10 |
-
"β’ /auth β’ /profiles β’ /speedtest β’ /help\n"
|
| 11 |
-
)
|
| 12 |
|
| 13 |
-
|
| 14 |
-
"π **Help**\n\n"
|
| 15 |
-
"β
**Direct upload flow**\n"
|
| 16 |
-
"1) Send a video/document in private chat\n"
|
| 17 |
-
"2) Bot shows preview: title/desc/privacy\n"
|
| 18 |
-
"3) Press **Upload** (or Edit / Privacy)\n\n"
|
| 19 |
-
"π **Link archive (admin/owner only)**\n"
|
| 20 |
-
"β’ `/archive https://t.me/c/xxxx/123`\n"
|
| 21 |
-
"β’ Bot fetches via user-session, lets you pick filename, then shows preview\n\n"
|
| 22 |
-
"βοΈ **Editing title/desc**\n"
|
| 23 |
-
"Send message like:\n"
|
| 24 |
-
"`My Title`\n"
|
| 25 |
-
"`My description line 1`\n"
|
| 26 |
-
"`line 2 ...`\n\n"
|
| 27 |
-
"β‘ **Speedtest**\n"
|
| 28 |
-
"β’ /speedtest\n\n"
|
| 29 |
-
"π‘οΈ **Owner commands**\n"
|
| 30 |
-
"β’ /allow <id>\n"
|
| 31 |
-
"β’ /disallow <id>\n"
|
| 32 |
-
"β’ /stats\n"
|
| 33 |
-
"β’ /diag\n"
|
| 34 |
-
)
|
| 35 |
|
| 36 |
-
|
| 37 |
-
"βοΈ **Send new title/description**\n\n"
|
| 38 |
-
"Format:\n"
|
| 39 |
-
"β’ First line = **Title**\n"
|
| 40 |
-
"β’ Remaining lines = **Description** (optional)\n\n"
|
| 41 |
-
"Tip: You can send just one line to only change the title.\n"
|
| 42 |
-
"(/cancel anytime)"
|
| 43 |
-
)
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
"(/cancel anytime)"
|
| 52 |
-
)
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
"Examples:\n"
|
| 57 |
-
"β’ `client_id | client_secret`\n"
|
| 58 |
-
"β’ `client_id client_secret`\n\n"
|
| 59 |
-
"(/cancel anytime)"
|
| 60 |
-
)
|
| 61 |
|
| 62 |
-
|
| 63 |
-
PARSE_FAIL = "β Couldn't parse. Try again."
|
| 64 |
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FILE: bot/ui/texts.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
START_TEXT = """π¬ *YouTubeLoader Bot*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
β
Send a *video* or *document* in DM β bot will preview β choose privacy/edit β upload.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
*Setup (first time)*
|
| 8 |
+
1) /auth β add credentials
|
| 9 |
+
2) /profiles β tap *Login* (Google) β then *Set default*
|
| 10 |
+
|
| 11 |
+
*Commands*
|
| 12 |
+
/start β menu
|
| 13 |
+
/help β help
|
| 14 |
+
/auth β add profile credentials
|
| 15 |
+
/profiles β manage profiles (default/login/delete)
|
| 16 |
+
/cancel β cancel current upload / batch
|
| 17 |
+
|
| 18 |
+
*Admin/Owner only*
|
| 19 |
+
/archive <t.me message link> β upload media from a Telegram message
|
| 20 |
+
/batch <t.me links...> β multiple links (one per line)
|
| 21 |
+
/diag β show config + worker health
|
| 22 |
+
/allow <tg_id>, /disallow <tg_id>
|
| 23 |
+
/stats β today stats
|
| 24 |
|
| 25 |
+
Buttons in menu:
|
| 26 |
+
β’ Profiles β’ Add Profile β’ Speed Test β’ Help
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
Tip: During download/upload youβll see *live speed + ETA* and final *download/upload/total time*.
|
| 29 |
+
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
HELP_TEXT = """π§Ύ *Help*
|
|
|
|
| 32 |
|
| 33 |
+
*Upload*
|
| 34 |
+
β’ Send video/document β confirm β upload
|
| 35 |
+
β’ Use *Edit* button to change title/description
|
| 36 |
+
β’ Privacy cycles: private β unlisted β public
|
| 37 |
|
| 38 |
+
*Profiles*
|
| 39 |
+
β’ /profiles shows all profiles (connected or not)
|
| 40 |
+
β’ If not connected, tap *Login*
|
| 41 |
+
β’ Choose *Set default* to select the profile used for uploads
|
| 42 |
|
| 43 |
+
*Common errors*
|
| 44 |
+
β’ `uploadLimitExceeded` / `quotaExceeded` β YouTube daily limit; try another profile or retry later
|
| 45 |
+
β’ `WORKER*_URL/... missing` β env not set in Space
|
| 46 |
+
"""
|
| 47 |
+
|
| 48 |
+
OWNER_ONLY = "β Owner/Admin only."
|
| 49 |
+
NOT_ALLOWED = "β You are not allowed to use this bot."
|
| 50 |
+
CANCELLED = "β
Cancelled."
|
| 51 |
+
NEED_AUTH = "π No profiles found. Use /auth to add credentials, then /profiles β Login."
|