Maybe no error : wiki start with message : " Wikipedia does not here an article with this exact name "
Code: Select all
;MODIFIED= 20200215 ActiveX added and show wiki from artist when VLC title changed
; Internet Radio a test for XML read : creator(RadioName) and location(URL)
; SEARCH added
; add filexml.txt https://easyupload.io/mankzf xmlfile from ahk user markc63
; this file should be updated / some adress are double
; from user markc63 : to create the playlist I installed TuneIn plugin vlc player,
; trial and error to install but once done goto playlist in view menu it should then show TuneIn on the left-hand side of vlc,
; select music, select genre (all need to be expanded for all channels, each list as more stations click this,
; once that's done right click on music folder and click add to playlist, then under media menu in vlc click save playlist to file
;CREATED = 20200207
/*
;https://www.internet-radio.com/stations/50s/
;http://www.radio-browser.info/gui/#!/search
;http://www.radio-browser.info/backups/?C=M;O=D
;http://streamripper.sourceforge.net/tutorialconsole.php
;---------------------------------
;https://easyupload.io/mankzf xmlfile from ahk user markc63 ( filexml.txt )
;https://cms.tunein.com/sitemap/
;https://tunein.com/radio/50s-g390/
;https://tunein.com/radio/Addictive-50s-s166793/
;http://opml.radiotime.com/Tune.ashx?id=s166793
;http://opml.radiotime.com/Browse.ashx?id=g390&formats=aac,html,mp3,wma,wmpro,wmvideo,wmvoice&partnerId=k2YHnXyS&username=user
*/
#warn
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%
SetTitleMatchMode 2
SetBatchLines, -1
CoordMode, Mouse , Relative ;- GUI
DetectHiddenWindows, On
;gosub,radiostations
filexml=%a_scriptdir%\filexml_test.txt
ifnotexist,%filexml%
gosub,fortest
gosub,readxml
filename1=Internet Radio ( use ESC for SOUND ON/OFF )
vlcx =%A_programfiles%\VideoLAN\VLC\vlc.exe
title:=""
lasttitle:=""
HK1=Esc
Hotkey,%hk1%,mute1,ON
STREAMRIPPER=%A_scriptdir%\streamripper.exe
loop,%streamripper%,1
STRP=%A_LoopFileShortPath%
R3S=%A_scriptDir%\_STREAM
ifnotexist,%R3S%
FileCreateDir,%R3S%
Gui,3:default
Gui,3: -DPIScale
Gui,3:color,black,black
wa:=A_screenwidth
ha:=A_screenHeight
xx:=100
;- maybe change fontsize
;============ GUISIZEx DPIx 4Kx 3840*2160 is 100% ============
if (wa=3840)
Gui,3:Font,s12 cYellow,Lucida Console
;============ GUISIZEx DPIx FHD 1920*1080 is 100% ============
if (wa=1920)
Gui,3:Font,s10 cYellow,Lucida Console
;=============================================================
;xxa=Shell.Explorer ;- IExplorer
xxa=Mozilla.Browser ;- Mozilla Firefox
x:=(wa*.2)/100,y:=(ha*.2)/100,h:=(ha*48)/100,w:=(wa*53)/100
Gui,3: Add, ActiveX, w%w% h%h% x%x% y%y% -Border vWB,%xxa%
WB.Silent := True
;xURL =https://en.wikipedia.org/wiki/
;myClip =Elvis Presley
;navURL := xURL . myClip
;WB.Navigate(navURL)
x:=(wa*54)/100,y:=(ha*1)/100,h:=(ha*48)/100,w:=(wa*15)/100
Gui,3:Add, ListView,x%x% y%y% w%w% h%h% +hscroll BackgroundTeal altsubmit vB1 gB2,Name|URL
T1:=(wa*14)/100
T2:=(wa*0 )/100
LV_ModifyCol(1,T1)
LV_ModifyCol(2,T2)
GoSub,FLVB1
x:=(wa*.2)/xx,y:=(ha*50)/xx,h:=(ha*2.5)/xx,w:=(wa*7)/xx
Gui,3:add,Button,x%x% y%y% h%h% w%w% gInternetRadio,InternetRadio
x:=(wa*8)/xx
Gui,3:add,Button,x%x% y%y% h%h% w%w% gRadioBrowser ,RadioBrowser
x:=(wa*16)/xx
Gui,3:add,Button,x%x% y%y% h%h% w%w% gCloseVLC ,Close-Audio
x:=(wa*.1)/xx,y:=(ha*53)/xx,h:=(ha*2.5)/xx,w:=(wa*50)/xx
Gui,3:add,Edit,x%x% y%y% h%h% w%w% vED1
y:=(ha*56)/xx
Gui,3:add,Edit,x%x% y%y% h%h% w%w% vED2
y:=(ha*59)/xx,w:=(wa*14)/xx
Gui,3:add,Edit,x%x% y%y% h%h% w%w% vED3
x:=(wa*15)/xx,w:=(wa*5)/xx
Gui,3: Add, Progress,x%x% y%y% h%h% w%w% Disabled BackgroundRed
Gui,3: Add, Text, xp yp wp hp BackgroundTrans 0x201 +Border gRecord,Record
x:=(wa*22)/xx,w:=(wa*4)/xx
Gui,3:add,Edit,x%x% y%y% h%h% w%w% right vED4 ; numbers i
x:=(wa*28)/xx,
Gui,3:Add,Text, x%x% y%y% , Search:
x:=(wa*32)/xx,w:=(wa*10)/xx
Gui,3:add,Edit, x%x% y%y% w%w% h%h% vSearchx gSearchA ; search
;---------
x:=(wa*.2)/100,y:=(ha*.2)/100,h:=(ha*64)/100,w:=(wa*71)/100
Gui,3:show,x%x% y%y% w%w% h%h%,%filename1%
Guicontrol,3:,ED4,%i%
GuiControl,3: Focus,searchx
settimer,aatimer,5000
gosub,aatimer
return
;-----------
searcha:
Gui,3:ListView, B1
GuiControlGet, Searchx
GuiControl,3: -Redraw, B1
LV_Delete()
i:=0
For Each, Name In LVArray
{
If (Searchx != "")
{
;If (InStr(name.1, Searchx) = 1) ; for matching at the start
If InStr(name.1, Searchx) ; for overall matching
{
LV_Add("",name.1, name.2)
i++
}
}
Else
{
LV_Add("", name.1,name.2)
i++
}
}
GuiControl,3: +Redraw, B1
Guicontrol,3:,ED4,%i%
GuiControl,3: Focus,searchx
return
;-----------------------------
mute1:
soundset,+1,master,mute
return
InternetRadio:
run,https://www.internet-radio.com/stations/50s/
return
RadioBrowser:
run,http://www.radio-browser.info/gui/#!/search
return
record:
Guicontrolget,ed3
stringtrimleft,edx,ed3,7
if edx contains :
{
;run,%COMSPEC% /K %strp% %ed3% -c -t -d "%R3S%"
ifexist,%strp%
run,%COMSPEC% /K %strp% %ed3% --xs_padding=5000:5000 -c -t -d "%R3S%"
;run,%strp% %ed3% -c -t -d "%R3S%"
}
return
;----------------------------
FLVB1:
Gui, 3:ListView, B1
LV_Delete()
LVArray := {}
I:=0
Loop,parse,e1x,`n,`r
{
x:=a_loopfield
if x=
continue
stringmid,xp1,x,1,1
if (xp1=";") ;- don't read beginning with ";"
continue
c1=
c2=
stringsplit,C,x,`;
c1=%c1%
c2=%c2%
LV_Add("",c1,c2)
LVArray.Push({1:c1,2:c2})
i++
}
;LV_ModifyCol(1, "Logical SortAsc") ;- maybe sort column-1
return
;----------------------------
B2:
Gui,3:ListView, B1
GuiControlGet,B1
RN:=LV_GetNext("C")
RF:=LV_GetNext("F")
GC:=LV_GetCount()
if A_GuiEvent = Normal
{
LV_GetText(C1,A_EventInfo,1)
LV_GetText(C2,A_EventInfo,2)
ifexist,%vlcx%
{
try
{
;Process, Exist, vlc.exe
;If ErrorLevel
; process,close,vlc.exe
run,%vlcx% --one-instance --qt-start-minimized %c2%,,hide,
}
catch
msgbox, 262208,ERROR ,CHECK PATH %vlcx%
}
Guicontrol,3:,ED1, %C1%
Guicontrol,3:,ED2,
Guicontrol,3:,ED3, %C2%
settimer,aatimer,ON
gosub,aatimer
}
return
;----------------------------
;----------------------------
aatimer:
;WinGetTitle, Title1, VLC media player ahk_exe vlc.exe
WinGetTitle, Title1,ahk_exe vlc.exe
title1=%title1%
stringreplace,title,title1,VLC media player,,
Guicontrol,3:,ED2,%title%
if (title1 != lasttitle)
{
;msgbox, 262208, , webpage changed!,1
;title1=Eartha kitt - Under the Bridges of Paris - ;- this is in ED2
stringsplit,b,title1,-
b1=%b1%
StringUpper,b1,b1,T
stringreplace,b1,b1,%a_space%,_,all
url:="https://en.wikipedia.org/wiki/" . b1
WB.Navigate(url)
}
else
{
;msgbox, 262208, , no change!,1
}
lasttitle := title1
return
;----------------------------
closevlc:
Process, Exist, vlc.exe
If ErrorLevel
{
process,close,vlc.exe
Guicontrol,3:,ED1,
Guicontrol,3:,ED2,
settimer,aatimer,off
}
return
;----------------------------
3Guiclose:
settimer,aatimer,OFF
Process, Exist, vlc.exe
If ErrorLevel
{
msgbox, 262435,Radio-Close,Want you close also Audio ?
ifmsgbox,NO
exitapp
ifmsgbox,Cancel
return
else
{
process,close,vlc.exe
exitapp
}
}
else
exitapp
return
;----------------------------
fortest:
e3x=
(Ltrim Join`r`n
<track>
<location>http://opml.radiotime.com/Tune.ashx?id=s166793&formats=aac,html,mp3,wma,wmpro,wmvideo,wmvoice&partnerId=k2YHnXyS&username=user</location>
<title>Royal Teens - Believe Me</title>
<creator>Addictive 50s (Canada)</creator>
<info>http://opml.radiotime.com/Browse.ashx?id=g390&formats=aac,html,mp3,wma,wmpro,wmvideo,wmvoice&partnerId=k2YHnXyS&username=user</info>
<image>file:///C:/Users/mark/AppData/Roaming/vlc/art/arturl/908ea30cc61053ee87e5a9bd24796493/art</image>
<extension application="http://www.videolan.org/vlc/playlist/0">
<vlc:id>0</vlc:id>
</extension>
</track>
<track>
<location>http://opml.radiotime.com/Tune.ashx?id=s65671&formats=aac,html,mp3,wma,wmpro,wmvideo,wmvoice&partnerId=k2YHnXyS&username=user</location>
<title>Brian Hyland - Sealed With A Kiss</title>
<creator>GotRadio</creator>
<info>http://opml.radiotime.com/Browse.ashx?id=g390&formats=aac,html,mp3,wma,wmpro,wmvideo,wmvoice&partnerId=k2YHnXyS&username=user</info>
<image>file:///C:/Users/mark/AppData/Roaming/vlc/art/arturl/908ea30cc61053ee87e5a9bd24796493/art</image>
<extension application="http://opmlwww.videolan.org/vlc/playlist/0">
<vlc:id>0</vlc:id>
</extension>
</track>
)
filexml=%a_scriptdir%\filexml_test.txt
ifnotexist,%filexml%
fileappend,%e3x%,%filexml%
return
;----------------------
READXML:
fileread,e4x,%filexml%
dl:=";"
aa=<location>
bb=<creator>
e1x:=""
e2:=""
s:=""
;-- add these first to the list
/*
e1x=
(
ch_News DRS4;http://stream.srg-ssr.ch/drs4news/mp3_128.m3u
de_NEWS DLF;https://www.deutschlandradio.de/streaming/dlf.m3u
)
*/
loop,parse,e4x,`n,`r
{
lr:= a_loopfield
if lr=
continue
if lr contains <track>
s=1
if lr contains </track>
s=0
if (s=1)
{
if lr contains %bb%
{
lr:=RegExReplace( lr, "<.*?>" )
stringreplace,lr,lr,`;,,all
stringreplace,lr,lr,',,all
stringreplace,lr,lr,&,,all
e1x .= lr . dl . e2
e2=
}
if lr contains %aa%
{
lr:=RegExReplace( lr, "<.*?>" )
StringSplit, c,lr,&
e2 .= c1 . "`r`n"
}
}
}
;msgbox,%e1x%
return
;-----------------------------------------------
/*
radiostations:
e1x=
(Ltrim join`r`n
us_50 1-Canada;http://opml.radiotime.com/Tune.ashx?id=s166793
us_50 ABC 50s;http://144.217.253.136:8582
us_50 DreamBoat;http://146.71.124.10:8100
us_50 UK 1950s;http://91.121.134.23:8648
us_50 HD Radio;http://167.114.64.181:8360
us_Country HPR-1;http://188.165.192.5:8374
pt_Portugal Fado Radio Caprice-Fado;http://79.111.14.76:9189
pt_Portugal sounds of;http://91.121.78.191:8541
jp_Oldies Japan;http://66.70.187.44:9069
lt_World PMR LT;http://185.193.112.155:18638
sv_Folk Sverige Svensk Folkmusic;http://82.94.205.73:8107
ch_News DRS4;http://stream.srg-ssr.ch/drs4news/mp3_128.m3u
de_NEWS DLF;https://www.deutschlandradio.de/streaming/dlf.m3u
)
return
*/
;==============================================