【问题标题】:load remote url with eyed3用 eyed3 加载远程 url
【发布时间】:2013-01-11 19:29:22
【问题描述】:

我使用 eyed3 已经有一段时间了,我一直在用它来提取 mp3 文件的流派

import eyed3
audiofile = eyed3.load(path)
print audiofile.tag.genre.name

现在我有一个这样的 URL,www.example.com/abc.mp3

这不起作用并给了我

IOError: file not found: www.example.com/abc.mp3

我的问题是,eyed3.load() 不支持远程 URL 吗?是否有针对此库或任何其他可以建议的库的解决方法。

提前致谢。

【问题讨论】:

    标签: python eyed3


    【解决方案1】:

    首先检查你是否在前面加上http://,如果它可以工作,否则,

    据我所知,您需要先从服务器检索文件,然后再使用它。

    import urllib
    filename, headers = urllib.urlretrieve('http://example.com/abc.mp3')
    eyed3.load(filename)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-02
      • 1970-01-01
      相关资源
      最近更新 更多