Git Product home page Git Product logo

macroscraper's Introduction

MacroScraper

MacroScraper logo

Table of content


What is MacroScraper?

MacroScraper is a web Scraper for Bandcamp music. It is a Python script that will download all the free music from a Bandcamp artist page, album after album, in your Music directory.


Where does it come from?

Macroblank Bandcamp banner

MacroScraper is a project I made for my personal use. I wanted to download all the music from a Bandcamp artist page named Macroblank. I didn't want to download the music one by one so I decided to make a script that would do it for me. That is why the script is named MacroScraper.


How does it work?

The script will use the Selenium library to open a Chrome browser. It will then navigate to the Bandcamp artist page and click on the "Download" button of each album. The script will then repeat the process for each album.

Each album will be downloaded in a separate folder. The folder will be named after the album name. The album will be downloaded in a .zip file then extracted in the folder with the same name as the album.

Saving data

It will create a .csv file with the name of the artist and the name of the album. The file will contain the following information:

  • Album name
  • Album URL
  • Album release date
  • Album genre
  • Album tracklist

It will also create a .txt file with the name of the artist and the name of the album. The file will contain the following information:

  • Download date
  • Album name
  • Artist name
  • Album tracklist

The project will download the music in yout Music folder. It will create a folder named MacroScraper and then create a folder named after the artist's name. The folder will contain all the albums downloaded as zip files, the .csv and .txt files.

Why do I want to stock data?

I wanted to keep track of the music I downloaded. I also wanted to keep track of the albums I downloaded and the date I downloaded them so I could know if I already downloaded an album or not.

I like data processing so i'd like in the future to make a script that would read the .csv file and make graphs and statistics about the music I downloaded.

Directory structure

Music   
.
|___ MacroScraper
    |___ Artist1
        |___ Album1
        |___ Album2
        |___ ...
        |___ Zips
    |___ Artist2
        |___ Album1
        |___ Album2
        |___ ...
        |___ Zips
    |___ ...

How to use it?

This script will ask you to enter the artist name's album you want to download.

It is planned to make a GUI for the script. For now, it is a command line script.

Just let it do the job. It will take a while depending on the number of albums the artist has.

Usage

  • Run the script with python main.py
  • Enter the name of the artist in the terminal.
  • Wait for the script to finish.
  • Retrieve the music in your Music folder.

Installation

Prerequisites

You'll need Docker to be installed. Go to theiur website to download Docker. Then verify Docker has been correctly installed by running the following command in your terminal:

docker --version

If you get an error, it means Docker is not installed. If you get a version of Docker, it means you are ready to continue.

Thanks to Docker, you won't need to install Python on your machine. You'll just have to follow the next steps.

Installation of MacroScraper

  1. Download the project archive on the GitHub repository

  2. Unzip the archive

  3. Open a terminal in the unzipped folder

  4. Run the following commands:

    docker build -t macro .
    docker run -it macro

What do these commands do?

  • docker build -t macro . : Build the Docker image from the Dockerfile present in the current folder. The -t option allows to give a name to the Docker image. Here, we give the name macro to the image.
  • docker run -it macro : Run a container from the macro image. The -it option allows to run the container in interactive mode. This allows to see the application logs in the terminal. This command executes the main.py file which launches the application.

For more information about Docker, you can consult the official documentation of Docker.


How to contribute?

I develop the MacroScraper alone: you can check more of my stuff here. I welcome both pull requests and issues on GitHub. I will review your pull request as soon as possible.

Thank you for your interest in MacroScraper!


License

MacroScraper is licensed under the [Apashe 2.0 License].

macroscraper's People

Contributors

loisglld avatar dependabot[bot] avatar

Stargazers

 avatar Giel Janssens avatar

Watchers

Kostas Georgiou avatar  avatar

macroscraper's Issues

Error

Hi, wondering if you might be able to assist as to why this is not working for me on Mac Silicon:
Also, is there a way to have the program run in English?

IL EST IMPORTANT D'ECRIRE EXACTEMENT LE NOM DE L'ARTISTE
Entrez le nom de l'artiste: artist
Traceback (most recent call last):
File "/app/./src/Main.py", line 29, in
macroScraper = MacroScraper(logs)
^^^^^^^^^^^^^^^^^^
File "/app/src/MacroScraper.py", line 35, in init
self.WD = WorkingDirectory()
^^^^^^^^^^^^^^^^^^
File "/app/src/WD.py", line 35, in init
self.path = os.path.join(os.environ['USERPROFILE'], "Music\MacroScraper\")
~~~~~~~~~~^^^^^^^^^^^^^^^
File "", line 679, in getitem
KeyError: 'USERPROFILE'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.