Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Foobar Youtube Radio (Read 56995 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Foobar Youtube Radio

This is my first attempt to make Youtube Radio (based on youtube recommendation). It uses foo_youtube
(Script is only for testing, you should be careful, for me works fine, but who knows, so backup your foobar before you go..).
*Thanks to Marc..



How this work:

When you play video from youtube, it search recommended video from this page(example): http://www.youtube.com/watch?v=oYwL-FzFDKQ
Then select random video from this list(on right), and send one(recommended) video to your playlist.
When first track is finished, foobar open new clip(this recommended video), trigger new, and so on..
You can specify in which playlist 'recommended videos' to be send. You can do this in: ''preferences>shell integration>always send new files to playlist''
If this field is uncheck, all files will be send in your active playlist.

You have option to:
-turn [on/off] ''Youtube Radio''(if you set 'off' you can manualy click on button and select: ''Get Next Video'' or ''Get All Videos'').

''Get All Videos''- will send all recommended videos to your playlist.
''Get Next Video'' - will send one random video to your playlist.
''Search Video'' - will open ''youtube source window'' where you can search for videos..


How to install:
You should first install Wsh plugin 1.5.6. ,
then download youtube buttons: https://www.mediafire.com/?x4n40mh48lpn183
put 'image' folder in foobar profile folder.
After that open new wsh panel and paste this script: http://pastebin.com/xadsrCdB

I would like to know if this is useful for you, i found many new artist with this script...

Foobar Youtube Radio

Reply #1
I had a complete crash of Foobar. Just after click on "Next videos", foobar freezed, mouse blocked and I had to restart Windows (7).
Opening foobar, all configuration was lost. Opening again, everything came back!
It happened on portable foobar.


It doesn't happen to me. What video you last played, when you click ''get next''?
This can be caused by url. Or for some reason foobar can't open that clip, and it stuck..

You can open: 3dydfy://www.youtube.com/ , 3dydfy://youtube.com/ , www.youtube.com/ , youtube.com/ , http://www.youtube.com/ .

Foo_youtube, changes some url's when adding clips, so this can be reason.
When script looks in the url and cant open, it stuck..

I don't remember which video was on. I had made a search, using your script, then I listened to one and clicked to next and...crash! All logs and history have disappeared.
I just made a search again and anything went ok.

I did not understand what happens when YouTube radio is checked.

Foobar Youtube Radio

Reply #2
I had a complete crash of Foobar. Just after click on "Next videos", foobar freezed, mouse blocked and I had to restart Windows (7).
Opening foobar, all configuration was lost. Opening again, everything came back!
It happened on portable foobar.


It doesn't happen to me. What video you last played, when you click ''get next''?
This can be caused by url. Or for some reason foobar can't open that clip, and it stuck..

You can open: 3dydfy://www.youtube.com/ , 3dydfy://youtube.com/ , www.youtube.com/ , youtube.com/ , http://www.youtube.com/ .

Foo_youtube, changes some url's when adding clips, so this can be reason.
When script looks in the url and cant open, it stuck..

I don't remember which video was on. I had made a search, using your script, then I listened to one and clicked to next and...crash! All logs and history have disappeared.
I just made a search again and anything went ok.

I did not understand what happens when YouTube radio is checked.


I repeat all you done, search for video, open in playlist>click 'Get Next'.. All ok.
If i don't know what happen in that point, then i can't fix this.
You should have saved ''crash report'' somewhere in foobar folder...
In console script saves message what video is open: Youtube Radio: <video url>.

Foobar Youtube Radio

Reply #3
I repeat all you done, search for video, open in playlist>click 'Get Next'.. All ok.
If i don't know what happen in that point, then i can't fix this.
You should have saved ''crash report'' somewhere in foobar folder...
In console script saves message what video is open: Youtube Radio: <video url>.


I'll do next time. I hope, never

Foobar Youtube Radio

Reply #4
FWIW: crash reports are stored automatically into a fb2k subdirectory.

You wouldn't have to wait for a program crash's reoccurring if you want to analyze the past one.
This is HA. Not the Jerry Springer Show.

Foobar Youtube Radio

Reply #5
New version 0.0.3. Now you have possibility to stop when clicking on ''Get All Videos''. Just click: ''Abort''.
It adds 20 - 100 tracks in playlist, so be patient until it finish.
http://pastebin.com/ZMZgDU0v

Foobar Youtube Radio

Reply #6
I'll try your new version.
10 minutes ago I had the message "Aw, crashed :-(" while installing the script on my Foobar installed in program files.
Code: [Select]
Scripting Engine Initialization Failed (Youtube Radio by Mire777, CODE: 0x80020101)

Code: [Select]
Error: WSH Panel Mod (Youtube Radio by Mire777): Erreur d'exécution Microsoft JScript:
Un composant ActiveX ne peut pas créer un objet
File: <main>
Ln: 1483, Col: 13
<source text only available at compile time>
Error: WSH Panel Mod (Youtube Radio by Mire777): Erreur d'exécution Microsoft JScript:
Un composant ActiveX ne peut pas créer un objet
File: <main>
Ln: 1483, Col: 13
<source text only available at compile time>
Podcatcher: Auto-archiving old un-downloaded casts.


EDIT
Same error with last script
Code: [Select]
Error: WSH Panel Mod (Youtube Radio by Mire777): Erreur d'exécution Microsoft JScript:
Un composant ActiveX ne peut pas créer un objet
File: <main>
Ln: 1483, Col: 13
<source text only available at compile time>

Foobar Youtube Radio

Reply #7
I found where the error came! Safe Mode was checked!


Foobar Youtube Radio

Reply #9
Here it is  I discover a lot of music!


When I make a search, all the Youtube videos present in my Youtube Tab disappear. How would it possible to keep them? I mean video previously added using Add YouTube URL's

Foobar Youtube Radio

Reply #10
Here it is  I discover a lot of music!
..

Don't know what you exactly mean. You must configure search tab well, right click>hold ctrl key>add to current playlist and play.
If you don't select this, then all your playlist entry will be deleted, when adding new file..

Foobar Youtube Radio

Reply #11
Don't know what you exactly mean. You must configure search tab well, right click>hold ctrl key>add to current playlist and play.
If you don't select this, then all your playlist entry will be deleted, when adding new file..


I did not about right click>hold ctrl key. Thanks
I suppose everybody knows!
I did so, but the video go always to default tab, so I drag it on Youtube tab.

Foobar Youtube Radio

Reply #12
Don't know what you exactly mean. You must configure search tab well, right click>hold ctrl key>add to current playlist and play.
If you don't select this, then all your playlist entry will be deleted, when adding new file..


I did not about right click>hold ctrl key. Thanks
I suppose everybody knows!
I did so, but the video go always to default tab, so I drag it on Youtube tab.


If you talk about script, then.. preferences>shell integration>always send new files to playlist.
Enter your playlist there.. Or Uncheck that, so script will use your active playlist..
If ''youtube tab'' is active all files from 'script search' go there..
For other don't now..

Foobar Youtube Radio

Reply #13
Mire777, if you have time, could you make your YT images for white background?
I'm using it on a new skin (Lure) with white backround.

Foobar Youtube Radio

Reply #14
Mire777, if you have time, could you make your YT images for white background?
I'm using it on a new skin (Lure) with white backround.



Well.. Don't know what you like? Something like this? :






Foobar Youtube Radio

Reply #15
Yes. Thank you
I cannot try now because I did not become more clever from last days. I made something wrong adding the script in the wrong place, so I loosed the volume image existing! I'm installing again the new skin...

Fortunately on the stable foobar I have a bigger Youtube image with colours.

Foobar Youtube Radio

Reply #16
I have now been using the script for about a week and find it useful and that it mostly works well. I suppose the search algorithm may be improved, e.g. sometimes it gets mostly stuck on finding tracks by the same artist or rotating a few and sometimes returns full albums rather than individual tracks - I was thinking in terms of the variety that foo_lastfm_radio used to offer. In fact I originally thought you were going to use lastfm recommendations.

Foobar Youtube Radio

Reply #17
I have now been using the script for about a week and find it useful and that it mostly works well. I suppose the search algorithm may be improved, e.g. sometimes it gets mostly stuck on finding tracks by the same artist or rotating a few and sometimes returns full albums rather than individual tracks - I was thinking in terms of the variety that foo_lastfm_radio used to offer. In fact I originally thought you were going to use lastfm recommendations.


Well, i've already made last.fm radio(separately from this script), and it works..
But this is not perfect..

I'v previously wanted to have last.fm recommendation metod in youtube radio.
But there are certain problems with that.
Last.fm site doesn't have 'static html' response(as i previously think), when my script open last.fm radio page, i don't have nothing i can use as recommendation.
I don't have even a <title>.

If u want to have recommendation from there, you must have open browser, log in there, and start radio, then script can use recommendation.
This is how works..
Last.fm radio must stay open in browser for that..
But there you also have problem, you can't get next track, untill previous track is not finished.
Also if you have last.fm scrobbler, you must turn it off or set that looks only for tracks in library..

I applied this to youtube radio (merge 2 script), tested and this work, but, as i said this is not perfect..

Alternative metod is to use this page as recommendation: http://www.last.fm/music/Madonna/_/Like+a+Prayer/+similar
When YT tracks is open in foobar it look's for simmilar songs..
Problem is that YT clips doesn't always have tags in format: %artist% - %title%. Somethimes it doesnt have nothing. In that case this can't be used..
And radio will stop..

For now, my idea is that you have box, vere you type: %artist% - %title% , then script can play simmilar tracks based on what you gave as start point.
Then looks at this page: http://www.last.fm/music/Madonna/_/Like+a+Prayer/+similar , select random tracks from there: .. open new, and so on..
But this isn't youtube radio, rather this is some hibrid..

The fact is that YouTube recommendation method is not perfect(this is what my script use), and i must find something other..
Think to apply this youtube radio I'v already made, but..

If you have any suggestions they are welcome..

Foobar Youtube Radio

Reply #18
One possibility that came to mind is echonest. It looks like you can get lists of similar artists and their songs according to hotness. There is also API: Similar artist radio – generate a playlist of songs by similar artists. These would need to be set up so that they return all music, i.e. not restricted to music in media library. So a list or playlist or something could be generated, then pick artist-title from that, with bias towards more popular songs if wish, for youtube searching. I presume this could be done in wsh panel mod since other echonest searches can be. There is already an echonest plug-in, http://www.hydrogenaudio.org/forums/index....st&p=855224, but I think this is restricted to generating playlists of music in media library like softplaylists does with lastfm.

HTH or at least provides something to think about.

Foobar Youtube Radio

Reply #19
One possibility that came to mind is echonest. It looks like you can get lists of similar artists and their songs according to hotness. There is also API: Similar artist radio – generate a playlist of songs by similar artists. These would need to be set up so that they return all music, i.e. not restricted to music in media library. So a list or playlist or something could be generated, then pick artist-title from that, with bias towards more popular songs if wish, for youtube searching. I presume this could be done in wsh panel mod since other echonest searches can be. There is already an echonest plug-in, http://www.hydrogenaudio.org/forums/index....st&p=855224, but I think this is restricted to generating playlists of music in media library like softplaylists does with lastfm.

HTH or at least provides something to think about.


I will try echonest..
But think that i can do this with last.fm..
Make some search box, where you type artist.
Ex. ''Florence + the Machine'' > http://www.last.fm/music/Florence+%252B+the+Machine/+similar
Then pick some random artist from there, and search for tracks > http://www.last.fm/music/Ellie+Goulding/+tracks
Pick random track > search youtube video, and open in foobar..

Stay on that page, or:

Open another page > http://www.last.fm/music/Ellie+Goulding/+similar
Pick random artist, and search for tracks > http://www.last.fm/music/Lorde/+tracks
Pick random track > search youtube video, and open in foobar..

Only thing, don't know if this will work as last.fm radio..
And it's little tricky to open multiple pages in same time.

Anyway i will do something with this..

Foobar Youtube Radio

Reply #20
New version: http://pastebin.com/LwdynFk8

Added menu option:

-Open Artist+Title (good if you want to start radio from selected 'artist' in playlist)
-Open In Browser (will search 'artist+title' in browser on youtube)

Foobar Youtube Radio

Reply #21
I Made quick test to implement last.fm recommendation in 'youtube'.
For now everything works fine. Seems it works identical as last.fm radio on web.
Except one.. It's little slower, because script opens 3 web pages(these pages can't be open in same time)..
So next track is available after 30sec playing first track.

