1
我想要一個vbs腳本來請求YouTube視頻的網址並播放音頻。我有這個迄今爲止用Vbscript提取或播放YouTube音頻
Option Explicit
Dim Msg,Question,PathSound,URL
URL = InputBox("What url would you like to play from?")
PathSound = "URL"
Question = MsgBox(Msg,VbQuestion+VbYesNo,Msg)
If Question = VbYes Then
Call Play(PathSound)
Else
Wscript.Quit()
End If
'**********************************************************
Sub Play(SoundFile)
Dim Sound
Set Sound = CreateObject("WMPlayer.OCX")
Sound.URL = SoundFile
Sound.settings.volume = 100
Sound.Controls.play
do while Sound.currentmedia.duration = 0
wscript.sleep 100
loop
wscript.sleep(int(Sound.currentmedia.duration)+1)*1000
End Sub
'**********************************************************
如果我把一個新的地址,它會播放不同的視頻。 –
@AlienVilliger給我這個新的地址與你一起測試 – Hackoo
https://www.youtube.com/watch?v=y8Kyi0WNg40 –