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

added multi processing #300

Merged
merged 85 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
635ef47
added multiprocessing feature
Sep 21, 2022
c479a71
corrected some deep source noticed errors
kithenry Sep 22, 2022
9bbf319
more deepsource error correction
kithenry Sep 22, 2022
cf0bdcb
deep source
kithenry Sep 22, 2022
fffeac6
corrected imports
kithenry Sep 22, 2022
4486886
updated imports
kithenry Sep 22, 2022
2d73aee
correcting errors shown by deep source
kithenry Sep 22, 2022
e4de875
deep source errors
kithenry Sep 22, 2022
ce4e399
deep source errors
kithenry Sep 22, 2022
bc7d92b
correcting deepsource errors
kithenry Sep 22, 2022
ab85474
Update spotify_dl.py
kithenry Sep 22, 2022
97a8870
Update youtube.py
kithenry Sep 22, 2022
b478768
Update youtube.py
kithenry Sep 22, 2022
da0cfe3
Update youtube.py
kithenry Sep 22, 2022
d933e88
Update scaffold.py
kithenry Sep 22, 2022
4624ad5
Update youtube.py
kithenry Sep 22, 2022
8e3fd04
Update youtube.py
kithenry Sep 22, 2022
f45ed11
Update youtube.py
kithenry Sep 22, 2022
7f40e0e
Update scaffold.py
kithenry Sep 22, 2022
26fa7d9
Update youtube.py
kithenry Sep 22, 2022
ea64698
Update scaffold.py
kithenry Sep 22, 2022
b62effa
Update youtube.py
kithenry Sep 22, 2022
a8c7ca5
Update youtube.py
kithenry Sep 22, 2022
81fc4b9
Update youtube.py
kithenry Sep 22, 2022
d2136ae
Update spotify_dl.py
kithenry Sep 22, 2022
bd37c72
Update youtube.py
kithenry Sep 22, 2022
020a66d
Update youtube.py
kithenry Sep 22, 2022
beaaea1
Update youtube.py
kithenry Sep 22, 2022
a44e2cd
Update youtube.py
kithenry Sep 22, 2022
5c90329
Update spotify_dl.py
kithenry Sep 22, 2022
68a96a6
updated readme
kithenry Sep 23, 2022
eed4552
Update README.md
kithenry Sep 23, 2022
c1c300d
fixed comma delimiter confusion [csv]
kithenry Sep 22, 2022
dda4e85
corrected some errors in the tag editing code
kithenry Sep 23, 2022
7c542e2
changed tests.. still editing though
kithenry Sep 23, 2022
d3876fc
Remove unused imports
deepsource-autofix[bot] Sep 23, 2022
2de1f6d
Remove commented out code
deepsource-autofix[bot] Sep 23, 2022
f5ef040
Merge pull request #1 from kithstack1/deepsource-fix-d1838738
kithenry Sep 23, 2022
8974726
Merge pull request #2 from kithstack1/deepsource-fix-3fe12c9d
kithenry Sep 23, 2022
fca99c8
all tests now pass.. made some changes to tests
kithenry Sep 24, 2022
9a91085
corrected get_tokens import
kithenry Sep 24, 2022
933fef1
added yt search to requirements.txt
kithenry Sep 24, 2022
bbc7230
update tests.yml
kithenry Sep 24, 2022
15d198f
removed youtube search, added backlash to special chars
kithenry Sep 24, 2022
a529d58
Update youtube.py
kithenry Sep 24, 2022
d7865b1
readme update to include multiprocessing
kithenry Sep 24, 2022
ff94b7a
Update README.md
kithenry Sep 24, 2022
1d62c65
Delete tags.txt
kithenry Sep 24, 2022
8475ec4
Delete setup_creds.sh
kithenry Sep 24, 2022
17b133e
Delete All Songs For This Download.txt
kithenry Sep 24, 2022
def8053
Update youtube.py
kithenry Sep 24, 2022
20aecc7
Delete .cache
kithenry Sep 26, 2022
011c349
Update scaffold.py
kithenry Sep 26, 2022
2eb5c4f
Update scaffold.py
kithenry Sep 26, 2022
ea5b0a9
Update youtube.py
kithenry Sep 27, 2022
61c1a1f
Update spotify_dl.py
kithenry Sep 27, 2022
4f8e0f4
Update spotify_dl.py
kithenry Sep 27, 2022
533e204
Update spotify_dl.py
kithenry Sep 27, 2022
a85b9d9
Update spotify_dl.py
kithenry Sep 27, 2022
840b39d
Update youtube.py
kithenry Sep 27, 2022
79f1dd3
Update spotify.py
kithenry Sep 27, 2022
bda316a
Update youtube.py
kithenry Sep 27, 2022
87e389b
Delete .cache
kithenry Sep 27, 2022
3c87052
Update .gitignore
kithenry Sep 27, 2022
9c2a39f
Update README.md
kithenry Sep 27, 2022
78bcd42
edits on file names
kithenry Sep 27, 2022
f5ff801
updated black formatter configs
kithenry Sep 27, 2022
026695f
Update tests.yml
kithenry Sep 27, 2022
6f7ee2f
Delete setup_creds.sh
kithenry Sep 27, 2022
9b9120e
Delete .cache
kithenry Sep 27, 2022
899c475
corrected deepsource errors
kithenry Sep 28, 2022
4c04746
corrected deepsource errors
kithenry Sep 28, 2022
00de564
Update youtube.py
kithenry Sep 28, 2022
c082e26
Update youtube.py
kithenry Sep 28, 2022
73090a8
all tests now pass
kithenry Sep 29, 2022
ce1c63d
Update youtube.py
kithenry Sep 29, 2022
cf3bea6
Update youtube.py
kithenry Sep 29, 2022
fcafe86
Update youtube.py
kithenry Sep 29, 2022
13f5261
Update spotify_dl.py
kithenry Oct 3, 2022
d63b25e
Update utils.py
kithenry Oct 3, 2022
8cd373c
Update utils.py
kithenry Oct 3, 2022
efed2ef
Update utils.py
kithenry Oct 3, 2022
fc38307
Update GETTING_STARTED.md
kithenry Oct 4, 2022
91e5893
fixed verbose mode
kithenry Oct 4, 2022
56f7f9a
Update spotify.py
kithenry Oct 4, 2022
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
4 changes: 2 additions & 2 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ You need Python 3.6+. To download songs as MP3, you will need ffmpeg.
$env:SPOTIPY_CLIENT_SECRET='your-spotify-client-secret'

