|
Page 1 of 1 |
|
Posted: Mon, 23rd Aug 2010 15:49 Post subject: Youtube quality |
|
 |
I got an issue with Youtube:
Although I set my settings in Youtube to "Always play videos at the highest quality available" option, every video I watch starts at the lowest resolution. If I want to change to 720p or so, I have to do it manually EVERY fucking time.
Is there something you can do about this?
|
|
Back to top |
|
 |
TSR69
Banned
Posts: 14962
Location: Republic of the Seven United Provinces
|
|
Back to top |
|
 |
|
|
Back to top |
|
 |
|
Posted: Tue, 24th Aug 2010 08:21 Post subject: |
|
 |
|
|
Back to top |
|
 |
LeoNatan
☢ NFOHump Despot ☢
Posts: 73231
Location: Ramat HaSharon, Israel 🇮🇱
|
|
Back to top |
|
 |
|
Posted: Tue, 24th Aug 2010 15:01 Post subject: |
|
 |
I already tried that, because that's how I got your Nfohump script running with Opera. But the youtube one doesn't work somehow...
“The only way to deal with an unfree world is to become so absolutely free that your very existence is an act of rebellion.”
- Albert Camus
|
|
Back to top |
|
 |
LeoNatan
☢ NFOHump Despot ☢
Posts: 73231
Location: Ramat HaSharon, Israel 🇮🇱
|
Posted: Tue, 24th Aug 2010 15:06 Post subject: |
|
 |
I think I know why. Try this:
Spoiler: | Code: | // ==UserScript==
// @name YouTube HD Lite
// @description Automatically plays the best quality YouTube video format and removes ads, plus several optional features
// @include http://www.youtube.com/watch?*
// @version 2.7
// ==/UserScript==
// Optional Features
var use1080p = true,
use720p = true,
wideVideo = true,
hideAnnotations = false,
hideWarnings = true,
scrollToVideo = true,
bufferNoAutoplay = false,
oldPlayer = false,
changePlayerColor = false;
// for console debug messages
var debug = false;
function $(A) {
return document.getElementById(A);
}
document = unsafeWindow.document; // required!
var player = $("movie_player"),
vidTitle = $("watch-headline-title"),
config = unsafeWindow.yt.config_;
var playEntireList = config.SWF_IS_PLAYING_ALL,
flashvars = player.getAttribute("flashvars");
// use old Youtube player?
if (oldPlayer) {
player.src = config.SWF_CONFIG.url_v9as2;
}
function setFlashvar(field, newVal) {
var delimited = "&" + field;
if (flashvars.indexOf(delimited) == -1) {
// field not found, so append it
flashvars += delimited + "=" + newVal;
}
else {
// modify existing field
var tmp = flashvars.split(delimited);
var tmp2 = tmp[1].indexOf("&");
if (tmp2 != -1) {
flashvars = tmp[0] + delimited + "=" + newVal + tmp[1].substr(tmp2);
}
else {
flashvars = tmp[0] + delimited + "=" + newVal;
}
}
}
/****************************************************************
// 2009.12.16 list of formats from GIJoe's Youtube Enhancer script
// fmt=0 -> flv: 320x 240 (flv1) / mp3 1.0 22KHz [ ] (same as fmt=5)
// fmt=5 -> flv: 320x 240 (flv1) / mp3 1.0 22KHz [small ]
// fmt=6 -> flv: 480x 360 (flv1) / mp3 1.0 44KHz [ ] (No more...)
// fmt=13 -> 3gp: 176x 144 (H263) / AMR 2.0 8KHz [ ] (for cellphone)
// fmt=17 -> 3gp: 176x 144 (mpg4) / AAC 1.0 22KHz [ ] (for cellphone)
// fmt=18 -> mp4: 480x 360 (H264) / AAC 2.0 44KHz [large ]
// fmt=22 -> mp4: 1280x 720 (H264) / AAC 2.0 44KHz [hd720 ]
// fmt=34 -> flv: 640x 480 (H264) / AAC 2.0 44KHz [medium] (default - lower bitrate audio than 35 or 18)
// fmt=35 -> flv: 854x 640 (H264) / AAC 2.0 44KHz [large ]
// fmt=37 -> mp4: 1920x1080 (H264) / AAC 2.0 44KHz [hd1080]
****************************************************************/
// unescape fmt_map for processing
var fmt_map = unescape(flashvars.split("fmt_map=")[1].split("&",1)[0]);
// now must set the "vq" var so that the proper format is loaded
if (use1080p && (fmt_map.search(/37(\/[^,]+){4}/) != -1)) {
setFlashvar("vq", "hd1080");
}
else if (use720p && (fmt_map.search(/22(\/[^,]+){4}/) != -1)) {
setFlashvar("vq", "hd720");
}
else {
setFlashvar("vq", "large"); // assume HQ will be found
// if ((fmt_map.search(/35(\/[^,]+){4}/) == -1) &&
// (fmt_map.search(/18(\/[^,]+){4}/) == -1))
// {
// if (document.URL.search("&fmt=18") == -1) {
// // ensure 480p for vids like watch?v=HVn5kQx8xL8
// document.location += "&fmt=18";
// // 2 notes:
// // it's often needed, no matter how new the vid is
// // forcing fmt=18 virtually always works (fmt=35 doesn't)
// }
// else
// {
// // very rare that forcing fmt=18 doesn't work
// setFlashvar("vq", "auto");
// }
// }
}
// autoscroll down to video?
if (scrollToVideo) {
vidTitle.scrollIntoView(true);
}
// use youtube's wide mode?
if (wideVideo) {
var A = $("baseDiv");
if (A.className.indexOf("watch-wide-mode") == -1) {
A.className += " watch-wide-mode";
}
// from Greg Bray:
A = $("content");
if (A.className.indexOf("watch-wide") == -1) {
A.className += " watch-wide";
}
A = $("watch-video");
if (A.className.indexOf("wide") == -1) {
A.className += " wide";
}
}
setFlashvar("enablejsapi", "1");
setFlashvar("autoplay", "1");
if (playEntireList) {
setFlashvar("playnext", "1");
}
setFlashvar("watermark", "");
setFlashvar("invideo", "false");
if (hideAnnotations) {
setFlashvar("iv_load_policy", "3");
}
if (changePlayerColor) {
setFlashvar("color1", "0x000000"); // primary video border color
setFlashvar("color2", "0x330033"); // video control bar background color
}
// done modifying flashvars
player.setAttribute("flashvars", flashvars);
// don't know what this does but it's essential (tested)
player.src += "";
// all done, start the vid
unsafeWindow.player = player;
if (bufferNoAutoplay) {
// the following is based on JoeSimmons' "YouTube Stop Autoplaying Video On Profiles" script
var id = window.setInterval(function() {
var mp = unsafeWindow.document.getElementById("movie_player");
if((mp.getPlayerState() == 1) || (mp.getPlayerState() == 3)) {
mp.pauseVideo();
window.clearInterval(id);
}
}, 100);
} |
|
Disclaimer: This script might also steal your credit card moniez and format your PC. 
|
|
Back to top |
|
 |
