Welcome to Music-Scraper’s documentation!

Music-Scraper

https://badge.fury.io/py/music_scraper.svg Code Health\\

Download all your favourite songs from the web at one place. No more searching through the links given by Google Search, Music-Scraper does it for you.

Requirements

  • python>=2.7
  • Scrapy>=1.1.1

Getting Started

Ensure that you have setuptools>=24.0.3 installed for proper installation of music_scraper. Installation of setuptools can be done with

pip install setuptools==24.0.3

Install Music-Scraper from pip directly

pip install music_scraper

Or

Clone this repository to get started.

git clone https://github.com/srivatsan-ramesh/Music-Scraper.git
cd Music-Scraper/

And install it.

python setup.py install

You can also install it for development.

python setup.py develop

If Scrapy installation creates some problem refer this link.

How to Use

Type ‘music-scraper’ in the terminal and type in a query which can give audio files in Google Search. For example ‘kabali songs download’.

How to Contribute

Read the docs for API reference from here. If you could think of any improvements for the project feel free to make a PULL REQUEST.

Contents:

API Reference

class music_scraper.gui.GUI[source]

A static class containing attributes to control the GUI process of the app

Attributes:
screen:The maximum speed that such a bird can attain.
status:The locale where these birds congregate to reproduce.
strings:The list of song names, scraped from the web
size_dict:Dictionary mapping file names to size of file.
url_dict:Dictionary mapping file names to url of file.
pages:Total number of pages required to display the song list.
page:current page number
position:current highlighted song name.
max_row:Maximum number of rows that can be displayed in the terminal window.
row_num:Total number of rows required.
box:Box object which is drawn on the screen with curses
high_light_text:
 curses color of highlighted text.
normal_text:Normal text color.
key:current pressed key value.
run_download:Used to indicate an ongoing download
gui_stopped:Used to indicate whether GUI is on or off
message:The message or query passed to scrapy and got as input from user
static add_bottom_menus()[source]

Adds the bottom menu Exit and Download

static display_list()[source]

Displays the list of song names scraped from web.

static download_item()[source]

It downloads the song from the url and saves it in the file.

static get_input()[source]

Loops till user types a non empty query :return: The user inputted query.

static init_display()[source]

Inits the display GUI

static my_raw_input(r, c, prompt_string)[source]

Gets input on the screen :param r: y coordinate :param c: x coordinate :param prompt_string: The prompt string :return: The input string

static on_key_down()[source]

Called when down arrow is pressed

static on_key_enter()[source]

Called when enter key is pressed. It starts the download process in a new thread

static on_key_left()[source]

Called when left arrow key is pressed.

static on_key_right()[source]

Called when right arrow key is pressed.

static on_key_up()[source]

Called when up arrow key is pressed.

static refresh_values()[source]

Refresh the parameters when the size of list changes in display

static update_on_key()[source]

Loops to get a key input and updates the screen accordingly

static update_screen()[source]

Updates the screen each time a key is pressed.

class music_scraper.threads.DownloadThread(func)[source]

A thread used for downloading Audio files

Parameters:func – The function that is run in the thread.
class music_scraper.threads.GUIThread(process, func)[source]

A thread used to run GUI in parallel

Parameters:
  • process (CrawlerProcess) – Process of Scrapy that scrapes the Web for songs
  • func – The function to run when the thread is started.

Indices and tables