2015-10-02 15:31:51 +02:00
|
|
|
// ==UserScript==
|
|
|
|
// @name Zippyshare
|
2015-10-02 16:18:54 +02:00
|
|
|
// @description Zippyshare download URL to Wget command
|
2015-10-02 15:31:51 +02:00
|
|
|
// @version 1.0
|
|
|
|
// @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-10-02 15:31:51 +02:00
|
|
|
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
|
|
|
|
// @match http://*.zippyshare.com/*
|
|
|
|
// @grant none
|
|
|
|
// ==/UserScript==
|
|
|
|
|
|
|
|
AdiUserscriptLib.addButton('Wget Cmd', function () {
|
|
|
|
var vars = {}
|
2015-10-14 16:07:36 +02:00
|
|
|
var commandline = 'wget -cO "{name}" --header="Cookie: JSESSIONID={sessioncookie}" {url}\ntouch -d "{date}" "{name}"\n'
|
2015-10-02 15:31:51 +02:00
|
|
|
var commands = ''
|
|
|
|
|
|
|
|
vars.name = $('font:contains("Name: ") + font').text()
|
|
|
|
vars.url = $('a#dlbutton')[0].href
|
|
|
|
vars.date = $('font:contains("Uploaded:") + font').text()
|
2015-10-14 14:27:12 +02:00
|
|
|
vars.sessioncookie = prompt('Session Cookie (is HttpOnly)?')
|
2015-10-02 15:31:51 +02:00
|
|
|
|
|
|
|
// Fix date
|
|
|
|
var datematch = vars.date.match(/^(\d{2})-(\d{2})-(\d{4})(.+)/)
|
|
|
|
vars.date = AdiUserscriptLib.interpolate('{3}-{2}-{1}{4}', datematch)
|
|
|
|
|
2015-10-14 16:07:36 +02:00
|
|
|
commands += AdiUserscriptLib.interpolate(commandline, vars)
|
2015-10-02 15:31:51 +02:00
|
|
|
|
|
|
|
var w = window.open();
|
|
|
|
w.document.write('<pre>' + commands + '</pre>')
|
|
|
|
w.document.close()
|
|
|
|
})
|