tgbot-collection / ytdlbot

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

Failed to download from twitter, also ping button doesn't seem to work #11

Closed dns24 closed 3 years ago

dns24 commented 3 years ago

I got an error when trying to download twitter video, I got:

Traceback (most recent call last):
  File "/app/downloader.py", line 97, in ytdl_download
    ydl.download([url])
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 2068, in download
    res = self.extract_info(
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 808, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 847, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 881, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 1692, in process_video_result
    self.process_info(new_info)
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 1976, in process_info
    success = dl(filename, info_dict)
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 1915, in dl
    return fd.download(name, info)
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/downloader/hls.py", line 78, in real_download
    return fd.real_download(filename, info_dict)
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/downloader/external.py", line 35, in real_download
    retval = self._call_downloader(tmpfilename, info_dict)
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/downloader/external.py", line 227, in _call_downloader
    self.report_error('m3u8 download detected but ffmpeg or avconv could not be found. Please install one.')
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/downloader/common.py", line 165, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 628, in report_error
    self.trouble(error_message, tb)
  File "/app/.heroku/python/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 598, in trouble
    raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: m3u8 download detected but ffmpeg or avconv could not be found. Please install one.

also on ping button I got log on heroku like this:

2021-08-16T00:16:19.695433+00:00 app[worker.1]: 2021-08-16 00:16:19,695 - ytdl.py [INFO]: Download complete.
2021-08-16T00:22:06.411351+00:00 app[worker.1]: 2021-08-16 00:22:06,410 - dispatcher.py [ERROR]: [400 MESSAGE_TOO_LONG]: The message text is over 4096 characters (caused by "messages.SendMessage")
2021-08-16T00:22:06.411360+00:00 app[worker.1]: Traceback (most recent call last):
2021-08-16T00:22:06.411361+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.9/site-packages/pyrogram/dispatcher.py", line 219, in handler_worker
2021-08-16T00:22:06.411362+00:00 app[worker.1]:     await self.loop.run_in_executor(
2021-08-16T00:22:06.411363+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.9/concurrent/futures/thread.py", line 52, in run
2021-08-16T00:22:06.411363+00:00 app[worker.1]:     result = self.fn(*self.args, **self.kwargs)
2021-08-16T00:22:06.411363+00:00 app[worker.1]:   File "/app/ytdl.py", line 52, in ping_handler
2021-08-16T00:22:06.411364+00:00 app[worker.1]:     client.send_message(chat_id, bot_info)
2021-08-16T00:22:06.411364+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.9/site-packages/pyrogram/sync.py", line 50, in async_to_sync_wrap
2021-08-16T00:22:06.411365+00:00 app[worker.1]:     return asyncio.run_coroutine_threadsafe(coroutine, loop).result()
2021-08-16T00:22:06.411365+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.9/concurrent/futures/_base.py", line 445, in result
2021-08-16T00:22:06.411366+00:00 app[worker.1]:     return self.__get_result()
2021-08-16T00:22:06.411366+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
2021-08-16T00:22:06.411367+00:00 app[worker.1]:     raise self._exception
2021-08-16T00:22:06.411367+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.9/site-packages/pyrogram/methods/messages/send_message.py", line 125, in send_message
2021-08-16T00:22:06.411368+00:00 app[worker.1]:     r = await self.send(
2021-08-16T00:22:06.411368+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.9/site-packages/pyrogram/methods/advanced/send.py", line 77, in send
2021-08-16T00:22:06.411369+00:00 app[worker.1]:     r = await self.session.send(
2021-08-16T00:22:06.411369+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.9/site-packages/pyrogram/session/session.py", line 425, in send
2021-08-16T00:22:06.411369+00:00 app[worker.1]:     return await self._send(data, timeout=timeout)
2021-08-16T00:22:06.411370+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.9/site-packages/pyrogram/session/session.py", line 395, in _send
2021-08-16T00:22:06.411370+00:00 app[worker.1]:     RPCError.raise_it(result, type(data))
2021-08-16T00:22:06.411370+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.9/site-packages/pyrogram/errors/rpc_error.py", line 78, in raise_it
2021-08-16T00:22:06.411371+00:00 app[worker.1]:     raise getattr(
2021-08-16T00:22:06.411371+00:00 app[worker.1]: pyrogram.errors.exceptions.bad_request_400.MessageTooLong: [400 MESSAGE_TOO_LONG]: The message text is over 4096 characters (caused by "messages.SendMessage")

Overall this is a good work.

BennyThink commented 3 years ago

Ping won't work on heroku because it's designed to work with docker containers.

As to the first issue, your app lacks of ffmpeg. Please try to install one on heroku

BennyThink commented 3 years ago

Now ffmpeg is included in buildpack. Please redeploy and it should work. Also ping was fixed.