It uses metod i described in previous post..
You type artist and script play simmilar artist and songs..
It use random metod.

------------------------------------------------------------------
I have some erors too(if someone can help me)...

Html is in format:

Code: [Select]
<div>
      <a href: ''/music/madonna''


But also have some unaceptable strings:
example:

Code: [Select]
<div>
      <a href: ''/music/http://www.cbs.interactive.com''

or:

<div>
       <li>
           <a href: ''/music/ramones/+images(+videos, +events, +wiki... etc..)


I have replace these strings with ('' ''). But in that case, i recieve:

/music/

Whitch refers me to nothing, and as result i have HTTP: error 404.(not found).
When script not found next track, it plays previous again. This is problem.

I use '/music/' to identify which tags to read, i can not know whether after this is be something that is not artist.
These tags must be skipped completly, from read, to avoid 404..
I apreciate if someone can help, and has solution for this, to skip these tags completly..


Pages i use are:
http://www.last.fm/music/Ramones/+similar
http://www.last.fm/music/Ramones/+tracks


*Edit:
Going more deeply seems that these tags are before ''artist'' tags, so i assume i can ignore them with specify random numbers from max-min.

Foobar Youtube Radio

Reply #22
It seems you solved your issue above.

But I was wondering why you don't use the Similar Artist Radio functionality of echonest? It already seems to return what you want, e.g. see here http://developer.echonest.com/raw_tutorial...api/static.html and here http://developer.echonest.com/raw_tutorial...pi/dynamic.html. I tested it and it works in wsh panel mod. It will be considerably faster than how you are trying to do it with much the same result. All you need to do is to process the json array, and search youtube for the resulting artist – title combinations. Job done! I think your script already has the json_parse functions in it.

