search

Home  >  Q&A  >  body text

javascript - How to remove this suffix when saving this web page?

I open bilibili and then use ctrol s to save all the resources of this webpage, but the local files have many extra suffixes?
Should I manually remove them one by one? The chrome browser I use

Is there any way to avoid or modify it, or is there a better way to download web resources?

为情所困为情所困2715 days ago769

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-06-20 10:09:28

    I wrote a code for your file to help you process it. First create a php file in your folder, put the following code in it and run it once. Please accept and like it, thank you.

    <?php
        $dir="./";
        $file=scandir($dir);
        for ($i=0; $i < count($file); $i++) { 
            if (strpos($file[$i], "@")) {
                $arr = explode("@",$file[$i]);
                rename($file[$i], $arr[0]);
            }
            if (strpos($file[$i], ".下载")) {
                $arr = explode(".下载",$file[$i]);
                rename($file[$i], $arr[0]);
            }
        }
    ?>

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-06-20 10:09:28

    This should be because someone has configured a resource server. If you remove it before downloading, the image will no longer be found in the path. It can only be processed after downloading. You can use batch processing to modify the downloaded file name

    reply
    0
  • Cancelreply