ImranR98 / Obtainium

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

Filtering based on latest (embedded) date #1772

Open sconim opened 1 month ago

sconim commented 1 month ago
          So for Linphone, we have a bunch of different links on the page:

So:

  1. 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
  2. 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.
  3. 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).
    • 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]+

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!

ImranR98 commented 3 weeks ago

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.