Yahoo launch ?!

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
technolust Offline
Junior Member
Posts: 8
Joined: Nov 2004
Reputation: 0
Post: #1
i got some vb script that parses the yahoo launch site and pulls the mms:// urls from videos.
anyone got a script already that uses mms links?
as i am just leaning python for the love of my xbox, any help and praise in the goals of developing this would be apprieciated.
the vb source is from http://web.tampabay.rr.com/dncenter/ this person has already coded the mms extraction for a plugin for meedio (formerly myhtpc a xbmc lookalike for windows )
i have been using this as well http://sourceforge.net/projects/launchripper/ :kickass:
to help create strm files up until now, but a dynamic solution seems to be mere steps away.
now i am not a coder n00b, and not all that familiar with python yet myself. the vb source i understand quite well so far though. so like i said, comments, suggestions, praise, flames, bring 'um.
find quote
solexalex Offline
Skilled Python Coder
Posts: 706
Joined: Jul 2004
Reputation: 6
Post: #2
hi !
i am developping a script that use our database (http://xbmc-stream.gueux.be/) to read some streams.
some of those are mms: protocole.
it is very easy to open those file with xbmc python. it is the same that open a mp3 file or whatever. all kind of streams are open in the same way :
Quote:xbmc.player().play('mms://........url......')

anyway, mms: are soooo slow to launch. it is very sad. try it and tell me. maybe is there a way to accelerate the cache.
see ya
find quote
solexalex Offline
Skilled Python Coder
Posts: 706
Joined: Jul 2004
Reputation: 6
Post: #3
hi !
thx for your post ! i had a look to the software (launchripper)
it is very nice for us in "streampack".
i pm you now !
find quote
technolust Offline
Junior Member
Posts: 8
Joined: Nov 2004
Reputation: 0
Star   
Post: #4
hmm, seems vb2py wont help yet, not current with vb.net yet.

here is that source on the launch ripper already out (in vb un-edited)

Quote:public class vbnetimport
implements meedio.imlimportplugin

public myitem as meedio.imlitem

public dummystring as string
public dummyinteger as integer

private counter as integer

private frmgenre as new frmgenre
private curbandwidth as long
private importgenre as string
private top100 as boolean = false
private newvideos as boolean = false

private exporturllist as boolean
private urllistdir as string

private videoid(20000) as string
private videoname(20000) as string
private videoartist(20000) as string
private videogenre(20000) as string


dim download as string

public sub new()
mybase.new()
end sub

public function editcustomproperty(byval window as integer, byval propname as string, byref value as string) as boolean implements

meedio.imlimportplugin.editcustomproperty
if propname = "importgenre" then
if value.indexof(",blues") <> -1 then
frmgenre.genrelist.setitemchecked(0, true)
end if
if value.indexof(",christian") <> -1 then
frmgenre.genrelist.setitemchecked(1, true)
end if
if value.indexof(",country") <> -1 then
frmgenre.genrelist.setitemchecked(2, true)
end if
if value.indexof(",electronica") <> -1 then
frmgenre.genrelist.setitemchecked(3, true)
end if
if value.indexof(",folk") <> -1 then
frmgenre.genrelist.setitemchecked(4, true)
end if
if value.indexof(",jazz") <> -1 then
frmgenre.genrelist.setitemchecked(5, true)
end if
if value.indexof(",latin") <> -1 then
frmgenre.genrelist.setitemchecked(6, true)
end if
if value.indexof(",new age") <> -1 then
frmgenre.genrelist.setitemchecked(7, true)
end if
if value.indexof(",pop") <> -1 then
frmgenre.genrelist.setitemchecked(8, true)
end if
if value.indexof(",r&b") <> -1 then
frmgenre.genrelist.setitemchecked(9, true)
end if
if value.indexof(",rap") <> -1 then
frmgenre.genrelist.setitemchecked(10, true)
end if
if value.indexof(",reggae") <> -1 then
frmgenre.genrelist.setitemchecked(11, true)
end if
if value.indexof(",rock") <> -1 then
frmgenre.genrelist.setitemchecked(12, true)
end if
if value.indexof(",shows & movies") <> -1 then
frmgenre.genrelist.setitemchecked(13, true)
end if
if value.indexof(",world") <> -1 then
frmgenre.genrelist.setitemchecked(14, true)
end if
if value.indexof(",new videos") <> -1 then
frmgenre.genrelist.setitemchecked(16, true)
end if
if value.indexof(",top 100") <> -1 then
frmgenre.genrelist.setitemchecked(17, true)
end if
dim i as integer
frmgenre.showdialog()
if frmgenre.dialogresult = windows.forms.dialogresult.ok then
value = "genre"
if frmgenre.genrelist.checkeditems.count <> 0 then
for i = 0 to frmgenre.genrelist.checkeditems.count - 1
value = value & "," & frmgenre.genrelist.checkeditems(i)
next
end if
end if
end if
editcustomproperty = true

end function

public function getproperty(byval index as integer, byval prop as meedio.imeediopluginproperty) as boolean implements

meedio.imlimportplugin.getproperty
dim choices(2) as string

if index = 1 then
prop.caption = "streaming bandwidth"
prop.name = "bandwidth"
prop.datatype = "string"
prop.helptext = "sets streaming bandwidth."
prop.defaultvalue = "768"
choices(0) = "768"
choices(1) = "300"
choices(2) = "56"
prop.choices = choices
getproperty = true

elseif index = 2 then
prop.caption = "select genre to import"
prop.name = "importgenre"
prop.datatype = "custom"
prop.helptext = "check the genres that you want to import."
prop.defaultvalue = "genre,country,rock"
getproperty = true

elseif index = 3 then
prop.caption = "export url list."
prop.name = "exporturllist"
prop.datatype = "bool"
prop.helptext = "for use with nettransport." & vblf & "url.lst = list of added videos" & vblf & "urlfull.lst = list of all

videos"
prop.defaultvalue = false
getproperty = true

elseif index = 4 then
prop.caption = "export url list to :"
prop.name = "urllist"
prop.datatype = "folder"
prop.helptext = "folder where url lists will be stored."
prop.defaultvalue = "c:\"
getproperty = true
else
getproperty = false
end if
end function

public function setproperties(byval properties as meedio.imeedioitem, byref errortext as string) as boolean implements

meedio.imlimportplugin.setproperties
curbandwidth = properties("bandwidth")
importgenre = properties("importgenre")
exporturllist = properties("exporturllist")
urllistdir = properties("urllist")

setproperties = true
end function

public function import(byval section as meedio.imlsection, byval progress as meedio.imlimportprogress) as boolean implements

meedio.imlimportplugin.import
dim i as integer
dim bar as integer
dim genre as string
dim addedcounter as integer
section.addnewtag("genre")
section.addnewtag("artist")
section.addnewtag("bw")
section.addnewtag("mmsfile")

' adding views
if section.viewcount = 0 then
section.addnewview("search by genre")
section.views(0).addnewstep("genre")
section.views(0).addnewstep("artist")
section.views(0).steps(1).groupfunction = "index"
section.views(0).addnewstep("artist")
section.views(0).addnewstep("")
section.views(0).steps(3).mode = "view"

section.addnewview("search all")
section.views(1).addnewstep("artist")
section.views(1).steps(0).groupfunction = "index"
section.views(1).addnewstep("artist")
section.views(1).addnewstep("")
section.views(1).steps(2).mode = "view"
end if

if not progress.progress(1, "starting...now") then return false
counter = 0
if importgenre.indexof(",blues") <> -1 then
getvideos("blues", progress)
if not progress.progress(10, "finished blues") then return false ' check cancel
end if
if importgenre.indexof(",christian") <> -1 then
getvideos("christian", progress)
if not progress.progress(10, "finished christian") then return false ' check cancel
end if
if importgenre.indexof(",country") <> -1 then
getvideos("country", progress)
if not progress.progress(10, "finished country") then return false ' check cancel
end if
if importgenre.indexof(",electronica") <> -1 then
getvideos("electronica", progress)
if not progress.progress(10, "finished electronica") then return false ' check cancel
end if
if importgenre.indexof(",jazz") <> -1 then
getvideos("jazz", progress)
if not progress.progress(10, "finished jazz") then return false ' check cancel
end if
if importgenre.indexof(",latin") <> -1 then
getvideos("latin", progress)
if not progress.progress(10, "finished latin") then return false ' check cancel
end if
if importgenre.indexof(",blues") <> -1 then
getvideos("new age", progress)
if not progress.progress(10, "finished new age") then return false ' check cancel
end if
if importgenre.indexof(",pop") <> -1 then
getvideos("pop", progress)
if not progress.progress(10, "finished pop") then return false ' check cancel
end if
if importgenre.indexof(",r&b") <> -1 then
getvideos("r&b", progress)
if not progress.progress(10, "finished r&b") then return false ' check cancel
end if
if importgenre.indexof(",blues") <> -1 then
getvideos("rap", progress)
if not progress.progress(10, "finished rap") then return false ' check cancel
end if
if importgenre.indexof(",reggae") <> -1 then
getvideos("reggae", progress)
if not progress.progress(10, "finished reggae") then return false ' check cancel
end if
if importgenre.indexof(",rock") <> -1 then
getvideos("rock", progress)
if not progress.progress(10, "finished rock") then return false ' check cancel
end if
if importgenre.indexof(",shows & movies") <> -1 then
getvideos("shows", progress)
if not progress.progress(10, "finished shows & movies") then return false ' check cancel
end if
if importgenre.indexof(",world") <> -1 then
getvideos("world", progress)
if not progress.progress(10, "finished world") then return false ' check cancel
end if
if importgenre.indexof(",new videos") <> -1 then
getvideos("new videos", progress)
newvideos = false
end if
if importgenre.indexof(",top 100") <> -1 then
getvideos("top 100", progress)
top100 = false
end if

addedcounter = 0

for i = 1 to counter
myitem = section.finditembyexternalid(videoid(i))
if myitem is nothing then
dummystring = getmms(videoid(i))
if dummystring <> "" then
myitem = section.addnewitem(videoname(i), dummystring)
myitem.externalid = videoid(i)
myitem.tags.values("mmsfile") = mid(dummystring, len(dummystring) - 10)
myitem.tags.values("genre") = videogenre(i)
myitem.tags.values("artist") = videoartist(i)
myitem.tags.values("bw") = curbandwidth
myitem.savetags()
addedcounter = addedcounter + 1
end if
end if
bar = 10 + int(i / counter * 80)
progress.progress(bar, "found : " & videoartist(i) & " - " & videoname(i))
next i

'*******************************************************************************​*
if (exporturllist = true) and (dir(urllistdir, fileattribute.directory) <> "") then
fileopen(1, urllistdir & "\url.lst", openmode.output)
if not progress.progress(90, "exporting urlfull.lst") then
fileclose(1)
return false ' check cancel
end if
for i = 0 to section.itemcount - 1
printline(1, section.items(i).location)
next i
fileclose(1)
end if
progress.progress(100, "finished. found " & counter & "songs. added " & addedcounter & " to library.")
import = true
end function

private sub getvideos(byval genre as string, byref progress as meedio.imlimportprogress)
on error goto errhandler
dim uristring as string
dim mywebclient as new system.net.webclient
dim selectedgenre as integer
dim i as integer ' page numbers
dim x as long
dim y as long
dim t as string

select case genre
case "blues"
selectedgenre = 800
case "christian"
selectedgenre = 1500
case "country"
selectedgenre = 400
case "electronica"
selectedgenre = 900
case "folk"
selectedgenre = 1400
case "jazz"
selectedgenre = 300
case "latin"
selectedgenre = 1100
case "new age"
selectedgenre = 1300
case "pop"
selectedgenre = 100
case "r&b"
selectedgenre = 500
case "rap"
selectedgenre = 600
case "reggae"
selectedgenre = 1200
case "rock"
selectedgenre = 200
case "shows"
selectedgenre = 700
case "world"
selectedgenre = 1000
case "top 100"
top100 = true
case "new videos"
newvideos = true
end select

'counter = 0
i = 0
do
i = i + 1
'change below to allow cancel when getting page
if not progress.progress(10, "getting page " & i & " of genre " & genre) then exit sub
if top100 then
uristring = "http://launch.yahoo.com/musicvideos/lists/top.asp?p=" & i
elseif newvideos then
uristring = "http://launch.yahoo.com/musicvideos/lists/new.asp?p=" & i
else
uristring = "http://launch.yahoo.com/musicvideos/genrehub.asp?genreid=" & selectedgenre & "&p=" & i
end if
mywebclient.headers.add("user-agent", "mozilla/4.0 (compatible; msie 6.0; windows nt 5.2; .net clr 1.0.3705;)")

dim mydatabuffer as byte() = mywebclient.downloaddata(uristring)
dim download as string = system.text.encoding.ascii.getstring(mydatabuffer)

'fileopen(1, "d:\testfile" & i & ".html", openmode.output) ' open file for output.
'write(1, download) ' print text to file.
'fileclose(1)

for x = 1 to len(download)
' find artist
x = instr(x, download, "/artist/default.asp?artistid=", comparemethod.binary)
if x = 0 then
x = len(download)
exit for
end if
x = instr(x, download, ">", comparemethod.binary)
y = instr(x, download, "</a>", comparemethod.binary)
counter = counter + 1
t = mid(download, x + 1, y - x - 1)
t = replace(t, chr(34), "'")
t = replace(t, chr(9), "")
t = replace(t, chr(10), "")
t = replace(t, chr(13), "")
t = replace(t, "&", "&")
t = replace(t, ">", ">")
t = replace(t, "*", "-")
videoartist(counter) = t

' find video id
x = instr(y, download, "jplayvideos(", comparemethod.binary)
y = instr(x, download, ")", comparemethod.binary)
videoid(counter) = mid(download, x + 22, y - x - 22)

' find song name
x = instr(y, download, ">", comparemethod.binary)
y = instr(x, download, "</a>", comparemethod.binary)
t = mid(download, x + 1, y - x - 1)
t = replace(t, chr(34), "'")
t = replace(t, chr(9), "")
t = replace(t, chr(10), "")
t = replace(t, chr(13), "")
t = replace(t, "&", "&")
t = replace(t, ">", ">")
t = replace(t, "*", "-")
videoname(counter) = t
videogenre(counter) = genre
next x
dummyinteger = instr(y, download, "<b>next", comparemethod.binary)

loop until dummyinteger = 0
exit sub
errhandler:
msgbox("error " & err.number & ": " & err.description)
end sub

'***************************************************************************
'*********** get mms link ***********
'***************************************************************************
private function getmms(byval videoid as string) as string
on error goto errhandler2
'**************** state 1 **********************************************
dim uristring as string
dim mywebclient as new system.net.webclient
uristring = "http://today.launch.yahoo.com/player/medialog.asp?vid=" & videoid & "&bw=" & curbandwidth &

"&mf=1&pid=5&p1=&p2=&p3=2&rpid=35&pv=9&bp=windows%20nt&csid=396500551&uid=1419997738&pguid=03b32c1b604e43d6803bba948f2edc66&sk=7d0hi5106

m427406c7c34&fcv=&z=ms.asx"
mywebclient.headers.add("user-agent", "mozilla/4.0 (compatible; msie 6.0; windows nt 5.2; .net clr 1.0.3705;)")

dim mydatabuffer as byte() = mywebclient.downloaddata(uristring)
dim download as string = system.text.encoding.ascii.getstring(mydatabuffer)

'fileopen(1, "c:\state1.txt", openmode.output) ' open file for output.
'write(1, download) ' print text to file.
'fileclose(1)

if instr(lcase(download), "http://") = 0 then
getmms = ""
exit function
end if

'**************** state 2 **********************************************
uristring = download
mywebclient.headers.add("user-agent", "mozilla/4.0 (compatible; msie 6.0; windows nt 5.2; .net clr 1.0.3705;)")

mydatabuffer = mywebclient.downloaddata(uristring)
download = system.text.encoding.ascii.getstring(mydatabuffer)

'fileopen(1, "c:\state2.txt", openmode.output) ' open file for output.
'write(1, download) ' print text to file.
'fileclose(1)

if instr(lcase(download), "mms://") = 0 then
getmms = ""
exit function
end if

getmms = left(download, instr(download, "?") - 1)
exit function
errhandler2:
getmms = ""
end function

end class

so there's a bunch of stuff in here yet to be removed from the meedio plugin, but the parsing of the mmc:// links works near flawlessly. anyone know of something other than vb2py to get this ball rolling?

the vb i can handle, it's the python i am having difficulty wrapping my head around so far. also, in my research i found that i would need urllib2 in order to script the user-agent string. (damn yahoo and their ie preference Stare ) i have yet to see anyone do such in anything i have dissected for xbmc as yet.

i notice this thread has gotten quite a few views, but not a lot of posts. i think i will send solealex my .strm pack i have been working on for the gueux project for use until i sort some code out here. (i have all of the current yahoo launch electronica section parsed into .strm's)
find quote
flash Offline
Senior Member
Posts: 173
Joined: Nov 2004
Reputation: 0
Post: #5
hi guys. just wondering how far ye have gotten. i was actually investigating doing a launch script myself when i came across your posts. has any progress been made. i have done a little bit of investigation and have a pretty good idea of how to get the links in the script and stream into xbmc. no point me doing it though if ye guys are there already though. cheers
find quote
solexalex Offline
Skilled Python Coder
Posts: 706
Joined: Jul 2004
Reputation: 6
Post: #6
i will try to have a look at it tomorrow.
see ya
find quote
technolust Offline
Junior Member
Posts: 8
Joined: Nov 2004
Reputation: 0
Post: #7
(flash @ nov. 15 2004,18:29 Wrote:hi guys. just wondering how far ye have gotten. i was actually investigating doing a launch script myself when i came across your posts. has any progress been made. i have done a little bit of investigation and have a pretty good idea of how to get the links in the script and stream into xbmc. no point me doing it though if ye guys are there already though. cheers
the ifilm script gives a better understanding on how to undertake this project, but the script is still very on the drawing board. any contribution will always be a welcome one.
find quote
flash Offline
Senior Member
Posts: 173
Joined: Nov 2004
Reputation: 0
Post: #8
hi well i'm the one who wrote the ifilm script so i'll look into doing a quick and nasty version for launch and see if i can get things going.
find quote
flash Offline
Senior Member
Posts: 173
Joined: Nov 2004
Reputation: 0
Post: #9
just to let ye know that i have started a launch script and i have it playing videos now. i will do work over the next few days and weekend to get some basic features in and i'll get it out to ye guys after that. cheers.
find quote
technolust Offline
Junior Member
Posts: 8
Joined: Nov 2004
Reputation: 0
Post: #10
well, since it's in progress anyways, thought i'd let you know that http://de.launch.yahoo.com/ and http://uk.launch.yahoo.com/ have different videos than http://launch.yahoo.com/ and all seem to be scripted the same way.
find quote
flash Offline
Senior Member
Posts: 173
Joined: Nov 2004
Reputation: 0
Post: #11
hi.ok i'll have a look at those links..initially i think i will focus on just doing the main site and then it can be customised later on. what would people want to see in a launch browser. what i'm thinking for a first version is
top100
search for artist/song
simple playlist
newest
.....that should be enough for a first version.
there is a lot of information on the site which could be incorporated in later version. like all the artist information on screen and pics like whats on the site.......one step at a time!!
find quote
technolust Offline
Junior Member
Posts: 8
Joined: Nov 2004
Reputation: 0
Post: #12
sounds good, though i wasn't going to even try a search feature in mine, i was just going to have the genre lists and the top 100.
find quote
flash Offline
Senior Member
Posts: 173
Joined: Nov 2004
Reputation: 0
Post: #13
well i'll see how it goes. might not have search but i think it should be fairly straightforward and the site seems to be uniform which is great....less regular expressions....
find quote
solexalex Offline
Skilled Python Coder
Posts: 706
Joined: Jul 2004
Reputation: 6
Post: #14
hi
i would be happy to help ! i am very involved in streaming. these time i have a bunch to do all around, but i can keep a few time for that.
pm me for getting contact with me

see ya

nb: http://xbmc-stream.gueux.be/
find quote
flash Offline
Senior Member
Posts: 173
Joined: Nov 2004
Reputation: 0
Post: #15
and i am happy for you to help. i think just for an inital version i can just get it done quicker myself and then for extra features everybody else can chip in. as long as there is a base script to work on i think that is the way to go. i am probally going to add in a playlist option in the script which will store a list of mms links in a local file. perhaps an option to upload these links to your site would be also nice.
find quote
Post Reply