File size: 2,697 Bytes
8f3a4e5 2e38275 8f3a4e5 2e38275 8f3a4e5 2e38275 8f3a4e5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "9f0e1e4b-e36a-4dfe-adfd-6f99fb1d39f6",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"from app import animate_images, AudioInput, SpotifyApi"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "778fa4aa-cc12-4c33-a866-47ddcedcaf5f",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING:spodcast.podcast:Downloaded Hello Internet: Nine Ladies Dancing\n"
]
}
],
"source": [
"def test_spotify_downloads():\n",
" url = \"https://open.spotify.com/episode/3Ev4jlIjT8IVih1Oxidhqf?si=54a95e8fb07640c5\"\n",
" api = SpotifyApi(url=url)\n",
" api.download_episode()\n",
" api.download_image()\n",
" api.get_title()\n",
"\n",
"test_spotify_downloads()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "237e3903",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<moviepy.video.VideoClip.ImageClip at 0x7f5951ec8700>"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from moviepy.editor import ImageClip\n",
"\n",
"ImageClip(img=\"/notebooks/stablepod/temp/1ae3a379.jpg\")"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "de461d9b-bfbb-4d2d-b35e-fc3889494991",
"metadata": {},
"outputs": [],
"source": [
"def get_test_image_paths():\n",
" gallery_dir = \"temp/images\"\n",
" return [os.path.join(gallery_dir, img) for img in os.listdir(gallery_dir)][:2]\n",
"\n",
"get_test_image_paths()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "99df13fd-bd5d-4964-9300-016fcf7625e6",
"metadata": {},
"outputs": [],
"source": [
"def get_test_audio_paths():\n",
" audio_path = \"temp/audio.mp3\"\n",
" audio_input = AudioInput(audio_path, 10, 10)\n",
" return audio_input\n",
"\n",
"get_test_audio_paths()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.9.6 64-bit",
"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.9.13"
},
"vscode": {
"interpreter": {
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
}
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|