Filtering based on latest (embedded) date
So for Linphone, we have a bunch of different links on the page:
linphone-android-x.y.z.apklinphone-freecodecs-video-x.y.z.apklinphone-nonfreecodecs-video-x.y.z.apkmaven_repository/
So:
- We want to get rid of all links that are not of the form
linphone-android-x.y.z.apk.- We could do all this in a single regular expression in "Custom APK Link Filter" like this:
linphone-android-.*\.apk - But having 2 separate filters makes it easier:
- The default APK link filter already filters out anything not ending in
.apk(in this case,maven_repository/) - We can then use a simpler second APK filter to get rid of the APKs we don't want:
linphone-android
- The default APK link filter already filters out anything not ending in
- We could do all this in a single regular expression in "Custom APK Link Filter" like this:
- We could just stop here.
- No need for an intermediate link filter (we are already on the page with the final APKs on it).
- No real need for version extraction either.
- If you do want version extraction, you can:
- Use this regex in the "Version Extraction" filter:
android-(.*)\.apk- Set "Match Group" to the default of (
1). In the above regex, the first group is.*(each group is in brackets).
- Set "Match Group" to the default of (
- If you are sure that the version is always 3 sets of digits separated by dots, and that this pattern will never appear more than once in the link, you could avoid using groups entirely by using this regex with "Match Group" set to
0(meaning "use the whole match"):[0-9]+\.[0-9]+\.[0-9]+
- Use this regex in the "Version Extraction" filter:
Originally posted by @ImranR98 in https://github.com/ImranR98/Obtainium/issues/954#issuecomment-1745977857
Could you please suggest the right filtering for most recent date?
i.e. appexample-3.5.2-nightly-signed-05-08-2024.apk
With 05-08-2024 being dd-mm-yyyy
When using the default settings Obtainium always suggest 31-07-2024 as the last release (which obviously is not). Thanks!
We can't really filter correctly for these because the date format (month first) won't work with alphabetical sorting. A new feature to support this would need to be implemented in a way that would be flexible enough work for many websites that use weird date formats, not just this one. Open to suggestions.
@sconim: The quoted text at the beginning of this issue is about linphone, but at a glance, I don't see anywhere where linphone offers downloads which would require the type of filtering, or (more accurately) sorting, that you're requesting. Can you provide a link to a download location where this feature request would apply?