Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker-compose youtube subscription not working #97

Closed
apa4h opened this issue Apr 14, 2022 · 6 comments
Closed

Docker-compose youtube subscription not working #97

apa4h opened this issue Apr 14, 2022 · 6 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@apa4h
Copy link

apa4h commented Apr 14, 2022

I installed bot using docker-compose, mysql, redis.

Subscribe to youtube and ping does not work.
Tell me, please, what could be the problem?

Thank you!

Errors when adding a subscription:

ytdl_1 | [2022-04-14 17:42:32 limit.py:162 I] Latest video rk3OitqWCog from Alexandr Plushev ytdl_1 | [2022-04-14 17:42:32 dispatcher.py:235 E] (1136, "Column count doesn't match value count at row 1") ytdl_1 | Traceback (most recent call last): ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/dispatcher.py", line 224, in handler_worker ytdl_1 | await self.loop.run_in_executor( ytdl_1 | File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run ytdl_1 | result = self.fn(*self.args, **self.kwargs) ytdl_1 | File "/ytdlbot/ytdlbot/ytdl_bot.py", line 111, in subscribe_handler ytdl_1 | result = vip.subscribe_channel(chat_id, link) ytdl_1 | File "/ytdlbot/ytdlbot/limit.py", line 95, in subscribe_channel ytdl_1 | self.cur.execute("INSERT INTO subscribe values(%s,%s)", (user_id, channel_id)) ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pymysql/cursors.py", line 148, in execute ytdl_1 | result = self._query(query) ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pymysql/cursors.py", line 310, in _query ytdl_1 | conn.query(q) ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pymysql/connections.py", line 548, in query ytdl_1 | self._affected_rows = self._read_query_result(unbuffered=unbuffered) ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pymysql/connections.py", line 775, in _read_query_result ytdl_1 | result.read() ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pymysql/connections.py", line 1156, in read ytdl_1 | first_packet = self.connection._read_packet() ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pymysql/connections.py", line 725, in _read_packet ytdl_1 | packet.raise_for_error() ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pymysql/protocol.py", line 221, in raise_for_error ytdl_1 | err.raise_mysql_exception(self._data) ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pymysql/err.py", line 143, in raise_mysql_exception ytdl_1 | raise errorclass(errno, errval) ytdl_1 | pymysql.err.OperationalError: (1136, "Column count doesn't match value count at row 1")

Error when "ping":

