Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,44 +1,4 @@
|
|
| 1 |
-
# For demo/testing mode when no real API credentials are available
|
| 2 |
-
DEMO_DATA = [
|
| 3 |
-
{
|
| 4 |
-
'artist': 'Demo Artist 1',
|
| 5 |
-
'title': 'Demo Track 1',
|
| 6 |
-
'album': 'Demo Album',
|
| 7 |
-
'isrc': 'ABCDE1234567',
|
| 8 |
-
'track_popularity': 75,
|
| 9 |
-
'genres': 'Pop, Electronic',
|
| 10 |
-
'artist_popularity': 80,
|
| 11 |
-
'artist_followers': 1000000,
|
| 12 |
-
'release_date': '2024-01-01',
|
| 13 |
-
'duration': '3:45',
|
| 14 |
-
'duration_ms': 225000,
|
| 15 |
-
'explicit': 'No',
|
| 16 |
-
'spotify_url': 'https://open.spotify.com/track/demo1',
|
| 17 |
-
'preview_url': 'Not available',
|
| 18 |
-
'playlist_source': 'Demo Playlist'
|
| 19 |
-
},
|
| 20 |
-
{
|
| 21 |
-
'artist': 'Demo Artist 2',
|
| 22 |
-
'title': 'Demo Track 2',
|
| 23 |
-
'album': 'Another Demo Album',
|
| 24 |
-
'isrc': 'FGHIJ7654321',
|
| 25 |
-
'track_popularity': 65,
|
| 26 |
-
'genres': 'Rock, Alternative',
|
| 27 |
-
'artist_popularity': 70,
|
| 28 |
-
'artist_followers': 750000,
|
| 29 |
-
'release_date': '2024-02-15',
|
| 30 |
-
'duration': '4:20',
|
| 31 |
-
'duration_ms': 260000,
|
| 32 |
-
'explicit': 'Yes',
|
| 33 |
-
'spotify_url': 'https://open.spotify.com/track/demo2',
|
| 34 |
-
'preview_url': 'Not available',
|
| 35 |
-
'playlist_source': 'Demo Playlist'
|
| 36 |
-
}
|
| 37 |
-
]
|
| 38 |
|
| 39 |
-
def get_demo_data():
|
| 40 |
-
"""Returns demo data when not using real API credentials."""
|
| 41 |
-
return DEMO_DATAimport gradio as gr
|
| 42 |
import requests
|
| 43 |
import pandas as pd
|
| 44 |
import time
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
|
|
|
|
|
|
|
|
|
| 2 |
import requests
|
| 3 |
import pandas as pd
|
| 4 |
import time
|