Skip to content

Commit

Permalink
Revert "Lint with flake8, fix code to pass it (#1178)"
Browse files Browse the repository at this point in the history
This reverts commit 6bba464.
  • Loading branch information
Silverarmor committed Feb 7, 2021
1 parent 6bba464 commit 51ffee7
Show file tree
Hide file tree
Showing 14 changed files with 238 additions and 269 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/spotify-downloader-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,6 @@ jobs:
env:
PLATFORM: ${{ matrix.platform }}

mypy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install tox
- name: Run mypy
run: |
tox -e mypy
flake8:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install tox
- name: Run flake8
run: |
tox -e flake8
regressions:
runs-on: ubuntu-latest

Expand Down
8 changes: 2 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,14 @@ python_requires = >=3.6
packages = find:

[options.extras_require]
test =
test =
pytest >= 6.0
pytest-mock >= 3.3.1
pytest-vcr >= 1.0.2
pyfakefs >= 4.3.0
pytest-cov >= 2.10.1
dev =
dev =
tox
mypy==0.790
flake8==3.8.4

[options.entry_points]
console_scripts=
Expand All @@ -57,5 +55,3 @@ console_scripts=
[mypy]
ignore_missing_imports = True

[flake8]
max-line-length = 100
2 changes: 2 additions & 0 deletions spotdl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from .__main__ import console_entry_point

__all__ = [
'search',
'download',
Expand Down
66 changes: 29 additions & 37 deletions spotdl/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,31 @@
# ! Song Search from different start points
from spotdl.search.utils import get_playlist_tracks, get_album_tracks, search_for_song

# ! Usage is simple - call:
# 'python __main__.py <links, search terms, tracking files separated by spaces>
# ! Eg.
# ! python __main__.py
# ! https://open.spotify.com/playlist/37i9dQZF1DWXhcuQw7KIeM?si=xubKHEBESM27RqGkqoXzgQ
# ! 'old gods of asgard Control'
# ! https://open.spotify.com/album/2YMWspDGtbDgYULXvVQFM6?si=gF5dOQm8QUSo-NdZVsFjAQ
# ! https://open.spotify.com/track/08mG3Y1vljYA6bvDt4Wqkj?si=SxezdxmlTx-CaVoucHmrUA
# !
# ! Well, yeah its a pretty long example but, in theory, it should work like a charm.
# !
# ! A '.spotdlTrackingFile' is automatically created with the name of the first song in the
# ! playlist/album or the name of the song supplied. We don't really re re re-query YTM and Spotify
# ! as all relevant details are stored to disk.
# !
# ! Files are cleaned up on download failure.
# !
# ! All songs are normalized to standard base volume. the soft ones are made louder,
# ! the loud ones, softer.
# !
# ! The progress bar is synched across multiple-processes (4 processes as of now), getting the
# ! progress bar to synch was an absolute pain, each process knows how much 'it' progressed,
# ! but the display has to be for the overall progress so, yeah... that took time.
# !
# ! spotdl will show you its true speed on longer download's - so make sure you try
# ! downloading a playlist.
# !
# ! still yet to try and package this but, in theory, there should be no errors.
# !
# ! - cheerio! (Michael)
# !
# ! P.S. Tell me what you think. Up to your expectations?
#! Usage is simple - call 'python __main__.py <links, search terms, tracking files seperated by spaces>
#! Eg.
#! python __main__.py https://open.spotify.com/playlist/37i9dQZF1DWXhcuQw7KIeM?si=xubKHEBESM27RqGkqoXzgQ 'old gods of asgard Control' https://open.spotify.com/album/2YMWspDGtbDgYULXvVQFM6?si=gF5dOQm8QUSo-NdZVsFjAQ https://open.spotify.com/track/08mG3Y1vljYA6bvDt4Wqkj?si=SxezdxmlTx-CaVoucHmrUA
#!
#! Well, yeah its a pretty long example but, in theory, it should work like a charm.
#!
#! A '.spotdlTrackingFile' is automatically created with the name of the first song in the playlist/album or
#! the name of the song supplied. We don't really re re re-query YTM and SPotify as all relevant details are
#! stored to disk.
#!
#! Files are cleaned up on download failure.
#!
#! All songs are normalized to standard base volume. the soft ones are made louder, the loud ones, softer.
#!
#! The progress bar is synched across multiple-processes (4 processes as of now), getting the progress bar to
#! synch was an absolute pain, each process knows how much 'it' progressed, but the display has to be for the
#! overall progress so, yeah... that took time.
#!
#! spotdl will show you its true speed on longer download's - so make sure you try downloading a playlist.
#!
#! still yet to try and package this but, in theory, there should be no errors.
#!
#! - cheerio! (Michael)
#!
#! P.S. Tell me what you think. Up to your expectations?

# ! Script Help
help_notice = '''
Expand Down Expand Up @@ -68,11 +61,9 @@
You can queue up multiple download tasks by separating the arguments with spaces:
spotdl [songQuery1] [albumUrl] [songQuery2] ... (order does not matter)
ex. spotdl 'The Weeknd - Blinding Lights'
https://open.spotify.com/playlist/37i9dQZF1E8UXBoz02kGID?si=oGd5ctlyQ0qblj_bL6WWow ...
ex. spotdl 'The Weeknd - Blinding Lights' https://open.spotify.com/playlist/37i9dQZF1E8UXBoz02kGID?si=oGd5ctlyQ0qblj_bL6WWow ...
spotDL downloads up to 4 songs in parallel, so for a faster experience,
download albums and playlist, rather than tracks.
spotDL downloads up to 4 songs in parallel, so for a faster experience, download albums and playlist, rather than tracks.
'''


Expand All @@ -95,7 +86,7 @@ def console_entry_point():
print('Fetching Song...')
song = SongObj.from_url(request)

if song.get_youtube_link() is not None:
if song.get_youtube_link() != None:
downloader.download_single_song(song)
else:
print('Skipping %s (%s) as no match could be found on youtube' % (
Expand Down Expand Up @@ -141,5 +132,6 @@ def parse_arguments():
return parser.parse_args()



if __name__ == '__main__':
console_entry_point()
2 changes: 1 addition & 1 deletion spotdl/download/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__all__ = [
'progressHandlers',
'downloader'
]
]
Loading

0 comments on commit 51ffee7

Please sign in to comment.