├── zs_config.json ├── README.md └── zspotify.ipynb /zs_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "ROOT_PATH": "/content/drive/MyDrive/ZSpotify Music/", 3 | "ROOT_PODCAST_PATH": "/content/drive/MyDrive/ZSpotify Podcasts/", 4 | "SKIP_EXISTING_FILES": true, 5 | "MUSIC_FORMAT": "ogg", 6 | "RAW_AUDIO_AS_IS": false, 7 | "FORCE_PREMIUM": false, 8 | "ANTI_BAN_WAIT_TIME": 1, 9 | "OVERRIDE_AUTO_WAIT": false, 10 | "CHUNK_SIZE": 50000, 11 | "SPLIT_ALBUM_DISCS": false 12 | } 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # zspotifycolab 2 | A Spotify downloader needing only a python interpreter and ffmpeg. 3 | 4 | Forked from [Footsiefat/zspotify](https://github.com/Footsiefat/zspotify) 5 | 6 | #### Just hit the button below and get going: 7 | Open In Colab 8 | 9 | Shout out to [Catwaiix](https://github.com/Catwaiix) for giving me smart ideas for this repo! 10 | 11 | ### Will my account get banned if I use this tool? 12 | 13 | **There have been 2-3 reports from users who received account bans from Spotify for using this tool**. 14 | 15 | We recommend using ZSpotify with a burner account. 16 | Alternatively, there is a configuration option labled ```DOWNLOAD_REAL_TIME```, this limits the download speed to the duration of the song being downloaded thus not appearing suspicious to Spotify. 17 | This option is much slower and is only recommended for premium users who wish to download songs in 320kbps without buying premium on a burner account. 18 | 19 | **Use ZSpotify at your own risk**, the developers of ZSpotify are not responsible if your account gets banned. 20 | 21 | ### What do I do if I see "Your session has been terminated"? 22 | 23 | If you see this, don't worry! Just try logging back in. If you see the incorrect username or password error, reset your password and you should be able to log back in and continue using Spotify. 24 | 25 | ### Options 26 | **likedSongs** - Downloads all the liked songs from your account 27 | -------------------------------------------------------------------------------- /zspotify.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "ZSpotifyColab.ipynb", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | }, 13 | "language_info": { 14 | "name": "python" 15 | } 16 | }, 17 | "cells": [ 18 | { 19 | "cell_type": "code", 20 | "metadata": { 21 | "cellView": "form", 22 | "id": "UBROi5qcLcpf" 23 | }, 24 | "source": [ 25 | "#@markdown ឵឵ ឵\n", 26 | "#@markdown
" 27 | ], 28 | "execution_count": null, 29 | "outputs": [] 30 | }, 31 | { 32 | "cell_type": "code", 33 | "metadata": { 34 | "id": "345DQno2G3wR", 35 | "cellView": "form" 36 | }, 37 | "source": [ 38 | "#@title __✦ Mount Google Drive and Install dependencies__\n", 39 | "#@markdown Note: Upload `credentials.json` to your Google Drive **root** folder to use these credentials instead of logging-in every single session. \n", 40 | "from IPython.display import clear_output\n", 41 | "from google.colab import drive\n", 42 | "from pathlib import Path\n", 43 | "import shutil\n", 44 | "drive.mount('/content/drive', force_remount=True)\n", 45 | "!echo \"Installing Dependencies:\"\n", 46 | "!add-apt-repository --yes ppa:deadsnakes/ppa\n", 47 | "!apt install --yes python3.9 python3.9-distutils ffmpeg rar\n", 48 | "!wget https://bootstrap.pypa.io/get-pip.py && python3.9 get-pip.py\n", 49 | "!python3.9 get-pip.py\n", 50 | "!curl -O https://web.archive.org/web/20211023110559if_/https://codeload.github.com/Footsiefat/zspotify/zip/refs/heads/main && mv '/content/main' '/content/zspotify.zip'\n", 51 | "!unzip zspotify.zip\n", 52 | "!python3.9 -m pip install -r '/content/zspotify-main/requirements.txt'\n", 53 | "!rm zspotify.zip\n", 54 | "!rm /content/zspotify-main/zs_config.json\n", 55 | "!rm /content/get-pip.py\n", 56 | "!curl -O https://raw.githubusercontent.com/Ori5000/zspotifycolab/main/zs_config.json\n", 57 | "shutil.move('/content/zs_config.json', '/content/zspotify-main/zs_config.json')\n", 58 | "credentials = Path(\"/content/drive/MyDrive/credentials.json\")\n", 59 | "if credentials.is_file():\n", 60 | " !cp /content/drive/MyDrive/credentials.json /content/zspotify-main/credentials.json\n", 61 | "else:\n", 62 | " pass\n", 63 | "clear_output()\n", 64 | "!echo \"Done!\"" 65 | ], 66 | "execution_count": null, 67 | "outputs": [] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "metadata": { 72 | "id": "kw3BTlN3HGzj", 73 | "cellView": "form" 74 | }, 75 | "source": [ 76 | "#@title __⬅️ Download from Spotify!__\n", 77 | "#@markdown Note: Use `Rar` and `RarPassword` options if you want to get a .rar file after the download ended.\n", 78 | "Type = \"Search\" #@param [\"Search\", \"URL\", \"Personal Playlists\", \"Liked Songs\"]\n", 79 | "Rar = False #@param {type:\"boolean\"}\n", 80 | "RarPassword = False #@param {type:\"boolean\"}\n", 81 | "from IPython.display import clear_output\n", 82 | "import json\n", 83 | "if Type == \"Search\":\n", 84 | " !cd zspotify-main && python3.9 zspotify.py\n", 85 | "elif Type == \"URL\":\n", 86 | " URL = input('Enter the Spotify URL: ')\n", 87 | " !cd zspotify-main && python3.9 zspotify.py {URL}\n", 88 | "elif Type == \"Personal Playlists\":\n", 89 | " !cd zspotify-main && python3.9 zspotify.py -p\n", 90 | "else:\n", 91 | " !cd zspotify-main && python3.9 zspotify.py -ls\n", 92 | "if Rar == True:\n", 93 | " with open('/content/zspotify-main/zs_config.json','r') as file:\n", 94 | " data = json.load(file)\n", 95 | " ROOT_PATH = data['ROOT_PATH']\n", 96 | " Filename = input('Enter the .rar file name: ')\n", 97 | " if RarPassword == True:\n", 98 | " !rar a -p '{ROOT_PATH}{Filename}' '{ROOT_PATH}'\n", 99 | " else:\n", 100 | " !rar a '{ROOT_PATH}{Filename}' '{ROOT_PATH}'\n", 101 | "else:\n", 102 | " pass\n", 103 | "clear_output()\n", 104 | "!echo \"Done!\"" 105 | ], 106 | "execution_count": null, 107 | "outputs": [] 108 | }, 109 | { 110 | "cell_type": "code", 111 | "metadata": { 112 | "id": "vOTTdTVBNi11", 113 | "cellView": "form" 114 | }, 115 | "source": [ 116 | "#@title __⬅️ Custom configuration__\n", 117 | "#@markdown Note: Use `isSharedDrive` if you want your music to be downloaded to a Google Shared Drive.\n", 118 | "from IPython.display import clear_output\n", 119 | "import shutil\n", 120 | "Drive = \"MyDrive\" #@param {type:\"string\"}\n", 121 | "isSharedDrive = False #@param {type:\"boolean\"}\n", 122 | "ForcePremium = False #@param {type:\"boolean\"}\n", 123 | "DownloadFormat = \"ogg\" #@param [\"ogg\", \"mp3\"]\n", 124 | "ForcePremium = False #@param {type:\"boolean\"}\n", 125 | "RawAudioAsIs = False #@param {type:\"boolean\"}\n", 126 | "AntiBanWaitTime = 1 #@param {type:\"slider\", min:1, max:120, step:1}\n", 127 | "\n", 128 | "!rm /content/zspotify-main/zs_config.json\n", 129 | "!curl -O https://raw.githubusercontent.com/Ori5000/zspotifycolab/main/zs_config.json\n", 130 | "shutil.move('/content/zs_config.json', '/content/zspotify-main/zs_config.json')\n", 131 | "\n", 132 | "fin = open(\"/content/zspotify-main/zs_config.json\", \"rt\")\n", 133 | "data = fin.read()\n", 134 | "if isSharedDrive == True:\n", 135 | " data = data.replace('MyDrive', 'Shareddrives/{}'.format(Drive))\n", 136 | "else:\n", 137 | " data = data.replace('MyDrive', Drive)\n", 138 | "data = data.replace('ogg', DownloadFormat)\n", 139 | "if ForcePremium == True:\n", 140 | " data = data.replace('\"FORCE_PREMIUM\": false', '\"FORCE_PREMIUM\": true')\n", 141 | "else:\n", 142 | " pass\n", 143 | "if RawAudioAsIs == True:\n", 144 | " data = data.replace('\"RAW_AUDIO_AS_IS\": false', '\"RAW_AUDIO_AS_IS\": true')\n", 145 | "else:\n", 146 | " pass\n", 147 | "data = data.replace('\"ANTI_BAN_WAIT_TIME\": 1', '\"ANTI_BAN_WAIT_TIME\": {}'.format(AntiBanWaitTime))\n", 148 | "fin.close()\n", 149 | "fin = open(\"/content/zspotify-main/zs_config.json\", \"wt\")\n", 150 | "fin.write(data)\n", 151 | "fin.close()\n", 152 | "clear_output()\n", 153 | "!echo \"Done!\"" 154 | ], 155 | "execution_count": null, 156 | "outputs": [] 157 | } 158 | ] 159 | } 160 | --------------------------------------------------------------------------------