OpenSource-Hub

Website-downloader

アプリケーション

AhmadIbrahiim/Website-downloader

Node.jsを使用して、完全なWebサイトのソースコードとすべてのリソースをダウンロードします。

概要

このアプリケーションは、JavaScript、CSS、画像などのすべてのリソースを含む、任意のウェブサイトの完全なソースコードをユーザーがダウンロードできるようにします。wgetとarchiverを利用してウェブサイトをミラーリングおよび圧縮し、socketチャネルを通じて送り返します。複数のクラウドプラットフォームへのワンクリックデプロイをサポートしています。

README プレビュー

## Complete Website Downloader 💾\nDownload the complete source code of any website (including all assets) 🔨.\n\n👉 Live Demo: https://website-downloader.onrender.com\n\n\n\n\n  \n\n\n\n## Description 📒\n Website downloader works with `wget` and `archiver` to download all websites assets and compress then sends it back to the user through socket channel\n \n **wget params the being used**\n \n `wget --mirror --convert-links --adjust-extension --page-requisites \n--no-parent http://example.org`\n\n **Explanation of the various flags:**\n\n - --mirror – Makes (among other things) the download recursive.\n- --convert-links – convert all the links (also to stuff like CSS stylesheets) to relative, so it will be suitable for offline viewing.\n- --adjust-extension – Adds suitable extensions to filenames (html or css) depending on their content-type.\n- --page-requisites – Download things like CSS style-sheets and images required to properly display the page offline.\n- --no-parent – When recursing do not ascend to the parent directory. It useful for restricting the download to only a portion of the site\n### Deploy on cloud providers\n[](https://replit.com/github/AhmadIbrahiim/Website-downloader)\n[](https://glitch.com/edit/#!/import/github/AhmadIbrahiim/Website-downloader)\n[](https://railway.app/new/template?template=https://github.com/AhmadIbrahiim/Website-downloader)\n[](https://app.cyclic.sh/api/app/deploy/AhmadIbrahiim/Website-downloader)\n[](https://app.koyeb.com/deploy?type=git&repository=github.com/AhmadIbrahiim/Website-downloader&branch=main&name=Website-downloader)\n[](https://render.com/deploy?repo=https://github.com/AhmadIbrahiim/Website-downloader)\n\n\n## How to run it 🤔\n\n- `git clone https://github.com/AhmadIbrahiim/Website-downloader.git`\n- `cd Website-downloader`\n- `$ npm install`\n- `$ npm start`\n- `http://localhost:3000/`\n\n\n\n# How To Contribute:\n - Open Issue(s) with any bugs you notice.\n - Please create Pull Requests if you think it would

FAQ (2)

トラブル対応
ローカルでウェブサイトダウンロード機能を実行した際に「'wget' is not recognized as an internal or external command」というエラーが発生する場合の修正方法

ダウンロード機能にはGNU Wgetが必要ですが、システムのPATH上に存在しないか、利用できない状態です。Windowsでは、winget install JernejSimoncic.Wget または choco install wget のいずれかでWgetをインストールしてください。更新されたPATHが読み込まれるようにターミナルまたはIDEを再起動してから、wget.exe --version を実行してインストールを確認してください。その後、ローカルのダウンロード機能が正常に動作するはずです。

参照 Issue #102
トラブル対応
Website-downloaderが作成した巨大な削除済み.zipファイルが、ユーザーがページを閉じてもディスク容量を解放しない問題を修正するにはどうすればよいですか?

Node.js プロセスが削除された .zip ファイルへのオープンなファイルディスクリプタを保持し続けているため、ディスク容量が解放されません。スタックしているプロセスを特定します:

sudo lsof +L1 | grep '\.zip (deleted)'

次のような出力が表示されます:

node 270102 root 20w REG ... /www/wwwroot/Website-downloader/public/sites/.zip (deleted)

ダウンロードまたはウェブサイトサービスを一時停止してから、スタックしているプロセスを停止します:

sudo kill -9 270102

削除された ZIP ファイルを保持しているすべての Node プロセスを終了するには:

sudo lsof +L1 | awk '/node/ && /\.zip \(deleted\)/ {print $2}' | xargs -r sudo kill -9

容量が解放されたことを確認します:

df -h

恒久的な修正として、issue #74 を修正するプルリクエストを含むリリースに Website-downloader を更新してください。このパッチは、クライアントが切断した際にダウンロードストリームを中止または破棄し、一時 ZIP ファイルを削除し、URL 取得のリトライループが継続しないようにする必要があります。更新後に Node サービスを再起動します。例:

pm2 restart all
# または
sudo systemctl restart <your-website-downloader-service>

参照 Issue #74