Re: Re: Help With Custom onlinemedia.xml – Youtube

Home › Forums › Help and Support › Help With Custom onlinemedia.xml – Youtube › Re: Re: Help With Custom onlinemedia.xml – Youtube

#27620
stzh
Member

@jhb50 wrote:

Could you explain more? WIIMC already has the user agent set in http.cpp so I don’t understand what you did differently, or what you sent to retreive that playlist, or where you sent the request(wiimc.org or youtube.com)?

Hi jhb50,

I wasn’t planning on changing any cpp source – by ‘spoof my user agent’ I meant that I used https://addons.mozilla.org/en-US/firefox/addon/59/ and set my user agent to ‘WiiMC’, then loaded http://www.wiimc.org/media/youtube.php?q=HDStarcraft in Firefox. All I wanted to know was the format WiiMC expects to receive.

@jhb50 wrote:

I also don’t see anything in the playlist you have retreived by spoofing that will allow you to order by most recent upload. Are you suggesting that the playlist is in that order but the original WIIMC query response has altered that order? I already have an option to sort the query response by name rather than the order returned by WIIMC, and that could be extended.

No, the playlist isn’t in order. As I don’t have the source ‘youtube.php’, the file on this site ( wiimc.org/media/youtube.php ), I’m not quite sure how the playlists are being retrieved, so I have no idea what order the search returns playlists in.

I plan on making my own version that accepts a few more search parameters, at the moment I’m interested in searching for videos by a certain user and having results returned ordered by most recent upload. I will use the Youtube API http://code.google.com/apis/youtube/getting_started.html#data_api and PHP to do this.

For my example: user=HDStarcraft, order_by=published, the API link is:

http://gdata.youtube.com/feeds/base/users/HDstarcraft/uploads?alt=rss&v=2&orderby=published

All I have to do is read that feed and convert it from pretty rss to the simple list format I pasted in my OP.

@jhb50 wrote:

I’d also like to understand how you will use the returned playlist within WIIMC to create your custom playlists?

It will hopefully work just like the wiimc Youtube playlists – be a list of videos for user X ordered by date published. All I really want at this stage is a way for me to watch HDStarcraft replays on my TV, so when I have a break from programming, I’m actually having a break from the computer instead of sitting in the same position.

@jhb50 wrote:

Seems to be lots of potential here. Any thoughts on retreiving the captions/subtitles from youtube too? Thanks.

Yes I agree – what I will hopefully be able to provide sometime today is a PHP file / class that can be queried using more advanced parameters, intended to be used to setup RSS feed-style lists of Youtube users. With a little more work it may become more general.

Captions:

Captions may be retrieved, read more here: http://code.google.com/apis/youtube/2.0/developers_guide_protocol_captions.html#Retrieve_Caption_Set. I would assume WiiMC would need modification in order to be able to read and display these? If given a required format I could write some PHP that took queries and returned captions in said format without difficulty.

Please note that I don’t intend to touch any C++, it’s been many years since I did so, and my job doesn’t permit me the time to get back into it right now. What I intend is a php file to be used in the same way as youtube.php – one will still have to enter the address manually ( though I will look at making a ‘search’ entry and see how I could make that work ) in the onlinemedia.xml file.

Something like this: