Downloading with wget

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_4.1.5.1_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 :smiley:

It works for me:

❯ wget https://release.tinymediamanager.org/v4/dist/tmm_4.1.5.1_linux.tar.gz
--2021-06-10 12:58:57--  https://release.tinymediamanager.org/v4/dist/tmm_4.1.5.1_linux.tar.gz
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving release.tinymediamanager.org (release.tinymediamanager.org)... 35.185.44.232
Connecting to release.tinymediamanager.org (release.tinymediamanager.org)|35.185.44.232|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 67378058 (64M) [application/gzip]
Saving to: ‘tmm_4.1.5.1_linux.tar.gz.1’

tmm_4.1.5.1_linux.tar.g 100%[==============================>]  64.26M  12.9MB/s    in 5.2s    

2021-06-10 12:59:03 (12.3 MB/s) - ‘tmm_4.1.5.1_linux.tar.gz.1’ saved [67378058/67378058]
1 Like

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)
 wget "https://release.tinymediamanager.org/$f"
3 Likes

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...
1 Like