Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform refactor: Decoupling spotify, Adding scaffolding for youtube #10

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,6 @@ config*
.\#*

# venv
*secret*
client.json
# samplify/
47 changes: 24 additions & 23 deletions README.md → README.org
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Samplify
* Samplify
Retrieve the samples from any playlist / album / song / search.

## Getting Started
Setup TLDR;
Setup TLDR;
```
git clone https://github.com/qzdl/samplify.git && cd samplify && venv samplify && source samplify/bin/activate && pip -r requirements.txt
```
Expand All @@ -20,8 +19,8 @@ If you haven't used the spotify API before:
- Setup a redirect as `http://localhost:<SOME_FREE_PORT>`
* This can be found in the information page of a registered application > edit settings.
- Create `config.py` at the root of the repository, and populate it as follows:
(NOTE: these are not valid credentials )
```
(NOTE: these are not valid credentials)
#+BEGIN-SRC
# ClientID from registered application at:
https://developers.spotify.com/dashboard/applications
client = '7bf224e8jn954215s3g11degh599e3an'
Expand All @@ -38,13 +37,16 @@ username = '1134745600'
# setup this redirect on a registered application. make sure it
# is identical to the letter or you'll get "INVALID REDIRECT"
redirect = 'http://localhost:8889'
```
#+END-SRC

** Usage

[[file:docs/spotify_cap.png][train of thought, generated by samplify]]

## Usage
![Playlists created by the tool](./docs/spotify_cap.png)

## Documentation
### Command Line Interface `CLI`
** Documentation
*** Command Line Interface `CLI`
Detail about the CLI can be found by reading the documentation provided by the `--help`
option flag. Documentation will but updated there as the project progresses.
```
Expand Down Expand Up @@ -123,22 +125,21 @@ It's a New Day skull snaps
Created playlist SAMPLIFY: Uptown Saturday Night
```

** Program Overview
Playlists are read from Spotify through the Spotify API using Spotipy.
Song names and artists are stored and then located on `Whosampled.com`.

## Program Overview
Playlists are read from Spotify through the Spotify API using Spotipy.
Song names and artists are stored and then located on `Whosampled.com`.

A request is sent to the site searching for the song name, selecting a result
with the matching artist name and storing the link to that song's page. A second
request is sent to that song page, and BeautifulSoup is used to scrape HTML for
A request is sent to the site searching for the song name, selecting a result
with the matching artist name and storing the link to that song's page. A second
request is sent to that song page, and BeautifulSoup is used to scrape HTML for
sample names, which are also stored.

Next, the samples are located using Spotipy, if they exist. Finally, a new
Next, the samples are located using Spotipy, if they exist. Finally, a new
playlist is created for the user, containing all the samples available on Spotify.

## Example Route Parsing
Discovering how payloads differ to extend the functionality to albums, current song,
etc, is a process that requires some exploration. I'm sure there's examples of that
Discovering how payloads differ to extend the functionality to albums, current song,
etc, is a process that requires some exploration. I'm sure there's examples of that
in the commit history.
```python
album = None
Expand All @@ -160,10 +161,10 @@ for track in tracks:
print(json.dumps(track_info, indent=2))
```

## Attribution
** Attribution
This project is based on the work of [Christopher Pease (cpease00)](https://github.com/cpease00/)'s sample collection tool [Spotify-Samples](https://github.com/cpease00/).
Without his [medium article](https://medium.com/@chris.m.pease/automating-finding-music-samples-on-spotify-with-whosampled-54f86bcda1ee) on the topic, it would have been much more painful to produce the project as it is now.

### `Options()`
### `Samplify()`
### `Scraper()`
*** `Options()`
*** `Samplify()`
*** `Scraper()`
64 changes: 46 additions & 18 deletions examples/album_93-til-infinity_souls-of-mischief

Large diffs are not rendered by default.

56 changes: 40 additions & 16 deletions examples/album_body-of-the-life-force_afu-ra

Large diffs are not rendered by default.

76 changes: 48 additions & 28 deletions examples/album_dead-serious_das-efx

Large diffs are not rendered by default.

398 changes: 394 additions & 4 deletions examples/album_dogg-food_the-dogg-pound

Large diffs are not rendered by default.

26 changes: 18 additions & 8 deletions examples/album_even-in-darkness_dungeon-family

Large diffs are not rendered by default.

88 changes: 63 additions & 25 deletions examples/album_moment-of-truth_gang-starr

Large diffs are not rendered by default.

72 changes: 50 additions & 22 deletions examples/album_resurrection_common

Large diffs are not rendered by default.

66 changes: 47 additions & 19 deletions examples/album_the-lp_large-professor

Large diffs are not rendered by default.

62 changes: 45 additions & 17 deletions examples/album_train-of-thought_reflection-eternal

Large diffs are not rendered by default.

38 changes: 27 additions & 11 deletions examples/album_uptown-saturday-night_camp-lo

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions notebooks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import sys
sys.path.append('../')
281 changes: 281 additions & 0 deletions notebooks/youtube-api.ipynb

Large diffs are not rendered by default.

Loading