Sign up here and you can log into the forum!

Development Guide

youtube/live365/pandora/flickr replacements & other web services

Development Guide   

Postby CrashX » Mon May 17, 2010 5:36 am

I am trying to understand how to write my own plug-ins for WDTVL Proxy. I have looked youtubeHD.php and easynews.php. I see the following is the main logic:

Code: Select all
#
if ($_GET['url']) {
#
streamproxy(); # stream video via proxy
#
} elseif ($_GET['id']) {
#
getvideolink(); # video link is requested
#
} else {
#
getvideolist(); # video list request
#
}


Code: Select all
#
if ( $_SERVER['REQUEST_METHOD'] === 'POST' ) {
#
  postreq();
#
} else {
#
  if ($_GET['id']) {
#
    getvideo();
#
  }
#
  else {
#
    videolist();
#
  }
#
}


I was wondering if someone could explain how it executes php script ? How many times ?
CrashX
Global Moderator
 
Posts: 143
Joined: Thu Apr 15, 2010 9:04 am

Re: Development Guide   

Postby rezmus » Mon May 17, 2010 10:55 am

these are just the functions defined below (inside php file) and called on specific event. all communication is done using yt api http://code.google.com/apis/youtube/2.0/reference.html so you have to translate all api requests to what you need (tcpdump is your friend).
rezmus
Developer
 
Posts: 111
Joined: Mon Apr 05, 2010 8:40 pm

Re: Development Guide   

Postby CrashX » Mon May 17, 2010 11:53 am

rezmus wrote:these are just the functions defined below (inside php file) and called on specific event. all communication is done using yt api http://code.google.com/apis/youtube/2.0/reference.html so you have to translate all api requests to what you need (tcpdump is your friend).


Haven't you mapped all api calls inside the php ? Which ones have you handled ?

Let me get this straight, the youtubeHD.php is acting like a proxy between youtube server and wdtvlive( youtube api ). If I was to write a plugin, then must be based on youtube api.

So I take it also that you can only run one plugin ? Also youtube icon can't be changed ?
CrashX
Global Moderator
 
Posts: 143
Joined: Thu Apr 15, 2010 9:04 am

Re: Development Guide   

Postby rezmus » Mon May 17, 2010 12:31 pm

in youtube hd proxy all api calls are more or less forwarded to gdata server (except some feed modification to trick restricted videos and different video quality url scraping). depends on what u would like to do u need to handle some stuff, there are 3 groups of reqests:
- video lists
- video url
- post (rating, flaging, add to playlist, etc.)

check rewrite rules to see all api calls used by dmaosd.

you can only use one proxy plugin at the time, that what youtube switcher is for, but you can easily write wdtvext plugin that adds new menu item for each service and use it's handler to switch used proxy (replace what youtube switcher does). so u will never feel like u have just one proxy running coz it will switch automaticly each time you enter other online video service menu.
rezmus
Developer
 
Posts: 111
Joined: Mon Apr 05, 2010 8:40 pm

Re: Development Guide   

Postby CrashX » Mon May 17, 2010 12:58 pm

Thanks for taking your time to respond to my questions. Can you clarify a bit more if you don't mind plz ?

rezmus wrote:in youtube hd proxy all api calls are more or less forwarded to gdata server (except some feed modification to trick restricted videos and different video quality url scraping). depends on what u would like to do u need to handle some stuff, there are 3 groups of reqests:
- video lists
- video url
- post (rating, flaging, add to playlist, etc.)


video lists
-> Return list of URL to display ? What about images ?
video url
-> Return the url used to play the file ?

rezmus wrote:check rewrite rules to see all api calls used by dmaosd.


Where do I find that ?
CrashX
Global Moderator
 
Posts: 143
Joined: Thu Apr 15, 2010 9:04 am

Re: Development Guide   

Postby rezmus » Tue May 18, 2010 5:53 am

videos list includes links to thumbs, refer to yt gdata reference guide or just play with gdata.youtube.com api using browser (check source xml code). for rewrite rules check webserver configs (lighttpd or apache whatever u use).
rezmus
Developer
 
Posts: 111
Joined: Mon Apr 05, 2010 8:40 pm


Return to WDTVL Proxy Project

Who is online

Users browsing this forum: No registered users and 1 guest