Forums

FFMPEG Doesnt work

Hi. I write python bot for download part video from long and send it to user. When i run it local all works fine but when i run it from host i have next error

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 700, in urlopen self._prepare_proxy(conn) File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 994, in _prepare_proxy conn.connect() File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 369, in connect self._tunnel() File "/usr/local/lib/python3.10/http/client.py", line 924, in _tunnel raise OSError(f"Tunnel connection failed: {code} {message.strip()}") OSError: Tunnel connection failed: 403 Forbidden

During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send resp = conn.urlopen( File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 785, in urlopen retries = retries.increment( File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.youtube.com', port=443): Max retries exceeded with url: /watch?v=11jeljL_4n0 (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/Pabl0/.local/lib/python3.10/site-packages/streamlink/plugin/api/http_session.py", line 152, in request res = super().request( File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send r = adapter.send(request, kwargs) File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 559, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.youtube.com', port=443): Max retries exceeded with url: /watch?v=11jeljL_4n0 (Caused b y ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

Traceback (most recent call last): File "/home/Pabl0/main.py", line 50, in <module> bot.polling() File "/home/Pabl0/.local/lib/python3.10/site-packages/telebot/init.py", line 1043, in polling self.threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, File "/home/Pabl0/.local/lib/python3.10/site-packages/telebot/__init.py", line 1118, in threaded_polling raise e File "/home/Pabl0/.local/lib/python3.10/site-packages/telebot/__init.py", line 1074, in __threaded_polling self.worker_pool.raise_exceptions() File "/home/Pabl0/.local/lib/python3.10/site-packages/telebot/util.py", line 148, in raise_exceptions raise self.exception_info File "/home/Pabl0/.local/lib/python3.10/site-packages/telebot/util.py", line 91, in run task(args, kwargs) File "/home/Pabl0/.local/lib/python3.10/site-packages/telebot/init.py", line 6428, in _run_middlewares_and_handler result = handler'function' File "/home/Pabl0/main.py", line 32, in handle_video_request streams = streamlink.streams(url) File "/home/Pabl0/.local/lib/python3.10/site-packages/streamlink/api.py", line 16, in streams return session.streams(url, params) File "/home/Pabl0/.local/lib/python3.10/site-packages/streamlink/session.py", line 593, in streams return plugin.streams(params) File "/home/Pabl0/.local/lib/python3.10/site-packages/streamlink/plugin/plugin.py", line 421, in streams ostreams = self._get_streams() File "/home/Pabl0/.local/lib/python3.10/site-packages/streamlink/plugins/youtube.py", line 351, in _get_streams res = self._get_res(self.url) File "/home/Pabl0/.local/lib/python3.10/site-packages/streamlink/plugins/youtube.py", line 266, in _get_res res = self.session.http.get(url) File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 600, in get return self.request("GET", url, *kwargs) File "/home/Pabl0/.local/lib/python3.10/site-packages/streamlink/plugin/api/http_session.py", line 171, in request raise err streamlink.exceptions.PluginError: Unable to open URL: https://www.youtube.com/watch?v=11jeljL_4n0 (HTTPSConnectionPool(host='www.youtube.com', port =443): Max retries exceeded with url: /watch?v=11jeljL_4n0 (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))))

You will not be able to download videos from YouTube. Free accounts can only access sites on our allow list and YouTube do not have a public API for downloading videos, so it is not a candidate for the allow list.