ytdl_1 | [2022-04-14 17:48:36 dispatcher.py:235 E] Telegram says: [400 MESSAGE_TOO_LONG] - The message text is over 4096 characters (caused by "messages.SendMessage") ytdl_1 | Traceback (most recent call last): ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/dispatcher.py", line 224, in handler_worker ytdl_1 | await self.loop.run_in_executor( ytdl_1 | File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run ytdl_1 | result = self.fn(*self.args, **self.kwargs) ytdl_1 | File "/ytdlbot/ytdlbot/ytdl_bot.py", line 167, in ping_handler ytdl_1 | client.send_message(chat_id, f"{bot_info}") ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/sync.py", line 78, in async_to_sync_wrap ytdl_1 | return asyncio.run_coroutine_threadsafe(coroutine, main_loop).result() ytdl_1 | File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 446, in result ytdl_1 | return self.__get_result() ytdl_1 | File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result ytdl_1 | raise self._exception ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/methods/messages/send_message.py", line 128, in send_message ytdl_1 | r = await self.send( ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/methods/advanced/send.py", line 77, in send ytdl_1 | r = await self.session.send( ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/session/session.py", line 362, in send ytdl_1 | return await self._send(data, timeout=timeout) ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/session/session.py", line 332, in _send ytdl_1 | RPCError.raise_it(result, type(data)) ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/errors/rpc_error.py", line 91, in raise_it ytdl_1 | raise getattr( ytdl_1 | pyrogram.errors.exceptions.bad_request_400.MessageTooLong: Telegram says: [400 MESSAGE_TOO_LONG] - The message text is over 4096 characters (caused by "messages.SendMessage")

@BennyThink
Copy link
Member

For ping, your container name must be ytdlbot_ytdl_1

For subscribe, it appears your database column is incorrect. You can alter it, or if there's no important data you can drop it and restart ytdl container.

SQL command is here: https://github.com/tgbot-collection/ytdlbot/blob/master/ytdlbot/db.py#L154

@BennyThink BennyThink self-assigned this Apr 14, 2022
@BennyThink BennyThink added the question Further information is requested label Apr 14, 2022
@apa4h
Copy link
Author

apa4h commented Apr 15, 2022

For ping, your container name must be ytdlbot_ytdl_1

For subscribe, it appears your database column is incorrect. You can alter it, or if there's no important data you can drop it and restart ytdl container.

SQL command is here: https://github.com/tgbot-collection/ytdlbot/blob/master/ytdlbot/db.py#L154

Hi!

Thank you so much for your help!
Everything was solved with the database, but ping did not work, the log with an error at the moment:

ytdl_1 | Traceback (most recent call last): ytdl_1 | File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 910, in json ytdl_1 | return complexjson.loads(self.text, **kwargs) ytdl_1 | File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads ytdl_1 | return _default_decoder.decode(s) ytdl_1 | File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode ytdl_1 | obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ytdl_1 | File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode ytdl_1 | raise JSONDecodeError("Expecting value", s, err.value) from None ytdl_1 | json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ytdl_1 | ytdl_1 | During handling of the above exception, another exception occurred: ytdl_1 | ytdl_1 | Traceback (most recent call last): ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/dispatcher.py", line 224, in handler_worker ytdl_1 | await self.loop.run_in_executor( ytdl_1 | File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run ytdl_1 | result = self.fn(*self.args, **self.kwargs) ytdl_1 | File "/ytdlbot/ytdlbot/ytdl_bot.py", line 164, in ping_handler ytdl_1 | stats = bot_text.ping_worker() ytdl_1 | File "/ytdlbot/ytdlbot/constant.py", line 134, in ping_worker ytdl_1 | workers = InfluxDB().extract_dashboard_data() ytdl_1 | File "/ytdlbot/ytdlbot/db.py", line 241, in extract_dashboard_data ytdl_1 | self.data = self.get_worker_data() ytdl_1 | File "/ytdlbot/ytdlbot/db.py", line 238, in get_worker_data ytdl_1 | return requests.get("https://celery.dmesg.app/dashboard?json=1", headers=headers).json() ytdl_1 | File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 917, in json ytdl_1 | raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) ytdl_1 | requests.exceptions.JSONDecodeError: [Errno Expecting value] Access denied: 0

upd:

checked that the container name is ytdlbot_ytdl_1 but that didn't solve the problem

@BennyThink
Copy link
Member

Oops that's one issue. I'll fix.

@BennyThink
Copy link
Member

It should be fixed. Pull the latest image and try again.

@BennyThink BennyThink added the bug Something isn't working label Apr 15, 2022
@apa4h
Copy link
Author

apa4h commented Apr 15, 2022

Это должно быть исправлено. Загрузите последний образ и повторите попытку.

Now the next error:

ytdl_1 | [2022-04-15 15:58:32 dispatcher.py:235 E] Telegram says: [400 MEDIA_CAPTION_TOO_LONG] - The media caption is longer than 1024 characters (caused by "messages.SendMedia") ytdl_1 | Traceback (most recent call last): ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/dispatcher.py", line 224, in handler_worker ytdl_1 | await self.loop.run_in_executor( ytdl_1 | File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run ytdl_1 | result = self.fn(*self.args, **self.kwargs) ytdl_1 | File "/ytdlbot/ytdlbot/ytdl_bot.py", line 165, in ping_handler ytdl_1 | client.send_document(chat_id, Redis().generate_file(), caption=f"{bot_info}\n\n{stats}") ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/sync.py", line 78, in async_to_sync_wrap ytdl_1 | return asyncio.run_coroutine_threadsafe(coroutine, main_loop).result() ytdl_1 | File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 446, in result ytdl_1 | return self.__get_result() ytdl_1 | File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result ytdl_1 | raise self._exception ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/methods/messages/send_document.py", line 193, in send_document ytdl_1 | r = await self.send( ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/methods/advanced/send.py", line 77, in send ytdl_1 | r = await self.session.send( ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/session/session.py", line 362, in send ytdl_1 | return await self._send(data, timeout=timeout) ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/session/session.py", line 332, in _send ytdl_1 | RPCError.raise_it(result, type(data)) ytdl_1 | File "/usr/local/lib/python3.9/site-packages/pyrogram/errors/rpc_error.py", line 91, in raise_it ytdl_1 | raise getattr( ytdl_1 | pyrogram.errors.exceptions.bad_request_400.MediaCaptionTooLong: Telegram says: [400 MEDIA_CAPTION_TOO_LONG] - The media caption is longer than 1024 characters (caused by "messages.SendMedia")

@BennyThink
Copy link
Member

what about now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants