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