27 lines
819 B
JavaScript
27 lines
819 B
JavaScript
// ==UserScript==
|
|
// @name Mixcloud
|
|
// @description Extract Mixcloud Track Links
|
|
// @version 1.0.1
|
|
// @namespace http://www.adrian.kousz.ch/
|
|
// @require https://git.adrian.kousz.ch/adrian/userscripts/raw/master/lib.js
|
|
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
|
|
// @match https://www.mixcloud.com/*
|
|
// @grant none
|
|
// ==/UserScript==
|
|
|
|
AdiUserscriptLib.addButton('DL Cmds', function () {
|
|
var vars = {}
|
|
var commandline = 'youtube-dl https://www.mixcloud.com{url}\n'
|
|
var commands = ''
|
|
|
|
$('.play-button').each(function () {
|
|
vars.url = $(this).attr('m-url')
|
|
if (!vars.url) return
|
|
commands += AdiUserscriptLib.interpolate(commandline, vars)
|
|
})
|
|
|
|
var w = window.open();
|
|
w.document.write('<pre>' + commands + '</pre>')
|
|
w.document.close()
|
|
})
|