icitry / YoutubeCLI

Apache License 2.0
237 stars 20 forks source link

nonfunctional video URL #12

Open chri-k opened 4 months ago

chri-k commented 4 months ago

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.

HKAgrwl commented 3 months ago

Hi, I could not find any other place to post this. I really liked the project and want to contribute to it. Is there any feature or issue I can work on?

sjs262 commented 2 months ago

Yeah I'm getting the same error, and I'm on Windows so it's not OS specific. Sucks because this is a really cool project but I have no idea how to bug fix this.