Skip to content

Commit

Permalink
Add support to make youtube-dl verbose if logger is set
Browse files Browse the repository at this point in the history
  • Loading branch information
deepjyoti30 committed Jan 30, 2022
1 parent 58ec33f commit 1ab220a
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions ytmdl/yt.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ def dw_using_yt(link, proxy, song_name, datatype, no_progress=False):
elif datatype == 'm4a':
format_ = 'bestaudio[ext=m4a]'

is_quiet: bool = utility.determine_logger_level(
) != logger.level_map["DEBUG"]

ydl_opts = {
'quiet': True,
'quiet': is_quiet,
'no_warnings': True,
'outtmpl': song_name,
'format': format_,
Expand Down Expand Up @@ -284,8 +287,11 @@ def get_playlist(
url : URL of the video
title: Title of the video.
"""
is_quiet: bool = utility.determine_logger_level(
) != logger.level_map["DEBUG"]

ydl_opts = {
'quiet': True,
'quiet': is_quiet,
'no_warnings': True,
'format': 'bestaudio/best',
'nocheckcertificate': True,
Expand Down Expand Up @@ -327,8 +333,11 @@ def __get_title_from_yt(url):
"""
Return the title of the passed URL.
"""
is_quiet: bool = utility.determine_logger_level(
) != logger.level_map["DEBUG"]

ydl_opts = {
"quiet": True,
"quiet": is_quiet,
'no_warnings': True,
'nocheckcertificate': True,
'source_address': '0.0.0.0'
Expand Down Expand Up @@ -388,8 +397,11 @@ def get_title(url) -> str:
def get_chapters(url):
"""Get the chapters of the passed URL.
"""
is_quiet: bool = utility.determine_logger_level(
) != logger.level_map["DEBUG"]

ydl_opts = {
"quiet": True,
"quiet": is_quiet,
'no_warnings': True,
'nocheckcertificate': True,
'source_address': '0.0.0.0'
Expand Down

0 comments on commit 1ab220a

Please sign in to comment.