linux - Download file with the name from last part of directory referred instead of real file name using wget or curl(Wget is prefered) -


lets say,

http://mobile.example.com/vid/flying-birds page on link http://mobile.example.com/vid/22 exist, when click on link, redirects http://v-cdn-r.example.com/mp4/x/y/dfile.mp4?ir=880&int=06 , file name dfile.mp4?ir=880&int=06 downloaded.

i want have file name flying-birds (from first page url). have tried doing wget function,

--default-page=name 

with command

wget -r -l1 --default-page=name http://mobile.example.com/vid/flying-birds 

but downloaded file name 22 (from 2nd link) instead of expected flying-birds

i have more 1 links , each link has different keywords flying-birds. in simple, there lots of directory different-different directory name.

you can try that:

wget -r -l1 -o $(basename http://mobile.example.com/vid/flying-birds) http://mobile.example.com/vid/flying-birds 

see post how wget file correct name when redirected?.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -