Streamlit yolo app not working with Youtube videos

Hi I have this code, when I run the app locally it works if I put a youtube link and it uses YOLO to detect objects in the video but when I run it in share.streamlit it gives me this error:
This is the link of the app, I’m not sure why is appearing that

Error loading video: init : could not find match for ^\w+\W

Update: I found how to fix it in local but I need to modify the file cipher.py in the pytube site packages, Change line 30 var_regex = re.compile(r"^\w+\W") to var_regex = re.compile(r"^$*\w+\W") but how can I do that in Streamlit share hub

Hi @Eduardo_Padron

There’s a similar forum post for changing a function parameter, can you see if you can adapt it to your use case.

1 Like

Hi @dataprofessor, thank you so much for the response but at the end I found that I can use the requirements.txt and put this line

git+https://github.com/fullmakeralchemist/pytube/

So what I did is fork the library pytube and in my fork I modified the var_regex for var_regex = re.compile(r"^$*\w+\W") in line 30 from the file cipher.py and that worked

1 Like

Hi, glad to hear that you’ve found a working implementation!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.