Настройка Spotipy в PythonanywherePython

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 Настройка Spotipy в Pythonanywhere

Сообщение Anonymous »

Я делаю программу, которую я хочу работать непрерывно (отсюда и pythonanywhere): < /p>

Код: Выделить всё

def setup():
spOauth  =  SpotifyOAuth(client_id=CLIENTID,
client_secret=CLIENTSECRET,
redirect_uri=REDIRECTURI,
scope=SCOPE,
show_dialog=True)
return Spotify(auth_manager = spOauth)

def main():
anon = "insert anon here"
url = "insert supabase url here"
supabase: Client = create_client(url,anon) #set up the connection to the database

sp = setup() #set up the connection to spotipy
refreshRate = 30

current = {"length": 120000} #default used for if no song is being listened to
run  = True
count = -1

while run:
nowp = getCurrentSong(sp)
if nowp == 0:
sp = setup()
else:
if nowp != current:
if count >=current["length"]/2000: #if youve listened to half the song add
SQLappend(current,supabase)
if nowp!=-1: #if there is a new song
current = nowp #update current
refreshRate = current["length"]/4000 # and refreshrate
else:
current = {"length": 120000} # if the music has stopped go back to default
refreshRate = current["length"]/4000
count = 0 #reset timer
elif nowp != -1: #if there is music
count = count+refreshRate #keep track of for how long
time.sleep(refreshRate)#wait some amount of time
Это работает на моем локальном устройстве, но когда я загружаю его в Pythonanywhere после того, как я изменил URL -адрес перенаправления, он не работает.>

Подробнее здесь: https://stackoverflow.com/questions/797 ... onanywhere
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»