[YouTube.com] youtube-dl-php - Download Button

For use with: https://github.com/PXgamer/youtube-dl-php

  1. // ==UserScript==
  2. // @name [YouTube.com] youtube-dl-php - Download Button
  3. // @namespace PXgamer
  4. // @version 0.2
  5. // @description For use with: https://github.com/PXgamer/youtube-dl-php
  6. // @author PXgamer
  7. // @include *youtube.com/watch?v=*
  8. // @include *www.youtube.com/watch?v=*
  9. // @require https://code.jquery.com/jquery-3.1.0.min.js
  10. // @grant none
  11. // ==/UserScript==
  12. /*jshint multistr: true */
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. var searchGET = '/youtube-dl-php/tests/$_GET.test.php'; // Your path to GET based implementation (i.e. /tests/$_GET.test.php)
  18.  
  19. var vid_id = location.href.split('watch?v=')[1].split('&')[0];
  20.  
  21. $('#watch8-secondary-actions').append('<div class="yt-uix-menu"><a target="_blank" href="'+searchGET+'?vid_id='+vid_id+'"><button class="yt-uix-button yt-uix-button-size-default yt-uix-button-opacity"><span class="yt-uix-button-content">Download/Parse Video</span></button></a></div>');
  22. })();