Download List of URLs

Sdílet
Vložit
  • čas přidán 13. 09. 2024
  • How to download a list of URLs using a batch file in Windows and shell script in macOS.
    Download the batch file and script: www.marspremed...

Komentáře • 97

  • @SPM-96
    @SPM-96 Před rokem +4

    Tutorial helped me download 1300+ product images in 15 minutes, awesome! Thank you. Would have taken ages otherwise.
    Edit: I (Mac user) ran in to the issue of the "URL using bad/illegal format" at first, i think it was because i copied the URL's from a Excel sheet to .txt file.
    After that i copied the URL's in to a new Visual Studio Code file, and then copied the url's from VSC to the .txt file. Now the shellscript would run.
    Not sure why it would work after those steps, but hope it helps someone out having the same issue.

    • @wc7
      @wc7  Před rokem +2

      That's what I like to hear. Always happy when I make someone more productive. About the error, it's the line endings. Happens when the text file has Windows line ends, carriage return + line feed. Macs are weird... legacy Mac stuff uses carriage return only, but now based on Unix since OSX, the underlying system uses line feed only. Kind of a mess. On a Mac best way to make sure it works perfect is use TextEdit in plain text mode. Or use terminal and pico. Then text files work in shell scripts on Mac always. Thanks for watching.

    • @all_in_one9084
      @all_in_one9084 Před 7 dny

      @@wc7 how to download csv file from any website automatically on scheduled time

  • @user-li7db5dl8d
    @user-li7db5dl8d Před 9 měsíci +2

    Thank you so much for your help William Campbell. Really like your detailed explanation and clarity, anyone could understand it.

  • @noelmeder6067
    @noelmeder6067 Před 3 měsíci +1

    Worked, saved me a lot of time. Thank you William

  • @gayathridevi1127
    @gayathridevi1127 Před 2 měsíci +1

    Excellent sir, it worked for me too. Thank you William.

  • @rachitashahi
    @rachitashahi Před 2 měsíci +1

    Thank you! it saved so much of my time.

  • @lightsense
    @lightsense Před 5 měsíci +1

    Thank you very much! Huge time saver!

  • @JamminJosh7
    @JamminJosh7 Před rokem +1

    You sir are a humble genius! Thanks

  • @HazDillegger
    @HazDillegger Před 11 měsíci +1

    Thank you very much from Holland!

  • @jeffreyvitale2510
    @jeffreyvitale2510 Před rokem +1

    William I cannot thank you enough !!! But I will try: many many many many ..... ...... many many thanks !!! Jeff

    • @wc7
      @wc7  Před rokem

      Great to hear. That makes effort worthwhile. Thanks for watching.

  • @jonathanfior1867
    @jonathanfior1867 Před 19 dny

    does not work, files are not in the folder. gives this error "curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed). More detail may be available in the Windows System event log. curl: (6) Could not resolve host: pause"

  • @nocode659
    @nocode659 Před rokem +2

    Hi , I have list of psd files( Photshops files) in a folder. i need to replace the text of each psd file with the data present in excel and save it.. Can you please help

    • @wc7
      @wc7  Před rokem +1

      I have another script that might help. It had a different purpose originally, but I think what it does might work for your situation. Have a look at the video, then download and see if it works for you. czcams.com/video/NH9bYHnlUUk/video.html

  • @neutralarchive137
    @neutralarchive137 Před 8 měsíci +1

    I'm having the issue that every image is just titled "image", so they are just all overwriting each other. Anyway to get past that? Otherwise would have worked beautifully!

    • @wc7
      @wc7  Před 8 měsíci +1

      I'm not sure if it's something the server is doing or the choice of precise command when accessing the particular server. There might be a way around it with tweaks to the command syntax, but I'm not sure the details. If I'm not mistaken another user posted a comment about it. They had the same problem but found a solution. Look through the comments.

    • @neutralarchive137
      @neutralarchive137 Před 8 měsíci

      @@wc7 Thank you I will take a look through the comments then! Very appreciated

    • @neutralarchive137
      @neutralarchive137 Před 8 měsíci

      @@wc7 Having this as my code in the download.sh did the trick! counter=1
      while read -r url; do
      curl -O "$url" && mv "$(basename "$url")" "image_$((counter++)).jpg"
      done < list.txt

    • @XFreezX
      @XFreezX Před 6 měsíci

      @@neutralarchive137 found a solution for this? thanks

  • @hgraphik
    @hgraphik Před rokem +2

    i like it, Thanks

    • @wc7
      @wc7  Před rokem +1

      Thanks for watching.

  • @capone303
    @capone303 Před 9 měsíci +1

    Huge time saver thank you

  • @samirawati1975
    @samirawati1975 Před 5 měsíci +1

    thank you sir.... gr8.... thanks again

  • @superspiegi7098
    @superspiegi7098 Před rokem +2

    Thank you very much!!!

    • @wc7
      @wc7  Před rokem +1

      You're welcome. Thanks for watching.

  • @minpisarn01
    @minpisarn01 Před rokem +1

    It's help me save a ton of man-hour, thank you!

    • @wc7
      @wc7  Před rokem

      Great to hear. Thanks for watching.

  • @jerichovitug3603
    @jerichovitug3603 Před rokem +1

    It works but I can't open the image it says unsupported 😢 pls help

    • @wc7
      @wc7  Před rokem

      Do the files have extensions? If so, what is the extension? If not, try adding one, .jpg for example. If that doesn't work try .png. What is telling you "unsupported"?

  • @gabrielborensztejn2328
    @gabrielborensztejn2328 Před rokem +1

    Thank you, you save my life

  • @He-Is-One-and-Only
    @He-Is-One-and-Only Před rokem +1

    Good information ℹ️👍🏻👍🏻

    • @wc7
      @wc7  Před rokem

      Thanks

  • @DaviCamelier
    @DaviCamelier Před 10 měsíci +1

    You save me! Thank you!

  • @bharamappabandak9226
    @bharamappabandak9226 Před rokem +2

    👌👌

    • @wc7
      @wc7  Před rokem +2

      Thanks.

    • @bharamappabandak9226
      @bharamappabandak9226 Před rokem

      @@wc7give me your whatsup number sir

    • @wc7
      @wc7  Před rokem +1

      @@bharamappabandak9226 I don't do Whatsup or others like it. For me email works fine for decades now. Get me on my website and I'll reply via email: www.marspremedia.com/contact/

  • @rahulmodi94
    @rahulmodi94 Před 9 měsíci +1

    amazing tutorial.

  • @tomgoebel6479
    @tomgoebel6479 Před 6 měsíci +1

    thank you so so much! :)

  • @KerileeDavidson
    @KerileeDavidson Před rokem +1

    I have a long list of pdf files. I tried to follow these instructions and didn't get any pdf files. Is there a different code for pdf file types?

    • @wc7
      @wc7  Před rokem

      Nothing special for different file types. If a URL works in a browser, it should work in a batch/script file also. Check one of the URLs. Paste in a browser. What happens?

  • @farhingul929
    @farhingul929 Před 8 měsíci

    Its not working for me. On double clicking the bat file, it blink and disappear and nothing happened.

  • @alancelaya3123
    @alancelaya3123 Před 9 měsíci

    thanks for the tutorial...as a mathematician I am trying to cope my current knowledge with computer programing and data analysis so which computer languages do you recommend me to learn?

    • @wc7
      @wc7  Před 9 měsíci

      I'm not a mathematician so I couldn't say the best computer languages for that. Personally I love JavaScript but I imagine there are better languages for dealing with math. I also like C and flavors of it (C++, C#).

  • @muhamadchozin6783
    @muhamadchozin6783 Před 8 měsíci

    Mine isn't working. It gives a single file output named "export," and it contains text like "Temporary Redirect. The document has moved here." Do you have any ideas regarding this issue?

    • @wc7
      @wc7  Před 8 měsíci

      It's the server's response. Nothing you can do about it at this end that I'm aware of.

  • @ShinyDuckFish
    @ShinyDuckFish Před rokem +1

    Hello, thank you for the tutorial. For some reason, when I attempt to run my .bat file I am told, "The revocation function was unable to check revocation for the certificate." Do you know a fix for this? Thank you in advance.

    • @wc7
      @wc7  Před rokem

      Has to do with the server SSL certificate check. Search web for the error message there are many results. If possible use http non-secure if possible instead of https. Not really anything different can be done in batch file that I am aware of. It's a restriction at the server hosting the files.

  • @deepikaanagesh7181
    @deepikaanagesh7181 Před 11 měsíci +1

    Thanks a lot.

  • @rafaelmarzliak
    @rafaelmarzliak Před 5 měsíci +1

    thanks so much

  • @kamalkishor5737
    @kamalkishor5737 Před rokem

    Hello, and thank you for the tutorial. Can be downloaded with the original image extensions because images have different types of extensions (not fixed extensions).

    • @wc7
      @wc7  Před rokem

      Images download with whatever extension they have. If it's not the right extension, there isn't any way for a script or other method to know or change that.

  • @lestarisab
    @lestarisab Před 10 měsíci

    It helps a lot, thank you🙂

  • @w42st38
    @w42st38 Před 10 měsíci

    Thanks for this. I had a list of 200 jpg files in Jotform from a survey we've recently done. The script worked great, worked out some problems with " marks... but all the JPG files are there, but zero bytes. Any thoughts/solution, please? Phil

    • @w42st38
      @w42st38 Před 10 měsíci

      In the end, I used this command and it worked.
      xargs -n1 curl -LO --remote-name < list.txt
      The -LO did something smart to follow redirects, apparently. I'm not a coder...

  • @ShivamSHARMA-fn6yy
    @ShivamSHARMA-fn6yy Před rokem +1

    thanks a lot

  • @MuhammadAtteia
    @MuhammadAtteia Před 8 měsíci

    Can I use this method to download videos instead of images?

    • @wc7
      @wc7  Před 8 měsíci +1

      I don't know. Try and find out. It may try to play them, not sure.

  • @ivanvulev674
    @ivanvulev674 Před rokem

    Doesn't work with me. I do everything as shown and 2-3 minutes after I start download.bat it automatically closes without downloading anything. My list is 800+ URLs. Could that be the problem?

    • @wc7
      @wc7  Před rokem

      The number of URLs is likely OK. Probably something else is wrong. Add to the batch file "pause" command at the end, so the screen stays open to show any error messages. Sometimes the error could be the server and there's nothing different you can do. Some servers block this kind of download.

  • @TNAzeroblast
    @TNAzeroblast Před 10 měsíci

    Hi, thanks a lot. But when I try on my Mac I get this:
    curl: (23) Failed writing received data to disk/application
    curl: Remote file name has no length!
    My OS is Sonoma 14.0

    • @wc7
      @wc7  Před 10 měsíci

      Check that -O argument is the capital letter O ("oh") not a zero.

  • @AmadeAlexandrino
    @AmadeAlexandrino Před rokem +1

    thanks worked

  • @agushocky5656
    @agushocky5656 Před 7 měsíci

    Hi, thanks a lot for this tutorial, I did manage to get the files downloaded, however, I got incomplete files and corrupted. The files are only 5kb in size, while I knew such files are over 150kb in size. Is there a solution to this issue. Thank you.

    • @wc7
      @wc7  Před 7 měsíci

      I have no answer for corrupt downloads. Problems like that are beyond this solution.

    • @agushocky5656
      @agushocky5656 Před 7 měsíci

      @@wc7 noted on this. Thank you Sir 😊

  • @aroojfatima5951
    @aroojfatima5951 Před 11 měsíci

    curl: Failed to extract a sensible file name from the URL to use for storage!
    curl: (3) URL using bad/illegal format or missing URL

    • @wc7
      @wc7  Před 11 měsíci

      Sounds like a bad URL. What happens if you paste the same URL in a browser address bar? Also some URLs the server prevents downloading in this manner. Nothing you can do about that.

  • @andreaemme992
    @andreaemme992 Před rokem

    Hi, thanks a lot. I need to do two more things:
    1) rename the saved files with a number (the number of the url's lines in the txt file should be fine)
    Better but more complicated solution:
    2) if possible, grab urls from a list of html files (each html file has one url, always on he line 299. All html files are in the same folder and have a number as name). Maybe i could convert html files in txt files, but i have no idea how to say in DOS commands "take the url on the 299 line of file "1” and download naming the file as "video_1, take the url on the 299 line of file "2" and download naming the file as "video_2", and so on. Can you help me?
    Ps: if option 2 is viable, i have to say that line 299 has other code written before the url i have to grab!
    Thanks a lot

    • @wc7
      @wc7  Před rokem

      The technique used in the video isn't going to work on HTML files like you describe. You would need to manipulate the HTML first to make text files with the lines wanted (many ways to do this beyond scope of this video). About adding a number to the output name, I don't know of a way in this context. The -O command of CURL makes the saved file named the same as the remote file. There's no way (that I know) to load this into a variable so an incrementing number could be added. But if adding a number is all that is needed, there are plenty of tools to do that. Personally I use "Better File Rename" for this and many other daily batch file re-naming needs: www.publicspace.net/windows/BetterFileRename/

  • @jellybuster2887
    @jellybuster2887 Před rokem

    I get an warning message "File name too long" and it didn't download most files. Is there a way for this?

    • @wc7
      @wc7  Před rokem

      Use a shorter path to where the files are saved.

  • @batumikeespoir652
    @batumikeespoir652 Před rokem

    Am using Windows, it works but all my files are having 1 KB as file size, please help

    • @wc7
      @wc7  Před rokem

      It's the host and/or the URL. The host is sending back the asset at the request in the URL.

  • @kuplramontop6772
    @kuplramontop6772 Před rokem

    I failed to batch download from list of google drive files, why is that? is it because google drive prevent batch downloading like this?

    • @wc7
      @wc7  Před rokem

      Most likely yes. You probably need to be logged in to access Google drive. Might work if a browser is logged in, but not for sure. Likely the batch file/shell script would have to authenticate with Google. That's beyond the scope of this solution.

    • @kuplramontop6772
      @kuplramontop6772 Před rokem

      @@wc7 ok thankyou for the reply

  • @jpvr1210
    @jpvr1210 Před 9 měsíci

    Anyone know what would be needed if I wanted to change the names of the files which currently have the URL as names?

    • @wc7
      @wc7  Před 9 měsíci

      Rename the files after downloading them? Try Better Finder Rename (or Better File Rename for Windows)

  • @heihitesh
    @heihitesh Před rokem

    Hi, Thank you for this video, but this is NOT working for me idk
    I have a win 11 PC, It did download the files, but all are unsupported
    extesnion is .jpg, but all the files have size of 1KB
    Please check

    • @wc7
      @wc7  Před rokem

      Likely it's the host not anything you're doing. They probably don't want users downloading their assets directly. There's nothing different I could do to make it work.

  • @christojosegeorge5092

    Hi, will it work for music files from youtube music

    • @wc7
      @wc7  Před rokem

      I don't know, never tried. If you have URLs to the files, it should work. If not, the answer is no, it won't work. The solution uses URLs to get files.

  • @shreyamishra3175
    @shreyamishra3175 Před rokem

    How to use it to download audio files ? Kindly help

    • @wc7
      @wc7  Před rokem +1

      Same steps should work for any file type as long as the host has file extensions on them.

    • @shreyamishra3175
      @shreyamishra3175 Před rokem +1

      @@wc7 Thank you sir!

  • @alapas
    @alapas Před rokem

    don"t work windows 11 here

    • @wc7
      @wc7  Před rokem

      Works fine Windows 11. Make sure run on local drive. DOS commands in batch file won't work on network share. Add "pause" to end of batch file so window doesn't close then can see errors.

  • @djwodzirejshowmansylviokwi4404
    @djwodzirejshowmansylviokwi4404 Před 10 měsíci +1

    I am sorry but this is another useless tip. I have to download a several thousands of files. Legal files dont worry. I need some trick without urls copying, or some smart trick to extract a few thousands of urls which are hided under a few thousands of little download icons. DO You know how to do it?

    • @wc7
      @wc7  Před 10 měsíci

      No I do not know how to do it. Search for "web scraping". That's what you want and it's beyond this topic of simple URL download.

  • @Fishbone4u
    @Fishbone4u Před rokem

    ⚠🚫⁉ William Campbell -----> My image URLs are from Facebook. It looks like my list is downloading but I end up with a single "photo.php" file in my directory. FB apparently uses .php in the image's full URL. Any idea how to fix this?! Thanks and great video!

    • @wc7
      @wc7  Před rokem

      The URLs are not to image assets rather to the the Facebook photo viewer PHP app, and then each URL provides a request (part after ?, and more after &) for the particular image. The only way to download photos this way is to click each URL then the three dots to choose "download". There's no way I know of to automate with a batch or shell script. Anyone else with experience can chime in.

  • @harishbabu674
    @harishbabu674 Před rokem +2

    Very helpful William you are a great , you made it so quickly and its tutorial is very very very helpful, Anyway, I appreciate your response a lot today.I just looked it up just now . I'll download and give it a try
    Anyway I can personally contact you on your e-mail
    Thank you

    • @wc7
      @wc7  Před rokem +2

      Glad you like it. Thanks for watching.

  • @natanteam
    @natanteam Před 28 dny

    for /f "tokens=*" %%a in (list.txt) do curl -O %%a