Windows CMD:
set SPOTIPY_CLIENT_ID='your-spotify-client-id'
set SPOTIPY_CLIENT_SECRET='your-spotify-client-secret'
set SPOTIPY_CLIENT_ID=your-spotify-client-id
set SPOTIPY_CLIENT_SECRET=your-spotify-client-secret

See [this question](http://superuser.com/a/284351/4377) for more info,

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ For more details and other arguments, issue `-h`

spotify_dl -h

For downloading using multiple cores


spotify_dl -l [link] -mc [number of cores to use]

See [the getting started guide](https://github.com/SathyaBhat/spotify-dl/blob/master/GETTING_STARTED.md) for more details.

### Demo
Expand Down
56 changes: 28 additions & 28 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,47 @@
from setuptools import setup, find_packages
from spotify_dl.constants import VERSION

with open('README.md') as f:
with open("README.md") as f:
long_description = f.read()

with open('requirements.txt') as f:
with open("requirements.txt") as f:
requirements = f.read().splitlines()

setup(
name='spotify_dl',
name="spotify_dl",
version=VERSION,
python_requires='>=3.6',
python_requires=">=3.6",
install_requires=requirements,
author='Sathya Bhat',
author_email='sathya@sathyasays.com',
author="Sathya Bhat",
author_email="sathya@sathyasays.com",
packages=find_packages(),
include_package_data=True,
url='https://github.com/SathyaBhat/spotify-dl/',
license='MIT',
description='Downloads songs from a Spotify Playlist/Track/Album that you provide',
url="https://github.com/SathyaBhat/spotify-dl/",
license="MIT",
description="Downloads songs from a Spotify Playlist/Track/Album that you provide",
long_description=long_description,
long_description_content_type='text/markdown',
long_description_content_type="text/markdown",
entry_points={
'console_scripts': [
'spotify_dl=spotify_dl.spotify_dl:spotify_dl',
"console_scripts": [
"spotify_dl=spotify_dl.spotify_dl:spotify_dl",
],
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Internet',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Internet",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
],
)
2 changes: 2 additions & 0 deletions spotify_dl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bkup/
.cache
4 changes: 3 additions & 1 deletion spotify_dl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import signal
import sys


def signal_handler(sig, frame):
# Signal handler to handle SIGINT, usually when Ctrl+C is pressed.. or if SIGINT is sent.
# Thanks to https://stackoverflow.com/a/1112350/92837
print('\nCaught interrupt(did you press Ctrl+C?), stopping spotify_dl')
print("\nCaught interrupt(did you press Ctrl+C?), stopping spotify_dl")
sys.exit(0)


signal.signal(signal.SIGINT, signal_handler)
4 changes: 2 additions & 2 deletions spotify_dl/constants.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
from pathlib import Path

__all__ = ['VERSION']
__all__ = ["VERSION"]

VERSION = '8.3.0'
VERSION = "8.3.0"

if os.getenv("XDG_CACHE_HOME") is not None:
SAVE_PATH = os.getenv("XDG_CACHE_HOME") + "/spotifydl"
Expand Down
34 changes: 19 additions & 15 deletions spotify_dl/scaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
from rich.logging import RichHandler
from rich.console import Console

__all__ = ['log', 'get_tokens', 'console']

logging.basicConfig(level=logging.INFO,
format="%(message)s",
datefmt="[%X]",
handlers=[RichHandler(show_level=False, show_time=False)])
__all__ = ["log", "get_tokens", "console"]

logging.basicConfig(
level=logging.INFO,
format="%(message)s",
datefmt="[%X]",
handlers=[RichHandler(show_level=False, show_time=False)],
)
console = Console()
log = logging.getLogger('sdl')
log = logging.getLogger("sdl")
sentry_sdk.init("https://fc66a23d79634b9bba1690ea13e289f0@o321064.ingest.sentry.io/2383261")


Expand All @@ -21,13 +23,14 @@ def get_tokens():
:param name: Name to be cleaned up
:return string containing the cleaned name
"""
log.debug('Checking for tokens')
CLIENT_ID = getenv('SPOTIPY_CLIENT_ID')
CLIENT_SECRET = getenv('SPOTIPY_CLIENT_SECRET')
log.debug("Tokens fetched: {} {}".format(CLIENT_ID, CLIENT_SECRET))
log.debug("Checking for tokens")
CLIENT_ID = getenv("SPOTIPY_CLIENT_ID")
CLIENT_SECRET = getenv("SPOTIPY_CLIENT_SECRET")
log.debug("Tokens fetched : %s %s ", CLIENT_ID, CLIENT_SECRET)

if CLIENT_ID is None or CLIENT_SECRET is None:
print('''
print(
"""
You need to set your Spotify API credentials. You can do this by
setting environment variables like so:
Linux:
Expand All @@ -39,11 +42,12 @@ def get_tokens():
$env:SPOTIPY_CLIENT_SECRET='your-spotify-client-secret'

Windows CMD:
set SPOTIPY_CLIENT_ID='your-spotify-client-id'
set SPOTIPY_CLIENT_SECRET='your-spotify-client-secret'
set SPOTIPY_CLIENT_ID=your-spotify-client-id
set SPOTIPY_CLIENT_SECRET=your-spotify-client-secret

Get your credentials at
https://developer.spotify.com/my-applications
''')
"""
)
return None
return CLIENT_ID, CLIENT_SECRET
Loading