|
Posted: Tue, 24th Aug 2010 15:29 Post subject: |
|
 |
iNatan wrote: | I think I know why. Try this:
Spoiler: | Code: | // ==UserScript==
// @name YouTube HD Lite
// @description Automatically plays the best quality YouTube video format and removes ads, plus several optional features
// @include http://www.youtube.com/watch?*
// @version 2.7
// ==/UserScript==
// Optional Features
var use1080p = true,
use720p = true,
wideVideo = true,
hideAnnotations = false,
hideWarnings = true,
scrollToVideo = true,
bufferNoAutoplay = false,
oldPlayer = false,
changePlayerColor = false;
// for console debug messages
var debug = false;
function $(A) {
return document.getElementById(A);
}
document = unsafeWindow.document; // required!
var player = $("movie_player"),
vidTitle = $("watch-headline-title"),
config = unsafeWindow.yt.config_;
var playEntireList = config.SWF_IS_PLAYING_ALL,
flashvars = player.getAttribute("flashvars");
// use old Youtube player?
if (oldPlayer) {
player.src = config.SWF_CONFIG.url_v9as2;
}
function setFlashvar(field, newVal) {
var delimited = "&" + field;
if (flashvars.indexOf(delimited) == -1) {
// field not found, so append it
flashvars += delimited + "=" + newVal;
}
else {
// modify existing field
var tmp = flashvars.split(delimited);
var tmp2 = tmp[1].indexOf("&");
if (tmp2 != -1) {
flashvars = tmp[0] + delimited + "=" + newVal + tmp[1].substr(tmp2);
}
else {
flashvars = tmp[0] + delimited + "=" + newVal;
}
}
}
/****************************************************************
// 2009.12.16 list of formats from GIJoe's Youtube Enhancer script
// fmt=0 -> flv: 320x 240 (flv1) / mp3 1.0 22KHz [ ] (same as fmt=5)
// fmt=5 -> flv: 320x 240 (flv1) / mp3 1.0 22KHz [small ]
// fmt=6 -> flv: 480x 360 (flv1) / mp3 1.0 44KHz [ ] (No more...)
// fmt=13 -> 3gp: 176x 144 (H263) / AMR 2.0 8KHz [ ] (for cellphone)
// fmt=17 -> 3gp: 176x 144 (mpg4) / AAC 1.0 22KHz [ ] (for cellphone)
// fmt=18 -> mp4: 480x 360 (H264) / AAC 2.0 44KHz [large ]
// fmt=22 -> mp4: 1280x 720 (H264) / AAC 2.0 44KHz [hd720 ]
// fmt=34 -> flv: 640x 480 (H264) / AAC 2.0 44KHz [medium] (default - lower bitrate audio than 35 or 18)
// fmt=35 -> flv: 854x 640 (H264) / AAC 2.0 44KHz [large ]
// fmt=37 -> mp4: 1920x1080 (H264) / AAC 2.0 44KHz [hd1080]
****************************************************************/
// unescape fmt_map for processing
var fmt_map = unescape(flashvars.split("fmt_map=")[1].split("&",1)[0]);
// now must set the "vq" var so that the proper format is loaded
if (use1080p && (fmt_map.search(/37(\/[^,]+){4}/) != -1)) {
setFlashvar("vq", "hd1080");
}
else if (use720p && (fmt_map.search(/22(\/[^,]+){4}/) != -1)) {
setFlashvar("vq", "hd720");
}
else {
setFlashvar("vq", "large"); // assume HQ will be found
// if ((fmt_map.search(/35(\/[^,]+){4}/) == -1) &&
// (fmt_map.search(/18(\/[^,]+){4}/) == -1))
// {
// if (document.URL.search("&fmt=18") == -1) {
// // ensure 480p for vids like watch?v=HVn5kQx8xL8
// document.location += "&fmt=18";
// // 2 notes:
// // it's often needed, no matter how new the vid is
// // forcing fmt=18 virtually always works (fmt=35 doesn't)
// }
// else
// {
// // very rare that forcing fmt=18 doesn't work
// setFlashvar("vq", "auto");
// }
// }
}
// autoscroll down to video?
if (scrollToVideo) {
vidTitle.scrollIntoView(true);
}
// use youtube's wide mode?
if (wideVideo) {
var A = $("baseDiv");
if (A.className.indexOf("watch-wide-mode") == -1) {
A.className += " watch-wide-mode";
}
// from Greg Bray:
A = $("content");
if (A.className.indexOf("watch-wide") == -1) {
A.className += " watch-wide";
}
A = $("watch-video");
if (A.className.indexOf("wide") == -1) {
A.className += " wide";
}
}
setFlashvar("enablejsapi", "1");
setFlashvar("autoplay", "1");
if (playEntireList) {
setFlashvar("playnext", "1");
}
setFlashvar("watermark", "");
setFlashvar("invideo", "false");
if (hideAnnotations) {
setFlashvar("iv_load_policy", "3");
}
if (changePlayerColor) {
setFlashvar("color1", "0x000000"); // primary video border color
setFlashvar("color2", "0x330033"); // video control bar background color
}
// done modifying flashvars
player.setAttribute("flashvars", flashvars);
// don't know what this does but it's essential (tested)
player.src += "";
// all done, start the vid
unsafeWindow.player = player;
if (bufferNoAutoplay) {
// the following is based on JoeSimmons' "YouTube Stop Autoplaying Video On Profiles" script
var id = window.setInterval(function() {
var mp = unsafeWindow.document.getElementById("movie_player");
if((mp.getPlayerState() == 1) || (mp.getPlayerState() == 3)) {
mp.pauseVideo();
window.clearInterval(id);
}
}, 100);
} |
|
Disclaimer: This script might also steal your credit card moniez and format your PC.  |
Unfortunately not...
But you really scared me there. I nearly thought it might format my credit card and steal my pc 
|
|
Back to top |
|
 |
