-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3be69e1
commit f9a6420
Showing
5 changed files
with
518 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from suno import SongsGen\n", | ||
"from dotenv import load_dotenv\n", | ||
"import os\n", | ||
"load_dotenv() \n", | ||
"\n", | ||
"SUNO_COOKIE = os.getenv(\"SUNO_COOKIE\")\n", | ||
"i = SongsGen(SUNO_COOKIE)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 9, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Waiting for results<span style=\"color: #808000; text-decoration-color: #808000\">...</span>\n", | ||
"</pre>\n" | ||
], | ||
"text/plain": [ | ||
"Waiting for results\u001b[33m...\u001b[0m\n" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
}, | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">.</pre>\n" | ||
], | ||
"text/plain": [ | ||
"." | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
}, | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">.</pre>\n" | ||
], | ||
"text/plain": [ | ||
"." | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
}, | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">.</pre>\n" | ||
], | ||
"text/plain": [ | ||
"." | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
}, | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">.</pre>\n" | ||
], | ||
"text/plain": [ | ||
"." | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
}, | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">.</pre>\n" | ||
], | ||
"text/plain": [ | ||
"." | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"output = i.get_songs_custom(\"\"\"(Verse 1)\n", | ||
"Wake up, boot up, it’s a brand new day,\n", | ||
"Open my laptop, where the code awaits.\n", | ||
"GitHub’s buzzing, community's alive,\n", | ||
"With open source, our dreams start to take flight.\n", | ||
"\n", | ||
"(Chorus)\n", | ||
"Fork it, clone it, make it your own,\n", | ||
"Push a commit, then you watch it grow.\n", | ||
"Issues and pull requests, let's get 'em merged,\n", | ||
"In the world of code, we surf the surge.\n", | ||
"\n", | ||
"(Verse 2)\n", | ||
"Collaboration like the world's never seen,\n", | ||
"On screens apart, but together we dream.\n", | ||
"A patch, a feature, a bug squashed away,\n", | ||
"In open source, we all have a say.\n", | ||
"\n", | ||
"(Chorus)\n", | ||
"Fork it, clone it, make it your own,\n", | ||
"Push a commit, then you watch it grow.\n", | ||
"Issues and pull requests, let's get 'em merged,\n", | ||
"In the world of code, we surf the surge.\"\"\", \"upbeat pop\")\n", | ||
"link = output['song_url']" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 11, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"\n", | ||
"(Verse 1)\n", | ||
"Wake up, boot up, it’s a brand new day,\n", | ||
"Open my laptop, where the code awaits.\n", | ||
"GitHub’s buzzing, community's alive,\n", | ||
"With open source, our dreams start to take flight.\n", | ||
"\n", | ||
"(Chorus)\n", | ||
"Fork it, clone it, make it your own,\n", | ||
"Push a commit, then you watch it grow.\n", | ||
"Issues and pull requests, let's get 'em merged,\n", | ||
"In the world of code, we surf the surge.\n", | ||
"\n", | ||
"(Verse 2)\n", | ||
"Collaboration like the world's never seen,\n", | ||
"On screens apart, but together we dream.\n", | ||
"A patch, a feature, a bug squashed away,\n", | ||
"In open source, we all have a say.\n", | ||
"\n", | ||
"(Chorus)\n", | ||
"Fork it, clone it, make it your own,\n", | ||
"Push a commit, then you watch it grow.\n", | ||
"Issues and pull requests, let's get 'em merged,\n", | ||
"In the world of code, we surf the surge.\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"print(output['song_name'])\n", | ||
"print(output['lyric'])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 12, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"audio = i.get_mp3(link, stream=True)\n", | ||
"for chunk in audio:\n", | ||
" if chunk:\n", | ||
" with open(\"custom_song.mp3\", \"ab\") as f:\n", | ||
" f.write(chunk)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "mad", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Binary file not shown.
Oops, something went wrong.