PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, August 13, 2022

[FIXED] How to hide the output of yt-dl in CMD? python

 August 13, 2022     console, ffmpeg, output, python, ytdl     No comments   

Issue

I'm coding program that download mp3 audio from youtube videos but I have an issue that yt-dl show some output in console

my code:

with open('Links.txt') as f:
    content = f.readlines()
    for links in content:

        ydl_opts = {
            'format': 'bestaudio/best',
            'postprocessors': [{
                'key': 'FFmpegExtractAudio',
                'preferredcodec': 'mp3',
                'preferredquality': '192',
            }],
        }
        with youtube_dl.YoutubeDL(ydl_opts) as ydl:
            ydl.download([links])

photo of output: enter image description here

and i need the option or some way to hide the output.


Solution

Try adding "quiet": true, to your ydl_opts

If that doesn't work maybe add

"external_downloader_args": ['-loglevel', 'panic']


Answered By - Ron Serruya
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing