I don’t know if this is the right place, but I’m having trouble downloading a tar file with wget. I’m trying to get the latest file, but I don’t know how to use regex or grep to get this file: https://release.tinymediamanager.org/v4/dist/tmm_22.214.171.124_linux.tar.gz
But ultimatly whats the prefered methode to get a file without worriying about the version number.
Calibre for example (but a bad one) doesn’t have a release number…
Is curl better ?
If it helps, I am a Manjaro user
It works for me:
❯ wget https://release.tinymediamanager.org/v4/dist/tmm_126.96.36.199_linux.tar.gz
--2021-06-10 12:58:57-- https://release.tinymediamanager.org/v4/dist/tmm_188.8.131.52_linux.tar.gz
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving release.tinymediamanager.org (release.tinymediamanager.org)... 184.108.40.206
Connecting to release.tinymediamanager.org (release.tinymediamanager.org)|220.127.116.11|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 67378058 (64M) [application/gzip]
Saving to: ‘tmm_18.104.22.168_linux.tar.gz.1’
tmm_22.214.171.124_linux.tar.g 100%[==============================>] 64.26M 12.9MB/s in 5.2s
2021-06-10 12:59:03 (12.3 MB/s) - ‘tmm_126.96.36.199_linux.tar.gz.1’ saved [67378058/67378058]
if I understand well you wish to make a get without knowing the url.
it is not possible to know the last version from a file url (or use ls with ftp) but it is sometimes possible to get a html page and extract url
solution is always different, for exemple
curl -s 'https://release.tinymediamanager.org/' | grep -io 'v4/.*linux.*tar.gz' | tail -n1
f=$(curl -s 'https://release.tinymediamanager.org/' | grep -io 'v4/.*linux.*tar.gz' | tail -n1)
yes but my request was more along the lines of what papajoke did.
In the end I used that :
wget https://release.tinymediamanager.org/`wget -qO- https://release.tinymediamanager.org/ | grep 'linux.tar.gz' | grep -Po -m 1 "href='\K.*?(?=')"`
I wonder though if your methode is better...