#!/usr/bin/env python3 """ SoundCloud Downloader with ID3 Tags ----------------------------------- This script downloads all tracks from a SoundCloud artist, including proper ID3 tags and album artwork. Requirements: pip install scdl mutagen requests tqdm """ import os import sys import subprocess import json import requests from pathlib import Path from mutagen.id3 import ID3, APIC, TIT2, TPE1, TALB, TDRC, TCON, TCOM, COMM from tqdm import tqdm import re import argparse # ANSI colors for terminal output class Colors: GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' BLUE = '\033[94m' ENDC = '\033[0m' def setup_argparser(): parser = argparse.ArgumentParser(description='Download all tracks from a SoundCloud artist with proper ID3 tags') parser.add_argument('url', help='SoundCloud URL (artist profile or likes page)') parser.add_argument('-o', '--output', default='downloads', help='Output directory') parser.add_argument('-c', '--client-id', help='SoundCloud client ID (optional)') parser.add_argument('--likes', action='store_true', help='Download liked tracks (auto-detected from URL)') parser.add_argument('--author', help='Explicitly set the author name for all tracks') parser.add_argument('--album', help='Explicitly set the album name for all tracks') parser.add_argument('--force-tags', action='store_true', help='Force update of ID3 tags even if they exist') return parser.parse_args() def get_client_id(): """Extract client_id by scraping SoundCloud's website""" print(f"{Colors.BLUE}[*] Obtaining SoundCloud client ID...{Colors.ENDC}") try: response = requests.get('https://soundcloud.com/') scripts = re.findall(r'