YePpHa / YouTubeCenter

YouTube Center is a userscript designed to expand the functionality of YouTube. It includes the ability to download the video you're watching, auto selecting your preferred video quality and much more.
MIT License
2.89k stars 520 forks source link

Aggressive Flash no longer works due to YouTube change today #2436

Open dinsdalepiranha opened 7 years ago

dinsdalepiranha commented 7 years ago

At least in some browsers (SeaMonkey on Linux here) YT has started blocking Flash as of earlier today:

https://productforums.google.com/d/msg/youtube/CUaTWvKhAuE/Z9ONjZ-xAgAJ

Maybe just a matter of some JavaScript tweaks to get it back, though?

thinkpad4 commented 7 years ago

I hope @YePpHa adds a option to disable this html5 change

Xan-Kun commented 7 years ago

I can confirm, tested in FF, Opera and Chrome. With addon and user-script. It seems flash is gone for good.

dinsdalepiranha commented 7 years ago

I did notice that it still works in embedded videos, however...

Xan-Kun commented 7 years ago

@dinsdalepiranha can you elaborate? I just tried with the standard (YT generated) html code and still end up with a nasty CPU killing \<video> tag. :-)

dinsdalepiranha commented 7 years ago

@Xan-Kun With this code: `

</div>`

Embedded: http://i.imgur.com/Tb2DQtg.png Same video directly on YouTube: http://i.imgur.com/7zXMZex.png

digideth commented 7 years ago

I doubt if there is anything that can be done. There is a userscript on that google forum link above that supposedly embeds the video on the youtube page you are on so the flashplayer loads but I couldn't get it to work.

Xan-Kun commented 7 years ago

@dinsdalepiranha What Broser is that and which plugin/addon? I tried your code and still got to html5. Did you load it from an actual server or was it a file:// url?

dinsdalepiranha commented 7 years ago

@digideth @Xan-Kun @Leifman27 @thinkpad4 The script in this post of the above thread does work, at least for me. In YouTube Center settings make sure External Players > Player Type is set to Aggressive Flash then add this userscript to Greasemonkey or whatever:

// ==UserScript==
// @name          YouTube Force Flash via Embed
// @namespace     YT_forceflashembed
// @description   Force Flash player by embedding YouTube in YouTube. From: https://productforums.google.com/d/msg/youtube/CUaTWvKhAuE/q6P1m1kpAwAJ
// @version 1
// @include       *.youtube.com/*
// @grant         GM_addStyle
// ==/UserScript==
// Notes:
//   * is a wildcard character
//   .tld is magic that matches all top-level domains (e.g. .com, .co.uk, .us, etc.)
/* ____80_character_separator________________________________________________ */
window.setTimeout(function() {
  var embedFrame = document.createElement("iframe");
  embedFrame.src = location.href.replace("watch?v=", "embed/");
  embedFrame.style = "width: 100%; height: 100%;";
  var player = document.getElementById("player-api");
  player.innerHTML = "";
  player.appendChild(embedFrame);
},
3000);

Note that all of your other "External Players" YT Center preferences will now be in effect on YouTube itself (autoplay, default resolution, etc.) so you can't have a separate set of prefs for embedded YT videos anymore.

Chazzen commented 7 years ago

@dinsdalepiranha Just wanted to say thanks for that script. It works perfectly and has saved me from the many HTML5-induced FF crashes I have been suffering through.

Xan-Kun commented 7 years ago

@dinsdalepiranha Thanks a lot, I got it to work! The trick for me was, to remove the ".user" part from the file name.

Xan-Kun commented 7 years ago

Does anyone have a pointer for me where to start reading when I want to understand what's actually going on? I am really curious why it is so hard to deactivate the YT-auto-detection with an early (before page load) userscript.

Maurogch commented 7 years ago

I was waiting for an update, but it seems that we'll have to wait a bit more, thanks for sharing a workaround.

There's an update for the script thats posted above, it seems playlists weren't working: change: embedFrame.src = location.href.replace("watch?v=", "embed/"); to embedFrame.src = location.href.replace(/watch\?v=([^&]*).*/, "embed/$1");

and add unsafeWindow.spf.dispose(); after player.appendChild(embedFrame);

Also follow this link for another more complete script based on the above one. (don't know how it behaves with Youtube Center)

MasterBLB commented 7 years ago

Hey mates. How to use that script for Opera 12.18 browser?

Xan-Kun commented 7 years ago

@MasterBLB I just put it in the "User Javascript Folder" and make sure, it ends only with ".js". As a ".user.js" extension will not have sufficient rights.

thinkpad4 commented 7 years ago

The workaround seems to have stopped working, anyone else have a workaround?

Xan-Kun commented 7 years ago

Same here.