-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Uh oh, an actual issue got submitted.
For me, attempting to play a video using -u ./env/bin/python ./main.py -u 7DKv5H5Frt0 causes an OpenCV error:
OpenCV: Couldn't read video stream from file "https://rr6---sn-cxaaj5o5q5-tt1ed.googlevideo.com/videoplayback?expire=1720669594&ei=OgGPZvjrKsGslu8Pjb6B4AE&ip=[truncated]"
[ERROR:0@4.426] global cap.cpp:166 open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.9.0) /Users/runner/work/opencv-python/opencv-python/opencv/modules/videoio/src/cap_images.cpp:244: error: (-5:Bad argument)
CAP_IMAGES: error, expected '0?[1-9][du]' pattern, got: https://rr6---sn-cxaaj5o5q5-tt1ed.googlevideo.com/videoplayback?expire=1720669594&ei=[truncated]
in function 'icvExtractPattern'
I initially suspected this had something to do with me being on macOS, but attempting to curl the URL gives a 403 Forbidden, which should not happen if the request comes from the IP this URL was created for (which it does), so the URL wasn't generated correctly. This is not an issue with YT-DLP itself, since i can use the CLI to get a functional URL, so then it seems to be an issue with how it's used in this case. I can't say anything more though since i'm not familiar with YT-DLP at all (in fact i didn't know it existed before this)
This could still be related to macOS, but i have no easy way of testing that.
In any case, this error should at least be handled properly. Currently you just get a screen filled with the extremely long OpenCV error (while the actual error is not even related to OpenCV), while the rest of the program continues running.