SHARE
TWEET

Untitled

a guest Jun 14th, 2008 1,137 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           mplaytube
  3. // @namespace      http://untitledfinale.wordpress.com
  4. // @description    play youtube videos with mplayer
  5. // @include        www.youtube.com/*
  6. // ==/UserScript==
  7.  
  8. // YouTube URL: http://www.youtube.com/watch?v=[video_id]
  9. // YouTube download link: http://youtube.com/get_video?video_id=[video_id]&t=[t_id]
  10.  
  11. var download_url = 'http://youtube.com/get_video?video_id=';
  12.  
  13. /*var checker = document.getElementById('watch-checker-div');
  14. if(checker){
  15.    checker.parentNode.removeChild(checker);
  16. }*/
  17.  
  18. var player = document.getElementById('watch-player-div');
  19. var i = player.innerHTML;
  20. var t_id = i.match(/t=([^(\&|$)]*)/)[1];
  21. var video_id = i.match(/video_id=([^(\&|$)]*)/)[1];
  22. var video_url = download_url + video_id + '&t=' + t_id;
  23. var player2 = document.getElementById('movie_player');
  24. player.innerHTML = '<embed type="application/x-mplayer2" src="'+ video_url +'" width="'+player2.width+'" height="'+player2.height+'">';
RAW Paste Data
Challenge yourself this year...
Learn something new in 2017
Top