Created
January 22, 2017 07:37
-
-
Save keisei1092/49f15f60edbdc76b1d7b246068a54cd1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var target = $('.yt-lockup-meta-info'); | |
// top | |
$.each(target, function() { | |
var videoId = $(this).closest('.yt-lockup').data('context-item-id'); | |
var element = '<li><a href="http://localhost:4568/youtube-dl/' + videoId + '" target="_blank">mp3</a>'; | |
$(this).append(element); | |
}); | |
// show | |
if ($('#watch8-secondary-actions') != undefined) { | |
var videoId = $('.yt-uix-videoactionmenu').data('video-id'); | |
$('#watch8-secondary-actions').append('<div class="yt-uix-menu"><a href="http://localhost:4568/youtube-dl/' + videoId + '" target="_blank">mp3</a></div>'); | |
} | |
// show=>related | |
$.each($('.stat.view-count'), function() { | |
var videoId = $(this).closest('a').attr('href').substring(9, 100); | |
$(this).closest('a').append('<span class="stat"><a href="http://localhost:4568/youtube-dl/' + videoId + '" target="_blank">mp3</a></span>'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment