Jump to content

For those saw #KH119 's segment on using #VLC to download YouTube and are looking to dig deeper ...


G+_Jeff Brand
 Share

Recommended Posts

For those saw #KH119's segment on using #VLC to download YouTube and are looking to dig deeper into how VLC does this, take a look at the link below.

 

This is the Lua script that is used to parse a #YouTube page and find the video parameters. If you look at other files in that directory of the source, you can see other websites that it knows how to parse.

 

Some have also observed that the player can't retrieve /all/ URLs. This is because of the constant cat-and-mouse game between direct downloaders and Google/YouTube. The URL signature deobfuscation, a version of which is provided in the Lua script, is an evolving puzzle.

 

Only some videos use signatures; I haven't looked into the reason, though I imagine it's associated with advertising options.

 

One final note: In my own pursuit to "know how" VLC's mechanism worked, I ported the script into a PHP class which can successfully retrieve non-obfuscated URLs. If there's any interest, I will publish the script at some point in the near future.

 

While there may be other scripts that do the same thing, my effort was to try to be a 1:1 port of the VLC Lua script.

 

Hope this helps.

http://www.videolan.org/developers/vlc/share/lua/playlist/youtube.lua

Link to comment
Share on other sites

 Share

×
×
  • Create New...