Format for youtube playlists
Home › Forums › Help and Support › Format for youtube playlists
- This topic is empty.
-
AuthorPosts
-
December 24, 2010 at 5:02 pm #23240MatokingParticipant
I’m putting together a php script that will let me watch my playlist from wiimc, but I am having a bit of an issue getting wiimc to read the entries.
I tried to goto http://www.wiimc.org/media/youtube.php, but just get a blank page on the computer. Can you post the format for something of this nature?
Please note, I am not looking for a static playlist, instead I want to generate it on my webserver and have wiimc read the playlist from there. Like it does for the youtube links that are already in the onlinemedia.xml file.
December 24, 2010 at 5:37 pm #27646rodriesKeymasterJust generate a playlist in pls, m3u, or plx format. WiiMC doesn’t have its own, special format.
December 24, 2010 at 7:28 pm #27647MatokingParticipantThanks Tantric,
If anyone wants to use this, here is the source and a link to a working example on my box.
<?php
//DEFAULT PLAYLIST DO NOT LEAVE BLANK
//THIS IS USED IF NO PLAYLIST IS SPECIFIED
$playlist='';
if (array_key_exists('playlist',$_GET) && $_GET) {
$playlist=$_GET;
}
$url = 'http://www.youtube.com/view_play_list?p='.$playlist;
$html = file_get_contents($url);
$video_section;
$videos;
$events = null;
$data = null;
$pattern_video_link = '/.*?/s';
preg_match_all($pattern_video_link, $html, $videos);
$videos = $videos[0];
if (array_key_exists('shuffle',$_GET) && $_GET) {
shuffle($videos);
}
echo '#EXTM3U'."n";
for ($i=0; $i<count($videos); $i++) {
preg_match('/title="(?P[^"]*)" href="/(?Pwatch?v=[^&]*)&/s', $videos[$i], $videoData);
echo '#EXTINF:0,'.html_entity_decode($videoData)."n";
echo 'http://www.youtube.com/'.$videoData."n";
}
?>You can add a link to your onlinemedia.xml file like so:
Fell free to use my server to play your playlists, but do respect it. I do reserve the right to ban access if you abuse this service.
December 24, 2010 at 10:28 pm #27648cadbuscaParticipanthttp://www.wiimc.org/forum/viewtopic.php?f=4&t=926
Also I just add my links toa folder in onlinemedia.xml which is now loaded from my PC.
December 25, 2010 at 10:40 pm #27649MatokingParticipantDo you mean to a folder section that you coded into the onlinemedia.xml? I was going to do that, but the thought of adding a couple hundred links to it just was a pain. 😀
This way I just add the videos to my playlist on the youtube site and the script just scrapes those results and returns them in an m3u format. Used with the shuffle, it makes for a very long and interesting episode of sesame street!
December 26, 2010 at 2:46 am #27650cadbuscaParticipantWell my method is to watch them on the WII and if I like them to save the link after playing them. I really don’t want to have to use Youtube onthe PC to find what I want. This puts the links in a savedlinks.xml which I can leave there or copy into a folder within onlinemedia.xml, and if I save those folders on the PC this editing can be done on the PC without having to transfer the files from the WII.
The other method is just to search for the videos I want eg: “Sesame Street” and then AutoPlay Next YouTube. This plays a consecutive string of matching videos and I just press home to skip any that I don’t want to watch. This is the more flexible way that requires no playlist building or editing. The prior link I provided allows more focused searches and that too can be further improved using the YouTube API.
I was not aware of any video shuffle option with video .m3u playlists. How do you make that work?
December 26, 2010 at 3:29 pm #27651MatokingParticipantThe shuffling is taken care of by the php script, it gets all the videos and then shuffles the order. It can lead to back to back playing of the same episode every now and then, but it is not all that often once you get alot of videos in your playlist.
-
AuthorPosts
- The forum ‘Help and Support’ is closed to new topics and replies.