I am using pytube
using chaquopy
in android studio
and getting error java.lang.RuntimeException: com.chaquo.python.PyException: RegexMatchError: __init__: could not find match for ^\w+\W
I know that I have to replace the code in cipher.py
var_regex = re.compile(r"^\w+\W")
With that line:
var_regex = re.compile(r"^\$*\w+\W")
I could able to locate cipher.py
in C:\Users\....\AndroidStudioProjects\YouTubeDownloader\app\build\pip\debug\common\pytube\cipher.py
directory and changed the above expression with the new code. But still on execution of the above code, It is showing the same error, and Upon revisiting the cipher.py file, I notice that the code has reverted back to the original version.
I'm uncertain whether I'm performing the modification incorrectly or if I'm unable to locate the correct cipher.py
file, Where the Android Studio keep the python module files in it. Could someone please provide guidance on how to effectively make these changes to the cipher.py
file from within Android Studio? Your assistance is greatly appreciated.
You can do this as follows:
Download the pytube source distribution from https://pypi.org/project/pytube/#files
Unpack it
Apply your edits
Edit your build.gradle file so that instead of this:
install "pytube"
You have this:
install "path/to/your/edited/pytube"