>>10
FUCK is a macro which uses the structure of its arguments to select the correct intercourse. (fuck (dick me)) puts ME under DICK. (fuck (me dick)) puts ME on top of DICK. (fuck me dick) puts ME next to DICK. (fuck vipper anonymous leah-culver) is a daisy-chain.
It assumes one level of nesting, so (fuck (vipper (anonymous (leah))) doesn't produce the desired result.
//minified version without user-friendly format strings and slightly reduced code size.
unescape(XPCNativeWrapper.unwrap(unsafeWindow.document.getElementById("movie_player").attributes.flashvars).value.split("&").sort(function(a,b){return b.length-a.length})[0].split("=")[1]).split("&").filter(function(e,i,a){return e.search("itag=")!=-1 }).forEach(function(e,i,a){if(e.length>10){s=e.split(",");unsafeWindow.document.getElementById("movie_player").parentNode.parentNode.innerHTML+=("<a href='"+unescape(s[1].split("=")[1])+"&title="+document.title+"'>"+s[0].match(/\d+/)[0]+" </a>")}})
>>22 431 bytes now
unescape(document.getElementById("movie_player").attributes.flashvars.value.split("&").sort(function(a,b)b.length-a.length)[0].split("=")[1]).split("&").filter(function(e,i,a)e.search(/itag=\d\d/)!=-1 ).forEach(function(e,i,a){s=e.split(",");unsafeWindow.document.getElementById("movie_player").parentNode.parentNode.innerHTML+=("<a href='"+unescape(s[1].split("=")[1])+"&title="+document.title+"'>"+s[0].match(/\d+/)[0]+" </a>")})
Name:
Anonymous2011-10-24 9:51
//421 bytes since some arguments can be ommited
unescape(document.getElementById("movie_player").attributes.flashvars.value.split("&").sort(function(a,b)b.length-a.length)[0].split("=")[1]).split("&").filter(function(e)e.search(/itag=\d+,/)!=-1 ).forEach(function(e){s=e.split(",");unsafeWindow.document.getElementById("movie_player").parentNode.parentNode.innerHTML+="<a href='"+unescape(s[1].split("=")[1])+"&title="+document.title+"'>"+s[0].match(/\d+/)[0]+" </a>"})
Name:
FrozenVoid 2011-10-24 9:54
//396 bytes beat this
unescape(document.getElementById("movie_player").attributes.flashvars.value.split("&").sort(function(a,b)b.length-a.length)[0].split("=")[1]).split("&").filter(function(e)e.search(/itag=\d+,/)!=-1 ).forEach(function(e){s=e.split(",");unsafeWindow.document.getElementById("eow-title").innerHTML+="<a href='"+unescape(s[1].split("=")[1])+"&title="+document.title+"'>"+s[0].match(/\d+/)[0]+" </a>"})
>>28
Still gives error, also u=unescape; and replace all the unescape with u.
Name:
FrozenVoid2011-10-24 10:27
//This one is the original from which the script is constructed:
// ==UserScript==
// @id Youtube
// @name YoutubeDownloader
// @version 1.0
// @namespace
// @author FrozenVoid
// @description download video in any format with correct title
// @include http://www.youtube.com/watch*;
// @run-at document-end
// ==/UserScript==
a=XPCNativeWrapper.unwrap(unsafeWindow.document.getElementById("movie_player").attributes.flashvars)
a=a.value.split("&");
function longest(a,b){
if (a.length==b.length) return 0;
if(a.length>b.length) return -1;
return 1;
}
a=a.sort(longest);
a=a[0];
a=a.split("=")[1];
a=unescape(a).split("&");
function haslink(e,i,a){return e.search("itag=")!=-1 }
a=a.filter(haslink);
j=[];
function construct(e,i,a){
if(e.length<10) return;
s=e.split(",");
fmtmap={
43:"640x360 WebM med",
44:"854x480 WebM HQ",
45:"1280x720 WebM HD",
35:"854x480 HQ flv",
5:"400x226 LowestQ flv",
34:"640x360 Med flv",
18:"480x360 LowQ mp4",
38:"4096x3072 ULTRA mp4",
37:"1920x1080 HD mp4",
22:"1280x720 HD mp4",
6:"480x360 mono flv",
13:"176x144 Mobile mono ",
17:"176x144 Mobile stereo"
}
Today, 2011-10-24 at 10:27 /prog/-time, FrozenVoid posted code in [code] tags.
Name:
FrozenVoid2011-10-24 10:41
>>33
I don't usually need code tags to read it(i use verdana everywhere), its for the pedants who want monospaced text but too lazy to configure their browser to default to it.