diff --git a/tobrot/helper_funcs/youtube_dl_extractor.py b/tobrot/helper_funcs/youtube_dl_extractor.py index 2ba1856d..4852c182 100644 --- a/tobrot/helper_funcs/youtube_dl_extractor.py +++ b/tobrot/helper_funcs/youtube_dl_extractor.py @@ -24,7 +24,7 @@ ) -async def extract_youtube_dl_formats(url, user_working_dir): +async def extract_youtube_dl_formats(url, yt_dl_user_name, yt_dl_pass_word, user_working_dir): command_to_exec = [ "youtube-dl", "--no-warnings", @@ -35,6 +35,14 @@ async def extract_youtube_dl_formats(url, user_working_dir): if "hotstar" in url: command_to_exec.append("--geo-bypass-country") command_to_exec.append("IN") + # + if yt_dl_user_name is not None: + command_to_exec.append("--username") + command_to_exec.append(yt_dl_user_name) + if yt_dl_pass_word is not None: + command_to_exec.append("--password") + command_to_exec.append(yt_dl_pass_word) + LOGGER.info(command_to_exec) process = await asyncio.create_subprocess_exec( *command_to_exec, diff --git a/tobrot/plugins/incoming_message_fn.py b/tobrot/plugins/incoming_message_fn.py index eeca2333..91256e67 100644 --- a/tobrot/plugins/incoming_message_fn.py +++ b/tobrot/plugins/incoming_message_fn.py @@ -106,6 +106,9 @@ async def incoming_youtube_dl_f(client, message): # list the formats, and display in button markup formats thumb_image, text_message, reply_markup = await extract_youtube_dl_formats( dl_url, + # cf_name, + yt_dl_user_name, + yt_dl_pass_word, user_working_dir ) if thumb_image is not None: