Use 7x11x13 fork
parent
6610eb4421
commit
0d8380939f
1
AUTHORS
1
AUTHORS
|
@ -3,6 +3,7 @@ Main Developers
|
||||||
|
|
||||||
* @FlyinGrub
|
* @FlyinGrub
|
||||||
* David Fischer @davidfischer-ch
|
* David Fischer @davidfischer-ch
|
||||||
|
* @7x11x13
|
||||||
|
|
||||||
Contributors
|
Contributors
|
||||||
============
|
============
|
||||||
|
|
29
README.md
29
README.md
|
@ -38,32 +38,47 @@ scdl me -f
|
||||||
```
|
```
|
||||||
-h --help Show this screen
|
-h --help Show this screen
|
||||||
--version Show version
|
--version Show version
|
||||||
me Use the user profile from the auth_token
|
|
||||||
-l [url] URL can be track/playlist/user
|
-l [url] URL can be track/playlist/user
|
||||||
|
-n [maxtracks] Download the n last tracks of a playlist according to the creation date
|
||||||
-s Download the stream of a user (token needed)
|
-s Download the stream of a user (token needed)
|
||||||
-a Download all tracks of user (including reposts)
|
-a Download all tracks of user (including reposts)
|
||||||
-t Download all uploads of a user (no reposts)
|
-t Download all uploads of a user (no reposts)
|
||||||
-f Download all favorites of a user
|
-f Download all favorites of a user
|
||||||
-C Download all commented by a user
|
-C Download all commented by a user
|
||||||
-p Download all playlists of a user
|
-p Download all playlists of a user
|
||||||
-m Download all liked and owned playlists of user
|
-r Download all reposts of user
|
||||||
-c Continue if a downloaded file already exists
|
-c Continue if a downloaded file already exists
|
||||||
|
--force-metadata This will set metadata on already downloaded track
|
||||||
-o [offset] Begin with a custom offset
|
-o [offset] Begin with a custom offset
|
||||||
--addtimestamp Add track creation timestamp to filename, which allows for chronological sorting
|
--addtimestamp Add track creation timestamp to filename,
|
||||||
|
which allows for chronological sorting
|
||||||
--addtofile Add artist to filename if missing
|
--addtofile Add artist to filename if missing
|
||||||
--debug Set log level to DEBUG
|
--debug Set log level to DEBUG
|
||||||
--download-archive [file] Keep track of track IDs in an archive file, and skip already-downloaded files
|
--download-archive [file] Keep track of track IDs in an archive file,
|
||||||
|
and skip already-downloaded files
|
||||||
--error Set log level to ERROR
|
--error Set log level to ERROR
|
||||||
--extract-artist Set artist tag from title instead of username
|
--extract-artist Set artist tag from title instead of username
|
||||||
--flac Convert WAV files to FLAC
|
|
||||||
--hide-progress Hide the wget progress bar
|
--hide-progress Hide the wget progress bar
|
||||||
--hidewarnings Hide Warnings. (use with precaution)
|
--hidewarnings Hide Warnings. (use with precaution)
|
||||||
--max-size [max-size] Skip tracks larger than size (k/m/g)
|
--max-size [max-size] Skip tracks larger than size (k/m/g)
|
||||||
--min-size [min-size] Skip tracks smaller than size (k/m/g)
|
--min-size [min-size] Skip tracks smaller than size (k/m/g)
|
||||||
--no-playlist-folder Download playlist tracks into main directory, instead of making a playlist subfolder
|
--no-playlist-folder Download playlist tracks into main directory,
|
||||||
--onlymp3 Download only the streamable mp3 file, even if track has a Downloadable file
|
instead of making a playlist subfolder
|
||||||
|
--onlymp3 Download only the streamable mp3 file,
|
||||||
|
even if track has a Downloadable file
|
||||||
--path [path] Use a custom path for downloaded files
|
--path [path] Use a custom path for downloaded files
|
||||||
--remove Remove any files not downloaded from execution
|
--remove Remove any files not downloaded from execution
|
||||||
|
--flac Convert original files to .flac
|
||||||
|
--no-album-tag On some player track get the same cover art if from the same album, this prevent it
|
||||||
|
--original-art Download original cover art
|
||||||
|
--original-name Do not change name of original file downloads
|
||||||
|
--no-original Do not download original file; only mp3 or m4a
|
||||||
|
--only-original Only download songs with original file available
|
||||||
|
--name-format [format] Specify the downloaded file name format
|
||||||
|
--playlist-name-format [format] Specify the downloaded file name format, if it is being downloaded as part of a playlist
|
||||||
|
--client-id [id] Specify the client_id to use
|
||||||
|
--auth-token [token] Specify the auth token to use
|
||||||
|
--overwrite Overwrite file if it already exists
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[scdl]
|
|
||||||
auth_token =
|
|
||||||
path = .
|
|
|
@ -2,31 +2,4 @@
|
||||||
|
|
||||||
"""Python Soundcloud Music Downloader."""
|
"""Python Soundcloud Music Downloader."""
|
||||||
|
|
||||||
import os
|
__version__ = "v2.2.0"
|
||||||
|
|
||||||
__version__ = 'v1.6.12'
|
|
||||||
CLIENT_ID = 'a3e059563d7fd3372b49b37f00a00bcf'
|
|
||||||
ALT_CLIENT_ID = '2t9loNQH90kzJcsFCODdigxfp325aq4z'
|
|
||||||
ALT2_CLIENT_ID = 'NONE'
|
|
||||||
|
|
||||||
USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'
|
|
||||||
|
|
||||||
|
|
||||||
default_config = """[scdl]
|
|
||||||
auth_token =
|
|
||||||
path = .
|
|
||||||
"""
|
|
||||||
|
|
||||||
if 'XDG_CONFIG_HOME' in os.environ:
|
|
||||||
config_dir = os.path.join(os.environ['XDG_CONFIG_HOME'], 'scdl')
|
|
||||||
else:
|
|
||||||
config_dir = os.path.join(os.path.expanduser('~'), '.config', 'scdl')
|
|
||||||
|
|
||||||
config_file = os.path.join(config_dir, 'scdl.cfg')
|
|
||||||
|
|
||||||
if not os.path.exists(config_file):
|
|
||||||
if not os.path.exists(config_dir):
|
|
||||||
os.makedirs(config_dir)
|
|
||||||
|
|
||||||
with open(config_file, 'w') as f:
|
|
||||||
f.write(default_config)
|
|
|
@ -1,29 +0,0 @@
|
||||||
# -*- encoding: utf-8 -*-
|
|
||||||
|
|
||||||
import requests
|
|
||||||
from scdl import CLIENT_ID, USER_AGENT
|
|
||||||
|
|
||||||
|
|
||||||
class Client():
|
|
||||||
|
|
||||||
def get_collection(self, url, token):
|
|
||||||
params = {
|
|
||||||
'client_id': CLIENT_ID,
|
|
||||||
'linked_partitioning': '1',
|
|
||||||
}
|
|
||||||
if token:
|
|
||||||
params['oauth_token'] = token
|
|
||||||
resources = list()
|
|
||||||
while url:
|
|
||||||
response = requests.get(url, params=params, headers={'User-Agent': USER_AGENT})
|
|
||||||
response.raise_for_status()
|
|
||||||
json_data = response.json()
|
|
||||||
if 'collection' in json_data:
|
|
||||||
resources.extend(json_data['collection'])
|
|
||||||
else:
|
|
||||||
resources.extend(json_data)
|
|
||||||
if 'next_href' in json_data:
|
|
||||||
url = json_data['next_href']
|
|
||||||
else:
|
|
||||||
url = None
|
|
||||||
return resources
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
[scdl]
|
||||||
|
client_id = a3e059563d7fd3372b49b37f00a00bcf
|
||||||
|
auth_token =
|
||||||
|
path = .
|
||||||
|
name_format = {title}
|
||||||
|
playlist_name_format = {playlist[title]}_{playlist[tracknumber]}_{title}
|
||||||
|
|
||||||
|
# example name_format values:
|
||||||
|
# {timestamp}_{user[username]}_{title}
|
||||||
|
# {id}_{user[username]}_{title}
|
||||||
|
# {id}_{user[id]}_{title}
|
||||||
|
# list of all BasicTrack attributes can be found at: https://github.com/7x11x13/soundcloud.py/blob/main/soundcloud/resource/track.py#L35
|
||||||
|
|
||||||
|
# playlist_name_format playlist attributes:
|
||||||
|
# playlist[author] - username of playlist author
|
||||||
|
# playlist[title] - name of playlist
|
||||||
|
# playlist[tracknumber] - tracknumber of track in playlist (zero-padded)
|
926
scdl/scdl.py
926
scdl/scdl.py
File diff suppressed because it is too large
Load Diff
|
@ -15,7 +15,8 @@ __all__ = ('ColorizeFilter', )
|
||||||
class ColorizeFilter(logging.Filter):
|
class ColorizeFilter(logging.Filter):
|
||||||
|
|
||||||
color_by_level = {
|
color_by_level = {
|
||||||
logging.DEBUG: 'yellow',
|
logging.DEBUG: 'blue',
|
||||||
|
logging.WARNING: 'yellow',
|
||||||
logging.ERROR: 'red',
|
logging.ERROR: 'red',
|
||||||
logging.INFO: 'white'
|
logging.INFO: 'white'
|
||||||
}
|
}
|
||||||
|
|
49
setup.py
49
setup.py
|
@ -6,39 +6,46 @@ from setuptools import setup, find_packages
|
||||||
import scdl
|
import scdl
|
||||||
|
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
this_directory = path.abspath(path.dirname(__file__))
|
this_directory = path.abspath(path.dirname(__file__))
|
||||||
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
|
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
|
||||||
long_description = f.read()
|
long_description = f.read()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='scdl',
|
name="scdl",
|
||||||
version=scdl.__version__,
|
version=scdl.__version__,
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
author='FlyinGrub',
|
author="FlyinGrub",
|
||||||
author_email='flyinggrub@gmail.com',
|
author_email="flyinggrub@gmail.com",
|
||||||
description='Download Music from Souncloud',
|
description="Download Music from Souncloud",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type="text/markdown",
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'docopt',
|
"docopt",
|
||||||
'mutagen',
|
"mutagen",
|
||||||
'termcolor',
|
"termcolor",
|
||||||
'requests',
|
"requests",
|
||||||
'clint'
|
"clint",
|
||||||
|
"pathvalidate",
|
||||||
|
"soundcloud-v2>=1.1.4"
|
||||||
],
|
],
|
||||||
url='https://github.com/flyingrub/scdl',
|
url="https://github.com/flyingrub/scdl",
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Programming Language :: Python',
|
"Programming Language :: Python",
|
||||||
'Development Status :: 5 - Production/Stable',
|
"Development Status :: 5 - Production/Stable",
|
||||||
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
|
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
|
||||||
'Operating System :: OS Independent',
|
"Operating System :: OS Independent",
|
||||||
'Programming Language :: Python :: 3.4',
|
"Programming Language :: Python :: 3.6",
|
||||||
'Topic :: Internet',
|
"Programming Language :: Python :: 3.7",
|
||||||
'Topic :: Multimedia :: Sound/Audio',
|
"Programming Language :: Python :: 3.8",
|
||||||
|
"Programming Language :: Python :: 3.9",
|
||||||
|
"Topic :: Internet",
|
||||||
|
"Topic :: Multimedia :: Sound/Audio",
|
||||||
],
|
],
|
||||||
|
python_requires = ">=3.6",
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': [
|
"console_scripts": [
|
||||||
'scdl = scdl.scdl:main',
|
"scdl = scdl.scdl:main",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue