27 lines
859 B
JavaScript
27 lines
859 B
JavaScript
// ==UserScript==
|
|
// @name HulkShare
|
|
// @description HulkShare download URL to Wget command
|
|
// @version 1.0
|
|
// @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 http://*.hulkshare.com/*
|
|
// @grant none
|
|
// ==/UserScript==
|
|
|
|
AdiUserscriptLib.addButton('Wget Cmd', function () {
|
|
var vars = {}
|
|
var commandline = 'wget -cO "{name}" --referer="{ref}" {url}\n'
|
|
var commands = ''
|
|
|
|
vars.name = $('b.nhsTrackTitle').text()
|
|
vars.url = $('button.nhsGrayBtnSmDownload').attr('href')
|
|
vars.ref = window.location.href
|
|
|
|
commands += AdiUserscriptLib.interpolate(commandline, vars)
|
|
|
|
var w = window.open();
|
|
w.document.write('<pre>' + commands + '</pre>')
|
|
w.document.close()
|
|
})
|