Skip to content

Commit

Permalink
partially fix #11, #15, #21, #45
Browse files Browse the repository at this point in the history
  • Loading branch information
SpEcHiDe committed May 3, 2020
1 parent 90cc208 commit e40ee47
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tobrot/helper_funcs/youtube_dl_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions tobrot/plugins/incoming_message_fn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e40ee47

Please sign in to comment.