Skip to content

Instantly share code, notes, and snippets.

@iamtis
Last active January 14, 2016 17:55
Show Gist options
  • Save iamtis/da79400492ce98b153fb to your computer and use it in GitHub Desktop.
Save iamtis/da79400492ce98b153fb to your computer and use it in GitHub Desktop.
download button on YouTube and if it doesn't auto download it will open in a new tab.
// ==UserScript==
// @name Youtube MP3 Download Button
// @namespace http://m2u.xyz
// @version 1.2
// @description Adds a MP3 Download button next to the subscribe button, thanks to youtubeinmp3 for their simple download service (http://youtubeinmp3.com/api/).
// @match http*://www.youtube.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @copyright IamTis inc.
// ==/UserScript==
var linkPath ='http://youtubeinmp3.com/fetch/?video='+encodeURIComponent(document.URL)+"&hq=1";
$( '<a id="youtube2mp3" class="yt-uix-button yt-uix-button-default" href="'+linkPath+'" target="_blank" style="margin-left: 8px; height: 26px; padding: 0 22px; /* background-color: #e62117; */"><img src="http://youtubeinmp3.com/icon/download.png" style="vertical-align:middle;color: white;"> <span class="yt-uix-button-content" style="line-height: 25px; /* font-variant: small-caps; */ font-size: 12px; /* color: #fefefe; */">MP3 Download</span></a>').insertAfter( "#watch7-subscription-container" );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment