Archived Comments (locked)
|
|
The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008) |
|
|
Think you could combine Prevent Autoplay and this script? I would love it. |
|
|
yeah, but sometimes, YouTube will "think" there's not HQ video available, even though there is one, so I have to include the xmlhttprequest as a backup. |
|
|
@avg, if you use this hack, you could probably avoid using an GM_xmlhttpRequest. - http://www.kottke.org/08/11/high-quality-youtub... |
|
|
Great Script!
Thanks |
|
|
sure, i'll work on it when i have some time. by the way, you'd look for |
|
|
Can you make it so YouTube profile videos display in high quality also? (example: www.youtube.com/CBS) The YT CSS uses this.
|
|
|
the cookies probably have an expiry date. (they have that ability unfortunately) |
|
|
i'm using this script because youtube doesn't save my setting! why does it not save my setting? i set my preference to high quality and it works for a few days but eventually resets. i have cookies enabled. using firefox 3. i'm not clearing my cookies either. |
|
|
Yeah dkhal, that does create an image from a string, so the browser doesn't have to connect to a site to get it. And about the former comments... The best way to get var1 is to use avg's method, just put a slash before the & though, like |
|
|
thanks that's quite helpful
|
|
|
one more thing but not about regexp
|
|
|
no here is fine i just want to be informed in some way that you replied (it would be better if they did some sort of inbox here)
|
|
|
ah see someone would tell you use use .split("&") or something, but you'd have to do a couple of splits, arrays, and possibly substrings. this regex formula: /\d+(?=&var2)/ should do the trick on the example you provided for finding the value of var1. for the second number, you can do: /var2=\d+/
// then after you have the matched string, run a :
// .replace("var2=","")
Unfortunately, positive lookbehind isn't supported natively in javascript, so you just have to trim off what you don't want afterwards. for not matching just numbers...../var2=.+(?=&)?/
// then after you have the matched string, run a :
// .replace("var2=","")
As for the dollar-sign... that matches the end of a line, and in URLs there's only one line so I can't see how that's relevant.
FOR mimicking positive lookbehind's effects without treating match afterwardsALSO, I've tried this:, "page.php?var1=1456&var2=8941436".match(/var2=(.+)?(?=&)?/) and using the second part of the array, you get the match you need, only the number. So: "page.php?var1=1456&var2=8941436".match(/var2=(.+)?(?=&)?/)[1] successfully returns what you're looking for. If you need anymore help, please email me instead lol. It's aavindraa@gmail.com. |
|
|
ok that worked quite fine so thanks for both your support
|
|
|
Joe is right, you can use: /\d+/ or /[0-9]+/ Those are your two best choices; i prefer the first. |
|
|
var S = "page.php?var=1456"; var num = S.match(/\d+/); |
|
|
one more quest if you have a string S="page.php?var=1456";
|
|
|
Yeah that's perfect. |
|
|
hey joe, i changed the links to be found with xpath. is that the best xpath "formula" to use? thanks. |
|
|
Cool. but I still think you're being very stubborn about the script source. |
|
|
Ok, but I will compress my scripts regardless :P but about your previous problem with some videos not working, could you please update to this version and see if it works now? it works on my end. This is the video that wasn't working for you. |
|
|
Compressing this script serves no purpose. Dial-up can even download the un-compressed source in one second. |
|
|
this will sum up to 0.0001s (0.1ms) for skipping over all comments and whitespace.That's good enough for me ;) |
|
|
@avg: The compiler, in its very first step of scanning the source code, will execute a loop where it reads from beginning to end character for character and compare it to what it is expecting next (what the syntax and grammar of the language will allow there to be next). If it is inside a comment started with // it will only have to look for the next newline. It will loop and read the next characher and compare it just to [\r|\n] and nothing else until it finds one. This loop is written in C++ and compiled to *optimized* machine code. I would roughly estimate a maximum of 20 clock cycles per character for this loop, outside of a comment it will be a lot more work because more possible options exist and some things have to be stored and compared with each other and a syntax tree has to be built, but inside comments (and whitespace) it can go *very* fast from character to character. If we assume a file with 10k worth of comments and whitespace on a 2GHz Machine this will sum up to 0.0001s (0.1ms) for skipping over all comments and whitespace. This is about the time it takes for your 70Hz CRT monitor to draw 7 (seven) of it's 1024 lines. The removing of this huge ammount whitespace could happen 1000 (thousand) times in a row within one twinkle of the eye (100ms). This all has to be done only once. After scanning, parsing and compiling to bytecode it will then finally be executed by SpiderMonkey, mozilla's JavaScript virtual machine. The only reason for "compressing" scripts this way is when you serve big scripts via slow internet connections (and even here the better solution would be serving it gzipped instead of plain), but slow connections are obviously not the case here. Firefox itself is full of tons of javascript that drive it's user interface and none of it is "compressed" this way. |