tropicoo / yt-dlp-bot

Self-hosted Video Download Telegram Bot 🇺🇦
BSD 3-Clause "New" or "Revised" License
222 stars 73 forks source link

download youtube shows "Unknow command" #261

Open makusujp opened 8 months ago

makusujp commented 8 months ago

windows docker v4.28.0, WSL2

just send the URL ex: https://youtu.be/XHTrLYShBRQ and you see the yt_bot log with below error message

2024-03-22 17:14:32 Traceback (most recent call last): 2024-03-22 17:14:32 File "/usr/local/lib/python3.11/site-packages/pyrogram/dispatcher.py", line 268, in handler_worker 2024-03-22 17:14:32 await handler.callback(self.client, args) 2024-03-22 17:14:32 File "/usr/local/lib/python3.11/site-packages/pyrogram/handlers/message_handler.py", line 151, in resolve_future_or_callback 2024-03-22 17:14:32 await self.original_callback(client, message, args) 2024-03-22 17:14:32 File "/app/bot/core/callbacks.py", line 38, in on_message 2024-03-22 17:14:32 user = client.allowed_users[get_user_id(message)] 2024-03-22 17:14:32 ~~~~^^^^^^^^^^^^^^^^^^^^^^ 2024-03-22 17:14:32 KeyError: 6053554717

bot responds: "Unknow command"

im using the zip for the commit: 20c35b0

tropicoo commented 8 months ago

Hello, I would need to see your configuration with removed personal data and screenshot from Telegram. Didn't see this issue before. Did you send the link from your user to Bot directly or from some group?

makusujp commented 7 months ago

sorry for late reply win11/docker desktop v4.29.0 re-build again for https://github.com/tropicoo/yt-dlp-bot/commit/32e9b92eeb0d4cf51e10fdc314aea76e31d6b717

in yt_bot log:

2024-04-10 14:32:23 2024-04-10 06:32:23,670 - [ERROR] - [pyrogram.dispatcher:342] - 6053554717
2024-04-10 14:32:23 Traceback (most recent call last):
2024-04-10 14:32:23   File "/usr/local/lib/python3.12/site-packages/pyrogram/dispatcher.py", line 329, in handler_worker
2024-04-10 14:32:23     await handler.callback(self.client, *args)
2024-04-10 14:32:23   File "/usr/local/lib/python3.12/site-packages/pyrogram/handlers/message_handler.py", line 151, in resolve_future_or_callback
2024-04-10 14:32:23     await self.original_callback(client, message, *args)
2024-04-10 14:32:23   File "/app/bot/core/callbacks.py", line 38, in on_message
2024-04-10 14:32:23     user = client.allowed_users[get_user_id(message)]
2024-04-10 14:32:23            ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
2024-04-10 14:32:23 KeyError: 6053554717
2024-04-10 14:32:26 2024-04-10 06:32:26,602 - [INFO] - [VideoUploadTask:140] - Uploading "Introducing iPhone 15 | WOW | Apple.mp4" [10.1MiB] [cached: False] to chat id "1277514877"
2024-04-10 14:32:32 2024-04-10 06:32:32,962 - [INFO] - [VideoUploadTask:298] - Saving telegram file cache
2024-04-10 14:32:32 2024-04-10 06:32:32,963 - [INFO] - [VideoUploadTask:140] - Uploading "Introducing iPhone 15 | WOW | Apple.mp4" [10.1MiB] [cached: True] to chat id "-1001392905200"
2024-04-10 14:32:33 2024-04-10 06:32:33,753 - [INFO] - [SuccessDownloadHandler:112] - Cleaning up task "4f54ce66-d439-41c9-ad97-ad6073b72fa6": removing download content directory "/tmp/download_tmpfs/downloaded/oxro" with files {'Introducing iPhone 15 | WOW | Apple.jpg': '35.7KiB', 'Introducing iPhone 15 | WOW | Apple.mp4': '10.1MiB'}

Config.yml (pretty sure i use the latest example file to modify such IDs and tokens the issue still there *removed the personal data

telegram:
  api_id: API_ID
  api_hash: "API_HASH"
  token: "BOT_TOKEN"
  lang_code: !!str "en"
  max_upload_tasks: 2
  url_validation_regexes:
    - "^http(s)?:\\/\\/.+$"
  allowed_users:
    - id: USER_ID
      is_admin: !!bool True
      send_startup_message: !!bool True
      download_media_type: "VIDEO"
      save_to_storage: !!bool False
      use_url_regex_match: !!bool True
      upload:
        upload_video_file: !!bool True
        upload_video_max_file_size: 2147483648
        forward_to_group: !!bool True
        forward_group_id: GROUP_ID
        silent: !!bool False
        video_caption:
          include_title: !!bool True
          include_filename: !!bool False
          include_link: !!bool True
          include_size: !!bool True
  api:
    upload_video_file: !!bool False
    upload_video_max_file_size: 2147483648
    upload_to_chat_ids:
      - 00000000000
      - -00000000000
    silent: !!bool False
    video_caption:
      include_title: !!bool True
      include_filename: !!bool False
      include_link: !!bool True
      include_size: !!bool True
ytdlp:
  version_check_enabled: !!bool True
  version_check_interval: 86400
  notify_users_on_new_version: !!bool True

the telegram bot message