Format for youtube playlists

Home Forums Help and Support Format for youtube playlists

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #23240
    Matoking
    Participant

    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.

    #27646
    rodries
    Keymaster

    Just generate a playlist in pls, m3u, or plx format. WiiMC doesn’t have its own, special format.

    #27647
    Matoking
    Participant

    Thanks 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);<br /> echo '#EXTINF:0,'.html_entity_decode($videoData)."n";<br /> echo 'http://www.youtube.com/'.$videoData."n";<br /> }<br /> ?>

    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.

    #27648
    cadbusca
    Participant

    http://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.

    #27649
    Matoking
    Participant

    Do 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!

    #27650
    cadbusca
    Participant

    Well 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?

    #27651
    Matoking
    Participant

    The 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.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Help and Support’ is closed to new topics and replies.

Login

Lost Password