Skip to content

Commit

Permalink
Merge branch 'master' of github.com:SwapnilSoni1999/spotify-dl
Browse files Browse the repository at this point in the history
  • Loading branch information
SwapnilSoni1999 committed Aug 17, 2021
2 parents 8c8227a + 9b59e54 commit e4a8a5c
Show file tree
Hide file tree
Showing 23 changed files with 741 additions and 284 deletions.
File renamed without changes.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/questions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Questions
about: Simply for Q&A purpose.
title: ''
labels: ''
assignees: ''

---

**Q:**
File renamed without changes.
50 changes: 50 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Configuration for probot-stale - https://github.com/probot/stale

# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60

# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 7

# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels: []

# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- pinned
- security
- "[Status] Maybe Later"

# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false

# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false

# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: false

# Label to use when marking as stale
staleLabel: wontfix

# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when removing the stale label.
# unmarkComment: >
# Your comment here.

# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
This issue has been automatically closed as stale due to lack of activity,
Please reopen if you think this needs to be
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30

# Limit to only `issues` or `pulls`
only: issues
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
*.mp3
.vscode/
Makefile
Makefile
.DS_STORE
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
FROM alpine
FROM buildkite/puppeteer

RUN apt update && \
apt install -y \
ffmpeg && \
rm -rf /var/lib/apt/lists/*

RUN npm install -g spotify-dl --unsafe-perm

RUN apk add \
npm \
ffmpeg
RUN npm install -g spotify-dl
## uncomment this for local testing
# COPY ./ /usr/local/lib/node_modules/spotify-dl/
WORKDIR /download
Expand Down
39 changes: 25 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ Get [FFMPEG](https://ffmpeg.org/download.html)

#### spotifydl

A simple commandline utility that allows you to download Spotify Songs,Playlist and Albums from Youtube.
A simple commandline utility that allows you to download Spotify Songs, Shows, Episodes, Playlists and Albums from Youtube.

PLEASE NOTE:
* The ability to find a video is dependent on the fact it is hosted on youtube, and even then there is a chance it is still incorrectly matched
* Some items may only be available to spotify premium users, please be sure to provide a username and password when this is the case

<hr>

Expand Down Expand Up @@ -67,21 +71,28 @@ $ spotifydl https://open.spotify.com/track/xyz
```

#### Options
| Flag | Usage |
| ---- | ------------------------------------------------------------ |
| -o | takes valid output path argument |
| --es | takes extra search string/term to be used for youtube search |
| --oo | enforces all downloaded songs in the output dir |
| --st | download spotify saved tracks |
| --sp | download spotify saved playlists |
| --sa | download spotify saved albums |
| -u | spotify username (only needed in non tty) |
| -p | spotify password (only needed in non tty) |
| -cf | takes valid output file name path argument |
| -v | returns current version |
| -h | outputs help text |
| Flag | Long Flag | Usage |
| ----- | ----------------- | --------------------------------------------------------------------- |
| --o | --output | takes valid output path argument |
| --es | --extra-search | takes extra search string/term to be used for youtube search |
| --oo | --output-only | enforces all downloaded songs in the output dir |
| --st | --saved-tracks | download spotify saved tracks |
| --ss | --saved-songs | download spotify saved shows |
| --sp | --saved-playlists | download spotify saved playlists |
| --sa | --saved-albums | download spotify saved albums |
| --u | --username | spotify username (only needed in non tty) |
| --p | --password | spotify password (only needed in non tty) |
| --cf | --cache-file | takes valid output file name path argument |
| --dr | --download-report | output a download report of what files failed |
| --cof | --cookie-file | takes valid file name path argument to a txt file for youtube cookies |
| --v | --version | returns current version |
| --h | --help | outputs help text |
<hr>

## Notes

If you receive a 429 error please provide a cookies file given the `--cof` flag, to generate a cookies file please refer to [Chrome](https://chrome.google.com/webstore/detail/njabckikapfpffapmjgojcnbfjonfjfg) or [Firefox](https://github.com/rotemdan/ExportCookies)

## Docker
```sh
docker run -it --user=$(id -u):$(id -g) -v $(pwd):/download --rm spotify-dl <options-to-spotify-dl defaults to --help>
Expand Down
21 changes: 5 additions & 16 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,15 @@
copies or substantial portions of the Software.
*/

const { ffmpegSetup, getSpinner } = require('./lib/setup');
const { startup } = require('./lib/setup');
const { logFailure } = require('./util/log-helper');
const Runner = require('./util/runner');
const versionChecker = require('./util/version-checker');

// setup ffmpeg
ffmpegSetup(process.platform);
const spinner = getSpinner();

process.on('SIGINT', () => {
process.exit(1);
});

versionChecker();

startup();
try {
Runner.run().then(() =>
process.exit(0),
);
Runner.run().then(() => process.exit(0));
} catch (error) {
spinner.fail('Something went wrong!');
logFailure('Something went wrong!');
console.log(error);
process.exit(1);
}
3 changes: 3 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ module.exports = {
},
flags: {
cacheFile: '.spdlcache',
cookieFile: 'cookies.txt',
downloadReport: true,
output: process.cwd(),
extraSearch: '',
password: '',
username: '',
savedAlbums: false,
savedPlaylists: false,
savedTracks: false,
savedShows: false,
outputOnly: false,
},
};
Loading

0 comments on commit e4a8a5c

Please sign in to comment.