tgbot-collection / ytdlbot

Download videos from Youtube and other platforms through a Telegram Bot
Apache License 2.0
561 stars 533 forks source link

/ytdlp not working in private group #424

Closed SilverBull closed 1 day ago

SilverBull commented 2 weeks ago
          > I don't wanna hijack this, but the bot should function in group then? I should open a different issue to understand why I can't make it work in a private group?

It should work with the command: /ytdl in a group

Originally posted by @vuisme in https://github.com/tgbot-collection/ytdlbot/issues/323#issuecomment-2324102353

The /ytdl command returns a list of youtube videos and does nothing when a link is sent.

Is there something I need to configure first?

vuisme commented 2 weeks ago

Maybe problem from youtube search feauture. I blocked that feauture https://github.com/tgbot-collection/ytdlbot/blob/07632b1e68c2236ed53242efdf946692b6fe5075/ytdlbot/ytdl_bot.py#L532

SilverBull commented 2 weeks ago

So what would be the correct workflow? The bot is up and running, privately I send /start and then a youtube link and the bot responds with the video. Then I added the bot to the group, also re-sent /start from the group, then tried sending the link, sending /direct and now sending /ytdlp before the link and the bot just doesn't respond. Should be added as admin?

SanujaNS commented 2 weeks ago

Hello @SilverBull ,

Thank you for bringing this issue to our attention. As I haven't personally used this bot in a group, I was unaware of this bugs existence until now.

Give us some time. @BennyThink and I will look into this and provide an update as soon as we have more information or a possible solution.

Thank you again for taking the time to report this issue. Your feedback helps us improve this project.

SanujaNS commented 2 weeks ago

PR has been submitted with the fix. @BennyThink will merge it after review.

SilverBull commented 2 weeks ago

I'm using docker so I'll wait, but in the meantime I tried hot swapping the file inside the container with your patch. Can you clarify to me how it is supposed to work? You just start the bot and send the link? Because I tried both normal and /direct and I get an error

SanujaNS commented 2 weeks ago

I'm using docker so I'll wait, but in the meantime I tried hot swapping the file inside the container with your patch. Can you clarify to me how it is supposed to work? You just start the bot and send the link? Because I tried both normal and /direct and I get an error

Wait till docker image updated. I have pushed a another commit. Now the /spdl, /leech, and /direct command can also be used in groups.

You just need to add bot to the group. Check the bot by /start, after it responded,

SilverBull commented 1 day ago

I missed the update, just tried it, works now. Now I have just to figure how I can automatically download yt without the command beforehand

SanujaNS commented 1 day ago

I missed the update, just tried it, works now. Now I have just to figure how I can automatically download yt without the command beforehand

When using the bot's dedicated window, you only need to send a link, as the bot automatically recognizes the message as intended for it. However, when using the bot within a group chat, adding the command before the link is necessary to ensure the bot identifies that the message is meant for it. This is how the bot distinguishes between general chat messages and specific commands for it to execute.

SanujaNS commented 1 day ago

If the issue has been resolved to your satisfaction and you have no further questions or concerns, we kindly request that you close the issue. Please don't hesitate to reach out if you need any assistance in the future.

Thank you.

SilverBull commented 1 day ago

adding the command before the link is necessary to ensure the bot identifies that the message is meant for it. This is how the bot distinguishes between general chat messages and specific commands for it to execute.

Yeah I know, but I would like to abilitate the bot to parse every link send in this particular group and match only Youtube and TikTok links and download it. But this is a separate issue and eventualy I will do a PR

SilverBull commented 1 day ago

If the issue has been resolved to your satisfaction and you have no further questions or concerns, we kindly request that you close the issue. Please don't hesitate to reach out if you need any assistance in the future.

Thank you.

Yes thank you and BennyThink