{"id":13677834,"url":"https://github.com/idilsulo/ChatGPTify","last_synced_at":"2025-04-29T12:32:00.539Z","repository":{"id":143736130,"uuid":"616566481","full_name":"idilsulo/ChatGPTify","owner":"idilsulo","description":"Spotify playlist generator via ChatGPT ","archived":false,"fork":false,"pushed_at":"2024-01-20T15:23:42.000Z","size":259,"stargazers_count":205,"open_issues_count":3,"forks_count":18,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-08-02T13:19:33.553Z","etag":null,"topics":["chatgpt","chatgpt-api","gpt-3","gpt4","openai","spotify","spotify-api","spotify-playlist","spotipy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idilsulo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-20T16:29:48.000Z","updated_at":"2024-08-01T20:44:43.000Z","dependencies_parsed_at":"2024-08-02T13:16:05.256Z","dependency_job_id":"9879a5f2-309f-464f-8881-910bdb47693b","html_url":"https://github.com/idilsulo/ChatGPTify","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idilsulo%2FChatGPTify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idilsulo%2FChatGPTify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idilsulo%2FChatGPTify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idilsulo%2FChatGPTify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idilsulo","download_url":"https://codeload.github.com/idilsulo/ChatGPTify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224173197,"owners_count":17268065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","chatgpt-api","gpt-3","gpt4","openai","spotify","spotify-api","spotify-playlist","spotipy"],"created_at":"2024-08-02T13:00:47.716Z","updated_at":"2024-11-11T20:30:25.513Z","avatar_url":"https://github.com/idilsulo.png","language":"Python","funding_links":[],"categories":["Tools","Demo","提示- [会议安排](https://github.com/stephanj/Scheduling-using-GPT4) 使用GPT-4。","Python"],"sub_categories":["Open-source projects","充当旅行向导","开源项目"],"readme":"# ChatGPTify = 🤖 ChatGPT x Spotify 🎧\n\nMaybe you have already tried asking for song recommendations to ChatGPT, but wouldn't it be nice if you could listen the playlists recommended based on your music taste directly on your Spotify account?\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=assets/playlist.jpg  width=\"500\"\u003e\n\u003c/p\u003e\n\n\u003e **ChatGPT Playlist reasoning:** The playlist \"Electronic Odyssey\" consists of electronic dance music tracks that share several common themes, musical elements, and features. These tracks are characterized by their pulsing beats, hypnotic rhythms, and driving basslines that create an intense and immersive listening experience.  One common theme in this playlist is the use of repetition, which is a hallmark of electronic music. The tracks often feature looping melodies, hypnotic arpeggios, and other repetitive elements that create a sense of momentum and progression. This repetition is often used to build tension and energy, leading to cathartic drops and climactic moments.  Another common feature of these tracks is their use of synthesizers and other electronic instruments to create a wide range of sounds and textures. The tracks often feature lush pads, soaring leads, and intricate percussion that are layered and manipulated to create complex and evolving soundscapes. \n\n\nThis repository is built with Python and uses [spotipy](https://github.com/spotipy-dev/spotipy) and [chatgpt-wrapper](https://github.com/mmabrouk/chatgpt-wrapper) for creating playlists based on user prompts via [ChatGPT](https://openai.com/blog/chatgpt) model.\n\n\n## Installation\n\n**Step 1:** Create an [OpenAI account](https://beta.openai.com/account/api-keys)\n\n**Step 2:** Generate [Spotify Client ID \u0026 Secret Key](https://developer.spotify.com/dashboard/login) and set a Redirect URI under your App settings, e.g. `http://localhost:8080`.\n\n**Step 3:** Install dependencies\n\n```\npip install spotipy\npip install git+https://github.com/mmabrouk/chatgpt-wrapper@18f3903cc083a794ec1b4e55e82f0e7ac5184f35\nplaywright install firefox\nchatgpt install\n```\n\nThis will then open up a browser window. Log in to ChatGPT in the browser window, walk through all the intro screens and then exit.\n\n```\n1\u003e /exit\n```\n\n**Note:**  If you encounter any issues regarding ChatGPT wrapper installation, please refer to [chatgpt-wrapper](https://github.com/mmabrouk/chatgpt-wrapper).\n\n\n**Step 4:** Setup credentials\n\nThis can be done via executing the following commands on Terminal.\n```\nexport SPOTIFY_CLIENT_ID=\"Spotify Client ID\"\nexport SPOTIFY_CLIENT_SECRET=\"Spotify Client Secret\"\nexport SPOTIFY_REDIRECT_URI=\"Redirect URI, e.g. http://localhost:8080\"\n```\n\nOR, can be modified inside the Python script, `run.py`:\n```\nos.environ['SPOTIFY_CLIENT_ID']     = \"Spotify Client ID\"\nos.environ['SPOTIFY_CLIENT_SECRET'] = \"Spotify Client Secret\"\nos.environ['SPOTIFY_REDIRECT_URI']  = \"Redirect URI\"\n```\n\n**Important:** Make sure to set the same Redirect URI on your Spotify Developer account as well. This can be done under `Dashboard \u003e App \u003e Edit Settings \u003e Redirect URIs`.\n\n## Usage \n\nFor a sample usage of the script, run\n```\npython3 run.py\n```\n\n### Prompting for Playlists\n\nCustom user prompts can be provided in a way that they will complete the following sentence: \n`\"Provide a playlist containing songs...\"`\n```\npython3 run.py --PROMPT \"falling under the genre downtempo and trip-hop\" \n```\n\nThis will create the playlist and save it with a ChatGPT-generated name. If you instead would like to save it with a custom name, this can be provided with `--PLAYLIST_NAME` flag.\n\n**Note:** Using this option will **NOT** use or share your previously listened artists with ChatGPT.\n\n### Prompting for Playlists with User Data / Listening History\n\nIf you would like to share your previously listened artists and get playlists with new artist recommendations, simply use:\n```\npython3 run.py --USER_DATA True --TERM long_term --TOP_GENRE 1\n```\n\nThis will create playlist that are similar to but (mostly) not including your top-listened artists in the past years. The time range (term) and top genre selection can be made in the following way:\n\n```\n--TERM      \"long_term\"    # past years\n            \"medium_term   # past 6 months\n            \"short_term    # past 4 weeks\n    \n--TOP_GENRE 1              # top (most-listened) genre\n            2              # second most listened genre\n            3              # third most listened genre\n```\n\n**Note:** If you would like to have better quality predictions, try executing `pkill firefox` and then `chatgpt install` once in a while.\n\n## Examples\n\nFeel free to plug and play!\n\n```\nplay = SpotifyPlaylist()\n```\n\nAsk for a playlist recommendation by setting `prompt_type=\"playlist\"`.\nPrompts will then automatically start with the phrase: `\"Provide a playlist containing songs \"`\n\nYou can complete the prompt as you wish, see examples:\n\n* `\"similar to the style of Quantic and Thievery Corporation without including these artists\"`\n* `\"falling under the genre downtempo and trip-hop\"`\n\n```\nplay.ask_chatgpt(prompt=\"similar to the ones created by Daniel Avery\", prompt_type=\"playlist\")\n```\n\nYou can then create and save the playlist:\n```\nplay.create_playlist()\nplay.save_playlist()\n```\n\nAdditionally you can ask for a playlist name and save the playlist under your account with this name, provide `prompt_type=\"name\"`:\n\n```\nplay.ask_chatgpt(prompt=\"\", prompt_type=\"name\")\nplay.save_playlist(name=play.name)\n```\n\nYou can also ask the reasoning behind this playlist by asking the common elements in these songs, no `prompt_type` required:\n```\nplay.ask_chatgpt(prompt=\"What is the common theme, musical elements or features in this playlist? Explain in detail.\")\n```\n\nEnjoy your new playlists!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidilsulo%2FChatGPTify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidilsulo%2FChatGPTify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidilsulo%2FChatGPTify/lists"}