HTH

Foobar Youtube Radio

Reply #23
For me its works ok. I do not use Last.fm and cannot tell you more about technical details.
When I click on open 'Artist + Title', the same video appears (normal ?)

I don't know why on a portable install with a skin from russian foobar in search I cannot type two words. The space bar does not work. For example 'english song'. But it's not really a problem. I don't speak russian and cannot ask them

Foobar Youtube Radio

Reply #24
It seems you solved your issue above.

But I was wondering why you don't use the Similar Artist Radio functionality of echonest? It already seems to return what you want, e.g. see here http://developer.echonest.com/raw_tutorial...api/static.html and here http://developer.echonest.com/raw_tutorial...pi/dynamic.html. I tested it and it works in wsh panel mod. It will be considerably faster than how you are trying to do it with much the same result. All you need to do is to process the json array, and search youtube for the resulting artist – title combinations. Job done! I think your script already has the json_parse functions in it.

HTH


Don't know about echonest? I was trying this demo: http://static.echonest.com/demo/dynamic/dynamic.html

Type 'madonna' there, and it returns me the same artist again and again. Last.fm doesn't do this.
It going more deeply. It has 17 pages of diferent artist, maybe more..
Same artist never repeat, or at least, this happen very rarely..

I never try echonest api, this code you see is previously left from (marc2003 script- modified by me),  i used this as a start.
So if i want to do this, then i must to learn first how to use json.
With html is easy..


If you have working code, then all you have to do is to merge these 2 scripts, and your done.
I can do this if you have script..

But my experiance with this demo is bad.
If this work like this, then even youtube recommendation is much better than this..

------------------------------------------------------------------------------------------------
Musikomaniak:

'Open Artist+Title' > will open the same video in your playlist.
If you ex. have song in mp3 format in normal playlist, you can click on this and you will receive video > from where you can start radio for that artist.
It is better than type in search box for same artist..
Or if you listen radio stream, you can also click on this, and you will receive video for that song, which you can downlad later as mp3 
This is because it is added.