A simple Node.js script to scrape and download MP3 files from a website using Puppeteer and X-ray.
Make sure you have Node.js installed on your system. You can download it from here.
-
Open a terminal or command prompt.
-
Install Chromium if it is not already installed. You can install by running:
sudo apt install chromium-browser
Install Chromium if it is not already installed. Add Chromium's executable path to the system environment variables. You can follow this Guide to learn how to add a new path to the system environment variables. The path should look like: C:\path\to\Chromium\chrome.exe.
If Chormium is not installed, follow the installation instructions on the Chromium website.
- Clone the repository and navigate to the project folder:
git clone https://github.com/esraell/mp3-scraper.git
cd mp3-scraper
- Install the required dependencies:
npm install
-
Open the
scrape.js
file in your favorite code editor. -
Modify the
URL
variable at the top of the file to the URL of the webpage containing the MP3 file you want to download.
const URL = 'https://www.example.com/your-target-webpage';
-
Save the changes to the
scrape.js
file. -
Run the script using the following command:
node scrape.js
The script will scrape the specified URL for an MP3 file, download it, and save it with the same name as in the URL.
If you encounter any issues, make sure you have the latest version of Node.js installed and that all dependencies are installed correctly. If problems persist, feel free to open an issue on the GitHub repository.