Selectively download only .mov and .jpg files recursively from subfolders only (wget?, scripting?)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












Question about wget, subfolder, and index.html.



Let's say I am inside "travels/" folder and this is in "website.com": "website.com/travels/".



Folder "travels/" contains a lot of files and other (sub)folders: "website.com/travels/list.doc" , "website.com/travels/cover.png" , "website.com/travels/[1990] America/" , "website.com/travels/[1994] Japan/", and so on...



How can I download solely all ".mov" and ".jpg" that resides in all the subfolders only? I don't want to pick files from "travels/" (e.g. not "website.com/travels/list.doc")



I found a wget command (on Unix&Linux Exchange, I don't remember what was the discussion) capable of downloading from subfolders only their "index.html", not others contents. Why download only index files?










share|improve this question









New contributor




T. Caio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Hi @T. Caio would you please correct your link. it seems not the correct one!
    – Goro
    1 hour ago










  • Hi @Goro, what link should I correct? Sorry, I'm not english-speaker and I'm quite new to Linux
    – T. Caio
    1 hour ago











  • In the question you said Here on https://unix.stackexchange.com ... there is no question about wget in this link! you probably copy/paste the unix website link
    – Goro
    1 hour ago











  • So you would like to know how to download (only) images an videos from a website subfolders, is this correct?
    – Goro
    1 hour ago










  • @Goro Correct! The subfolders are more than one
    – T. Caio
    1 hour ago














up vote
3
down vote

favorite












Question about wget, subfolder, and index.html.



Let's say I am inside "travels/" folder and this is in "website.com": "website.com/travels/".



Folder "travels/" contains a lot of files and other (sub)folders: "website.com/travels/list.doc" , "website.com/travels/cover.png" , "website.com/travels/[1990] America/" , "website.com/travels/[1994] Japan/", and so on...



How can I download solely all ".mov" and ".jpg" that resides in all the subfolders only? I don't want to pick files from "travels/" (e.g. not "website.com/travels/list.doc")



I found a wget command (on Unix&Linux Exchange, I don't remember what was the discussion) capable of downloading from subfolders only their "index.html", not others contents. Why download only index files?










share|improve this question









New contributor




T. Caio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Hi @T. Caio would you please correct your link. it seems not the correct one!
    – Goro
    1 hour ago










  • Hi @Goro, what link should I correct? Sorry, I'm not english-speaker and I'm quite new to Linux
    – T. Caio
    1 hour ago











  • In the question you said Here on https://unix.stackexchange.com ... there is no question about wget in this link! you probably copy/paste the unix website link
    – Goro
    1 hour ago











  • So you would like to know how to download (only) images an videos from a website subfolders, is this correct?
    – Goro
    1 hour ago










  • @Goro Correct! The subfolders are more than one
    – T. Caio
    1 hour ago












up vote
3
down vote

favorite









up vote
3
down vote

favorite











Question about wget, subfolder, and index.html.



Let's say I am inside "travels/" folder and this is in "website.com": "website.com/travels/".



Folder "travels/" contains a lot of files and other (sub)folders: "website.com/travels/list.doc" , "website.com/travels/cover.png" , "website.com/travels/[1990] America/" , "website.com/travels/[1994] Japan/", and so on...



How can I download solely all ".mov" and ".jpg" that resides in all the subfolders only? I don't want to pick files from "travels/" (e.g. not "website.com/travels/list.doc")



I found a wget command (on Unix&Linux Exchange, I don't remember what was the discussion) capable of downloading from subfolders only their "index.html", not others contents. Why download only index files?










share|improve this question









New contributor




T. Caio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











Question about wget, subfolder, and index.html.



Let's say I am inside "travels/" folder and this is in "website.com": "website.com/travels/".



Folder "travels/" contains a lot of files and other (sub)folders: "website.com/travels/list.doc" , "website.com/travels/cover.png" , "website.com/travels/[1990] America/" , "website.com/travels/[1994] Japan/", and so on...



How can I download solely all ".mov" and ".jpg" that resides in all the subfolders only? I don't want to pick files from "travels/" (e.g. not "website.com/travels/list.doc")



I found a wget command (on Unix&Linux Exchange, I don't remember what was the discussion) capable of downloading from subfolders only their "index.html", not others contents. Why download only index files?







wget directory-structure recursive http download






share|improve this question









New contributor




T. Caio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




T. Caio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 1 hour ago





















New contributor




T. Caio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 1 hour ago









T. Caio

162




162




New contributor




T. Caio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





T. Caio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






T. Caio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • Hi @T. Caio would you please correct your link. it seems not the correct one!
    – Goro
    1 hour ago










  • Hi @Goro, what link should I correct? Sorry, I'm not english-speaker and I'm quite new to Linux
    – T. Caio
    1 hour ago











  • In the question you said Here on https://unix.stackexchange.com ... there is no question about wget in this link! you probably copy/paste the unix website link
    – Goro
    1 hour ago











  • So you would like to know how to download (only) images an videos from a website subfolders, is this correct?
    – Goro
    1 hour ago










  • @Goro Correct! The subfolders are more than one
    – T. Caio
    1 hour ago
















  • Hi @T. Caio would you please correct your link. it seems not the correct one!
    – Goro
    1 hour ago










  • Hi @Goro, what link should I correct? Sorry, I'm not english-speaker and I'm quite new to Linux
    – T. Caio
    1 hour ago











  • In the question you said Here on https://unix.stackexchange.com ... there is no question about wget in this link! you probably copy/paste the unix website link
    – Goro
    1 hour ago











  • So you would like to know how to download (only) images an videos from a website subfolders, is this correct?
    – Goro
    1 hour ago










  • @Goro Correct! The subfolders are more than one
    – T. Caio
    1 hour ago















Hi @T. Caio would you please correct your link. it seems not the correct one!
– Goro
1 hour ago




Hi @T. Caio would you please correct your link. it seems not the correct one!
– Goro
1 hour ago












Hi @Goro, what link should I correct? Sorry, I'm not english-speaker and I'm quite new to Linux
– T. Caio
1 hour ago





Hi @Goro, what link should I correct? Sorry, I'm not english-speaker and I'm quite new to Linux
– T. Caio
1 hour ago













In the question you said Here on https://unix.stackexchange.com ... there is no question about wget in this link! you probably copy/paste the unix website link
– Goro
1 hour ago





In the question you said Here on https://unix.stackexchange.com ... there is no question about wget in this link! you probably copy/paste the unix website link
– Goro
1 hour ago













So you would like to know how to download (only) images an videos from a website subfolders, is this correct?
– Goro
1 hour ago




So you would like to know how to download (only) images an videos from a website subfolders, is this correct?
– Goro
1 hour ago












@Goro Correct! The subfolders are more than one
– T. Caio
1 hour ago




@Goro Correct! The subfolders are more than one
– T. Caio
1 hour ago










1 Answer
1






active

oldest

votes

















up vote
5
down vote













This command will download only images and movies from a given website:



wget -nd -r -P /save/location -A jpeg,jpg,bmp,gif,png,mov http://www.somedomain.com


According to wget man:



-nd prevents the creation of a directory hierarchy (i.e. no directories).

-r enables recursive retrieval. See Recursive Download for more information.

-P sets the directory prefix where all files and directories are saved to.

-A sets a whitelist for retrieving only certain file types. Strings and patterns are accepted, and both can be used in a comma separated list (as seen above). See Types of Files for more information.


If you would like to download subfolders you need to use the flag --no-parent, something similar to this command:



wget -r -l1 --no-parent -P /save/location -A jpeg,jpg,bmp,gif,png,mov http://www.somedomain.com

-r: recursive retrieving
-l1: sets the maximum recursion depth to be 1
--no-parent: does not ascend to the parent; only downloads from the specified subdirectory and downwards hierarchy


Regarding the index.html webpage. It will be excluded once the flag -A is included in the command wget, because this flag will force wget to download specific type of files, meaning if html is not included in the list of accepted files to be downloaded (i.e. flag A), then it will not be downloaded and wget will output in terminal the following message:



Removing /save/location/default.htm since it should be rejected.





share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    T. Caio is a new contributor. Be nice, and check out our Code of Conduct.









     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470539%2fselectively-download-only-mov-and-jpg-files-recursively-from-subfolders-only%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    5
    down vote













    This command will download only images and movies from a given website:



    wget -nd -r -P /save/location -A jpeg,jpg,bmp,gif,png,mov http://www.somedomain.com


    According to wget man:



    -nd prevents the creation of a directory hierarchy (i.e. no directories).

    -r enables recursive retrieval. See Recursive Download for more information.

    -P sets the directory prefix where all files and directories are saved to.

    -A sets a whitelist for retrieving only certain file types. Strings and patterns are accepted, and both can be used in a comma separated list (as seen above). See Types of Files for more information.


    If you would like to download subfolders you need to use the flag --no-parent, something similar to this command:



    wget -r -l1 --no-parent -P /save/location -A jpeg,jpg,bmp,gif,png,mov http://www.somedomain.com

    -r: recursive retrieving
    -l1: sets the maximum recursion depth to be 1
    --no-parent: does not ascend to the parent; only downloads from the specified subdirectory and downwards hierarchy


    Regarding the index.html webpage. It will be excluded once the flag -A is included in the command wget, because this flag will force wget to download specific type of files, meaning if html is not included in the list of accepted files to be downloaded (i.e. flag A), then it will not be downloaded and wget will output in terminal the following message:



    Removing /save/location/default.htm since it should be rejected.





    share|improve this answer


























      up vote
      5
      down vote













      This command will download only images and movies from a given website:



      wget -nd -r -P /save/location -A jpeg,jpg,bmp,gif,png,mov http://www.somedomain.com


      According to wget man:



      -nd prevents the creation of a directory hierarchy (i.e. no directories).

      -r enables recursive retrieval. See Recursive Download for more information.

      -P sets the directory prefix where all files and directories are saved to.

      -A sets a whitelist for retrieving only certain file types. Strings and patterns are accepted, and both can be used in a comma separated list (as seen above). See Types of Files for more information.


      If you would like to download subfolders you need to use the flag --no-parent, something similar to this command:



      wget -r -l1 --no-parent -P /save/location -A jpeg,jpg,bmp,gif,png,mov http://www.somedomain.com

      -r: recursive retrieving
      -l1: sets the maximum recursion depth to be 1
      --no-parent: does not ascend to the parent; only downloads from the specified subdirectory and downwards hierarchy


      Regarding the index.html webpage. It will be excluded once the flag -A is included in the command wget, because this flag will force wget to download specific type of files, meaning if html is not included in the list of accepted files to be downloaded (i.e. flag A), then it will not be downloaded and wget will output in terminal the following message:



      Removing /save/location/default.htm since it should be rejected.





      share|improve this answer
























        up vote
        5
        down vote










        up vote
        5
        down vote









        This command will download only images and movies from a given website:



        wget -nd -r -P /save/location -A jpeg,jpg,bmp,gif,png,mov http://www.somedomain.com


        According to wget man:



        -nd prevents the creation of a directory hierarchy (i.e. no directories).

        -r enables recursive retrieval. See Recursive Download for more information.

        -P sets the directory prefix where all files and directories are saved to.

        -A sets a whitelist for retrieving only certain file types. Strings and patterns are accepted, and both can be used in a comma separated list (as seen above). See Types of Files for more information.


        If you would like to download subfolders you need to use the flag --no-parent, something similar to this command:



        wget -r -l1 --no-parent -P /save/location -A jpeg,jpg,bmp,gif,png,mov http://www.somedomain.com

        -r: recursive retrieving
        -l1: sets the maximum recursion depth to be 1
        --no-parent: does not ascend to the parent; only downloads from the specified subdirectory and downwards hierarchy


        Regarding the index.html webpage. It will be excluded once the flag -A is included in the command wget, because this flag will force wget to download specific type of files, meaning if html is not included in the list of accepted files to be downloaded (i.e. flag A), then it will not be downloaded and wget will output in terminal the following message:



        Removing /save/location/default.htm since it should be rejected.





        share|improve this answer














        This command will download only images and movies from a given website:



        wget -nd -r -P /save/location -A jpeg,jpg,bmp,gif,png,mov http://www.somedomain.com


        According to wget man:



        -nd prevents the creation of a directory hierarchy (i.e. no directories).

        -r enables recursive retrieval. See Recursive Download for more information.

        -P sets the directory prefix where all files and directories are saved to.

        -A sets a whitelist for retrieving only certain file types. Strings and patterns are accepted, and both can be used in a comma separated list (as seen above). See Types of Files for more information.


        If you would like to download subfolders you need to use the flag --no-parent, something similar to this command:



        wget -r -l1 --no-parent -P /save/location -A jpeg,jpg,bmp,gif,png,mov http://www.somedomain.com

        -r: recursive retrieving
        -l1: sets the maximum recursion depth to be 1
        --no-parent: does not ascend to the parent; only downloads from the specified subdirectory and downwards hierarchy


        Regarding the index.html webpage. It will be excluded once the flag -A is included in the command wget, because this flag will force wget to download specific type of files, meaning if html is not included in the list of accepted files to be downloaded (i.e. flag A), then it will not be downloaded and wget will output in terminal the following message:



        Removing /save/location/default.htm since it should be rejected.






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 39 mins ago

























        answered 1 hour ago









        Goro

        3,44241951




        3,44241951




















            T. Caio is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            T. Caio is a new contributor. Be nice, and check out our Code of Conduct.












            T. Caio is a new contributor. Be nice, and check out our Code of Conduct.











            T. Caio is a new contributor. Be nice, and check out our Code of Conduct.













             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470539%2fselectively-download-only-mov-and-jpg-files-recursively-from-subfolders-only%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            Long meetings (6-7 hours a day): Being “babysat” by supervisor

            Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

            Confectionery