|
Posted: Tue, 24th Aug 2010 17:52 Post subject: Re: Youtube quality |
|
 |
bringiton wrote: | I got an issue with Youtube:
Although I set my settings in Youtube to "Always play videos at the highest quality available" option, every video I watch starts at the lowest resolution. If I want to change to 720p or so, I have to do it manually EVERY fucking time.
Is there something you can do about this? |
Is there any way to get something like this to work when I watch vids from a playlist form somebody's channel?
|
|
Back to top |
|
 |
ixigia
[Moderator] Consigliere
Posts: 65086
Location: Italy
|
Posted: Tue, 24th Aug 2010 17:57 Post subject: |
|
 |
And another question, how can I download the audio track of a video (.mp3) at the highest quality? I've tried with JDownloader but seems that Youtube always forces the 64K quality when it comes to download the audio file.
|
|
Back to top |
|
 |
|
Posted: Tue, 24th Aug 2010 18:05 Post subject: |
|
 |
|
|
Back to top |
|
 |
LeoNatan
☢ NFOHump Despot ☢
Posts: 73231
Location: Ramat HaSharon, Israel 🇮🇱
|
Posted: Tue, 24th Aug 2010 18:10 Post subject: |
|
 |
@ixigia I just download the FLV file and use FLVExtract (or tsMuxer for MP4) to demux the audio track. 
|
|
Back to top |
|
 |
ixigia
[Moderator] Consigliere
Posts: 65086
Location: Italy
|
Posted: Tue, 24th Aug 2010 18:17 Post subject: |
|
 |
Thank guys 
|
|
Back to top |
|
 |
Page 1 of 1 |
All times are GMT + 1 Hour |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group
|
|
 |
|