【问题标题】:Exception thrown even though I'm catching it即使我正在捕捉它也会抛出异常
【发布时间】:2022-06-15 19:38:00
【问题描述】:

我正在尝试使用 Spotipy 枚举集合 URL 以获取相应的 Spotify 曲目。 当轨道 ID 不存在时,程序会抛出错误,即使我发现了提到的确切错误。该错误表示在处理异常期间发生了另一个异常,这是否意味着我的 try catch 设置不正确?

请参阅下图了解确切的错误。

Error

    if 'open.spotify.com/track' in url:  
        try:  
            track = sp.track(url, 'NL')
            newids.append(track['id'])
        except sp.SpotifyException:
            x = 0
        bar.next()
        if i % 50 == 49:
            time.sleep(1)

【问题讨论】:

  • 您能否将完整的错误消息作为文本添加到您的问题中?

标签: python spotify spotipy


猜你喜欢
  • 2015-07-10
  • 1970-01-01
  • 2021-06-19
  • 2020-09-30
  • 1970-01-01
  • 1970-01-01
  • 2014-06-13
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多