Discussion in 'PHP & Perl' started by imperial109, Nov 14, 2009.
Does anyone know of such a script?
Well, scripting languages will not play the divx videos. You need to get a player. You can get the urls with PHP.
how do u get the avi video?
it may be possible to play with the divx web player, but first i'll have to find the divx web api, or to see some examples.
i think im going to cry >}
all i want to know is if there is a way to get the direct link from a video from megavid
i know that the divx web player is not a script and has to be embeded within a script and the url to an avi has to be added to the video code embed that you can get by using php variables by getting the video with a script by putting in the url of the video........but how do you get a script to get the avi video when you put in the url!!!!?
thank you, i hope that clears something up
Yes, it's possible to extract megavideo's video urls. Just emulate what the player does.
For instance, here: http://www.megavideo.com/?v=PDGY09BO
Check the sources and look for "<embed", you'll see "<embed src="http://www.megavideo.com/v/PDGY09BOdd25c9a8fbb2c02157e89cfe73c9dac5" type="......", there is the embed URL of the player.
If you put that URL on the browser, it will 302 redirect to "http://wwwstatic.megavideo.com/mv_player.swf?image=http://img3.megavideo.com/d/d/25c9a8fbb2c02157e89cfe73c9dac5.jpg&v=PDGY09BO", where you can clearly see in the URL the image(background image that shows on the video) and an id, named "v"(short for video would be my guess). Next the player calls this 2 URLs with the "v" id: "http://www.megavideo.com/xml/player_login.php?u=&v=PDGY09BO
" and "http://www.megavideo.com/xml/videoad.php?uid=1258325079240
". As you can see, that's login and ad information, irrelevant. Now, it loads "http://www.megavideo.com/xml/videolink.php?v=PDGY09BO&width=1680&id=1258325433624&u=", which has all the moolah you need. In that data mashup you'll find your video URL.
As for the uid/id param on the last 2 request, I'm not sure where it get's them from, you might want to decompile the flash player and check.
The last two have to do with the megaupload subdomain. If you have ever tried downloaded something and tried to get a direct link, you will see that there is a www plus a number. Such as www569.megauplo......
That's where I'm kinda stuck though
Well, the last URL, the wwwXXX.mega... seems to be the video feed. At least my FireBug was "loading" it while the video loaded; stopped when the video finished loading, thus, it's the feed. This are the returned headers:
Server Apache/1.3.37 (Debian GNU/Linux) PHP/4.4.7
That's the video , but it's on FLV, which is to be expected from a flash player.
So, where are you stuck exactly? Your problems seems solved ? You just need to open the same URLs megavideo opens, in the same order (minus the videoad, since, I doubt you want to promote their ads).
Oh well I appreciate answering my question from above...that's solved. But, I really don't understand half of the stuff you just said. That's why there's the big G though. I'll go look up more things and try to put something together. Unless, you want to contribute to the community, thats fine too. Either way, your awesome, you've been a big help.
You'll have to excuse me for that, I didn't realize.
You can either tell me what you did understand and I'll try to fill in the blanks here, or you may add me to your MSN/AIM/Jabber for a more fluid conversation; either way, I don't mind helping you out.
MSN/AIM: thaorius at thaorius dot c0m
Before we move forward, 3 question for you to answer:
1) Do you want to host the files yourself or directly stream from megavideo?
2) How do you want to provide the stream? You want the user to see his movie player on the browser, or you want an standard Flash video player on your web just like that of megavideo?
3) Is there a specific reason you don't want to user megavideo's flash player? Since that would be the easiest solution.
1. Stream from megavideo
2. I would like to use the DivX player
3. I don't like their ads and the autoplay is useless
Oh well, you won't be able to use a DivX player and stream from megavideo at the same time since megavideo has it's feeds in FLV. So, your choices are:
1) Stream from megavideo and use a custom Flash player
2) Store the files yourself, convert them to DivX (see the documentation of ffmpeg for this), and play them on the user's DivX player.
I suppose you prefer the first one, case in which you'll be needing someone to customize an existing Flash player (you will have to provide it's source code), or get a new one programmed from scratch (this will be quite expensive).
As for what the Flash player must do, it should download the videolink.php?..., mount the wwwXXX.mega... URL with the data returned by the server on videolink.php, and set it's video feed URL to that wwwXXX.mega... URL. Then it would just do what it normally does, play the movie.
You can find .avi files on the two mega sites so DivX should be possible
Frankly, I've never used megavideo, so I didn't know. Also, .avi doesn't mean DivX. AVI is just a container, a thin wrapper, a box, the paper that wraps the candy. You would need to inspect the actual video files and see in what format are they.
Now, shouldn't you be able to just pull the .avi URL from the video page?
you can use built in php fuction preg_match to fetch video url's from megavideo and store them on your server . pretty easy if you are good with programming .
Looks like you know something that I don't....care to share?
i have custom script for megavideo divx web player , using premium account ! if u are interested pm me and il provide demo , Tanks
Separate names with a comma.