ImranR98 / Obtainium

Get Android app updates straight from the source.
https://obtainium.imranr.dev
GNU General Public License v3.0
5.79k stars 137 forks source link

Understanding version extraction regexp #1636

Closed breversa closed 1 month ago

breversa commented 1 month ago

Hello!

I'm trying to set up Obtainium to get the latest version of sherpa-oonx for my language from https://k2-fsa.github.io/sherpa/onnx/tts/apk-engine.html

The (current) latest version I'm looking for is https://huggingface.co/csukuangfj/sherpa-onnx-apk/resolve/main/tts-engine-2/sherpa-onnx-1.9.25-arm64-v8a-fr-tts-engine-vits-piper-fr_FR-upmc-medium.apk

The version is 1.9.25

My current set up is the following:

And this works well enough to get the latest version, however I'm unable to extract the version string (here, 1.9.25)

Am I correct that the version extraction regexp should include one (and only one) capture group that will give the version? It's never mentioned in the documentation: https://github.com/ImranR98/Obtainium/wiki#html

If that's the case, the correct version extraction regex should then be sherpa-onnx-(.+)-arm64-v8a-fr-tts-engine-vits-piper-fr_FR-upmc-medium.apk ?

Also, since that download page is very long, is there any performance improvement that can be made in setting up Obtainium?

ImranR98 commented 1 month ago

There can be any number of groups. You can use the "match group" to specify which one you want. In your case it should be '1' for the first group ('0' is the whole match).

breversa commented 1 month ago

… but there needs to be capture groups, right? The documentation never says anything about it, hence my confusion.

Otherwise, how can I define that I only want the 1.9.25 part of https://huggingface.co/csukuangfj/sherpa-onnx-apk/resolve/main/tts-engine-2/sherpa-onnx-1.9.25-arm64-v8a-fr-tts-engine-vits-piper-fr_FR-upmc-medium.apk?

breversa commented 1 month ago

Found it!

By using -(\d+(\.\d+)*)- as version extraction regexp, and just 1 as correspondance group, I was able to extract 1.9.25. Thanks for your help! :-)

Any hint regarding the performance improvement? Would using longer regexp (with static parts) be more efficient?

Ex: sherpa-onnx-(\d+(\.\d+)*)-arm64-v8a-fr-tts-engine-vits-piper-fr_FR-upmc-medium instead of -(\d+(\.\d+)*)- ?

ImranR98 commented 1 month ago

I don't think there would be any significant performance issue.