-1

i have a txt file which contains url of files and name of the files are same

https://example.com/asdf/a.jpg
https://example.com/njff/a.jpg
https://example.com/8ikd/a.jpg
https://example.com/98ik/a.jpg
https://example.com/90uo/a.jpg

and i want to download those files with different names like this

1.jpg
2.jpg
3.jpg
4.jpg
5.jpg

i tried using bash while loop and -O to change name of files, but %0D is at end of url

https://example.com/90uo/a.jpg%0D

My question is, how can i remove %0D? or is there any way to download from urls which has same file name and rename them not to be duplicated?

tmvkrpxl0
  • 13
  • 4

1 Answers1

0
wget -c --output-document - https://example.com/asdf/a.jpg > 1.jpg

--output-document flag tells wget to perform shell redirection other than instructing it to use the new name instead of the original name in the URL

cosa__
  • 96
  • 5