使用python脚本streamripper为win32获取外部元数据

时间:2012-11-12 03:52:28

标签: python

嘿我正在使用streamripper for win32。 我已经设置了一个示例python脚本来显示虚拟元数据。 简单的Streamripper不会捡起它。我把它放在与示例相同的格式中: http://streamripper.sourceforge.net/history.php

它对我不起作用。 任何人都知道如何解决?

import time
while 1:
    print 'TITLE=thisname\nARTIST=thisartist\n.\n'
    time.sleep(10)

我把脚本放在streamripper的根目录下。 通过使用:

尝试链接
script.py
c:/program files/streamripper/script.py
c:\\program files\\streamripper\\script.py

示例:

CMD-->
cd c:/program files/streamripper
streamripper http://stream-114.shoutcast.com:80/smoothjazz_skyfm_mp3_96kbps -E script.py

没有用......

1 个答案:

答案 0 :(得分:1)

正确的用法是:

streamrippper URL -E python "path to script"

必须将python添加到windows的环境变量中 perl很方便已经在win32安装上做了,但是python没有

streamripper URL -E perl "path to script"

同样在python中,您必须立即刷新输出 这有效:

import time
import sys

while 1:
    print 'TITLE=thetitle\nARTIST=theartistname\n.'
    sys.stdout.flush()
    time.sleep(10)