abhiTronix/vidgear

[Bug]: Logging issue with yt-dlp

hmurari opened this issue · 3 comments

Description

While initializing logging backend, the following code is used:

# define default options for yt-dlp backend self.ydl_opts = { "format": "best*[vcodec!=none]", "quiet": True, "prefer_insecure": False, "no_warnings": True if logging else False, "dump_single_json": True, "extract_flat": True, "skip_download": True, }

However, no_warnings should be the other way round.

no_warnings: False if logging else True

Issue Checklist

  • I have searched open or closed issues for my problem and found nothing related or helpful.
  • I have read the Documentation and found nothing related to my problem.
  • I've read the Issue Guidelines and wholeheartedly agree.

Expected behaviour

Should be like this:

# define default options for yt-dlp backend self.ydl_opts = { "format": "best*[vcodec!=none]", "quiet": True, "prefer_insecure": False, "no_warnings": False if logging else True, "dump_single_json": True, "extract_flat": True, "skip_download": True, }

Actual behaviour

With logging = False, I see warning messages from YT-DLP.
With logging = True, I don't see warning messages from YT-DLP

Steps to reproduce

Open any youtube stream

Terminal log output

While using CamGear(logging=False)

WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (1/3)...
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (2/3)...
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (3/3)...
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U

Python Code(Optional)

No response

VidGear Version

0.3.2

Python version

3.10

OpenCV version

4.2

Operating System version

Ubuntu 22.04

Any other Relevant Information?

N/A

Thanks for opening this issue, a maintainer will get back to you shortly!

In the meantime:

  • Read our Issue Guidelines, and update your issue accordingly. Please note that your issue will be fixed much faster if you spend about half an hour preparing it, including the exact reproduction steps and a demo.
  • Go comprehensively through our dedicated FAQ & Troubleshooting section.
  • For any quick questions and typos, please refrain from opening an issue, as you can reach us on Gitter community channel.

@hmurari Good catch. I'll fix it :)

Successfully resolved and merged in commit c456574