Tagged: User JS

YouTube Annoyances Remover 2019.06 Update

Disables ads, turns off autoload/autoplay, adds RSS link, deletes “recommended for you” videos, unhides description, displays all comments, changes profile link to videos page; changes region to US, displays video thumbnail image, lists offline download links, and adds a link to the lighter version on Hooktube if video is not playable for codec reasons.

Youtube video download links

The current video link, the Hooktube video link, and other format/bitrates are linked. These links when used with DownThemAll add-on (file renaming option set to “*text*.mp4” will ensure the download is completed offline.

This script supports Firefox-based browser up to version 36. Newer versions should use a UserAgent (UA) spoofer add-on. YouTube loads a lighter version of the YouTube page for older browsers. This script will require the GreaseMonkey add-on to be executed by the Firefox browser. The download links can then be sent to the DownThemAll add-on with the file renaming mask “*text*.mp4”.

It seems that Mozilla has effectively destroyed its add-on ecosystem by switching over to Google Chrome’s WebExtensions format. I recently installed the latest version of Firefox and it has no add-ons worth naming in its download portal. DTA is not there and neither is Greasemonkey. If had Google had infiltrated Mozilla and decapitated its top management, Firefox couldn’t be worse. Mozilla’s own management is diluting its brand appeal, frustrating add-on developers, disappointing its user community and effectively throwing Internet users to the jaws of the Google spyware called Chrome. (https://www.thewindowsclub.com/microsoft-disabled-these-chromium-services-features-in-new-edge)

For embedded YouTube videos, use the new script com.vsubhash.js.embedded-video-catcher.user.js.

Unable to stream YouTube and other videos

I have lived in several houses in three South Indian states. In all of them, there are unusual electric disturbances. The net connection is also very unstable. (I wrote the NetCheck desktop and mobile application for this reason – http://vsubhash.com/netcheck-app-for-android.html) When the net connection seems to be stable, the electrical disturbances trips the Internet modem.

For this reason, I am unable to play videos as an online stream. I have to download them first and play them offline on the TV. The downloads have to be constantly restarted because the net connection stops intermittently.

The electrical disturbances destroys electrical appliances. I run the entertainment systems and computers on a UPS and this protects them. But, I can hear the UPS relay clicking incessantly. Earlier, the modem was on the mains directly. Now, it runs of the UPS. Even then, the modem stops net connection for some reason.

Apart from the electrical disturbances, the power supply is cut several dozen times a day – in all three states. In a month, they are off for an entire day or an entire night for at least three or four days. This always happens when I am visiting someone and trying to work on a computer. The UPS supports the modem and the network switch for about 20 minutes if my laptop is powered from the battery. If I am on the desktop, the backup lasts for just five minutes.

I rarely use the mobile now. Here too, the net connection is not stable.

In this video, you can hear the racket created by the relay. In the background, you can hear the fan speed going up and down with the voltage fluctuations.

GreaseMonkey Javascript Source Code

YouTube Ad Blocker and Annoyances Remover GreaseMonkey script updated

Blocks video ads too.

YouTube ad-blocker and annoyances remover script

This script removes ads, disables autoplay, mutes video, adds RSS support and displays all comments.

In this version, the script will

  • disable ads, including video ads. If a video ad is loaded, a new window will be opened until an ad-free video is loaded. You will have to manually close the other tabs. I am not sure how effective it is in blocking text ads, I use a ad-blocking HOSTS file and I don’t see ads most of the time.
  • pause all videos automatically. This is useful if you open multiple videos in different tabs and if they all start playing simultaneously, you will hear the biblical Tower of Babel.
  • turn off autoplay button
  • add an RSS link next to the channel name and in a LINK tag in the HEAD section of the HTML so that the browser can activate its RSS button (if available).
  • delete “recommended for you” videos
  • unhide description
  • display all comments
  • change profile link to videos page
  • change region to US. By default, YouTube pages defaults to India and all the results are tilted in favour of Indian Youtubers. The problems with the Indian Youtubers is that their videos have low-volume voice and high-volume music. By changing to US, the video results are mostly from English-speaking countries. They are not enamoured by the need to pepper their videos with loud interludes of the same copyright-free music.

The script supports Firefox-based browser up to version 36. Newer Firefox versions should use a UserAgent (UA) spoofer add-on. YouTube loads a lighter version of the YouTube page for older browsers. This script will require the GreaseMonkey add-on to be executed by the Firefox browser.

For non-YouTube pages, I have a more generic autoplay video autostopper script. It will also work on YouTube pages if the @exclude line is removed.

This browser user js is also available at
https://openuserjs.org/scripts/zomberi/YouTube_AdBlocker_N_Annoyances_Remover

AutoPlay Video AutoStopper GreaseMonkey Script

If you are the type of person who opens several tabs at once and reads them one by one much later, then you need this browser user script.

Many news sites have autoplay videos on all their pages. This script will automatically pause them. You can play them manually. It also mutes the videos. If the videos use custom controls, then they may not realize that the videos has been muted. You may have to click on the play and mute buttons more than once to get them working as intended.

Autoplay videos auto stopper

All videos are auto-stopped by this script

This script, by default, does not work on YouTube pages but I have a more powerful YouTube version at https://vsubhash.wordpress.com/2019/03/10/youtube-ad-blocker-and-annoyances-remover-greasemonkey-script-updated

This browser user js is also available at
https://openuserjs.org/scripts/zomberi/AutoPlay_Video_AutoStopper

How to get the silly Twitter verified status without any real verification

With this Greasemonkey script it is easy.

// ==UserScript==
// @name        Twitter Verified Status For Everyone
// @namespace   com.vsubhash.js.twitter-verified-status-for-everyone
// @include     https://twitter.com/*
// @version     1
// @grant       none
// ==/UserScript==

var oEls;
var sVerifiedHtml1 = "<span>‏</span><span class=\"UserBadges\"><span class=\"Icon Icon--verified\"><span class=\"u-hiddenVisually\">Verified account</span></span></span><span class=\"UserNameBreak\">&nbsp;</span></span>";
var sVerifiedHtml2 = "<span class=\"ProfileHeaderCard-badges\"><a href=\"/help/verified\" class=\"js-tooltip\" target=\"_blank\" title=\"Verified account\" data-placement=\"right\" rel=\"noopener\"><span class=\"Icon Icon--verified\"><span class=\"u-hiddenVisually\">Verified account</span></span></a></span>";


function addTwitterVerifiedStatus() {
	console.log("TVSFE: Changing HTML");
	oEls = document.getElementsByTagName("span");
	if (oEls.length > 0) {
		for (var i = 0; i < oEls.length; i++) {
			if (oEls[i].className) {
				if (oEls[i].className.indexOf("FullNameGroup") > -1) {
					if (oEls[i].innerHTML.indexOf("Icon Icon--verified") == -1) {
						oEls[i].innerHTML += sVerifiedHtml1;
						console.log("TVSFE: Screenname icon added");
					}
				}
			}
		}		
	}
	oEls = document.getElementsByClassName("ProfileHeaderCard-name");
	if (oEls.length > 0) {
		for (var i = 0; i < oEls.length; i++) {
			if (oEls[i].innerHTML.indexOf("ProfileHeaderCard-badges") == -1) {
				oEls[i].innerHTML += sVerifiedHtml2;
				console.log("TVSFE: Profile icon added");
			}
		}
	}	
}


function handle_DOMLoaded(aoEvent) {
	try {
		console.log("TVSFE: Page loaded");
		window.setTimeout(addTwitterVerifiedStatus, 3*1000);
		
		addTwitterVerifiedStatus();
	} catch (e) {
		console.error("TVSFE: Error - " + e);
	}
}


document.addEventListener("DOMContentLoaded", handle_DOMLoaded, false);

BloombergQuint protects its paywall using a CSS filter!!!

They are selling one-year subscription for Rs. 3000.

I mailed BloombergQuint a few days ago but they don’t care. They seem to think that even if someone figures this out, it is still a hassle to do this on all pages. I have a GreaseMonkey script that does this automatically on all their pages. Not that I read the site every day.

Open the browser’s console and disable the fuzzy container’s filter and the page’s content is visible.

BloombergQuint is one of the few remaining independent news organizations. The Quint was in the news recently when Modi govt raided their offices after some explosive Rafale deal-related stories and IT officials were found cloning the contents of journalists’ phones and computers.

It seems that their subscribers’ support is thin.

Facebook Posts Deleter updated – Greasemonkey script to delete FB posts one by one

Facebook archives all your posts, photos and videos to optical media, not just HDDs. So, when you tell them to delete your content, do they really delete it from its cold-storage system too? Unlikely. Delete Facebook, if you have one, now.

Facebook Posts Deleter 2016 was a User Script that automatically deleted Facebook posts one by one on the FB “Activity Log” page. You could use this script if you did not trust Facebook to delete the content when you choose that option on its page. One FB user, who sued Facebook, found that deleted content continues to reside on Facebook servers on its distributed content delivery network long after the account has been “deleted” by Facebook.

Like Google/YouTube, Facebook seems to be serving different set of web pages, CSS & JS for different versions of web browsers. This User JavaScript was developed and tested in Firefox 34. Spoof this version with a Firefox add-on. The code is now very simple. There is no start button. It will start deleting posts without warning.

Greasemonkey script to click the “Load More” button of YouTube video pages

YouTube forces its content creators to create lots of videos than is necessary. I have been watching the drawing videos of an artist. She is now posting videos every day, not about drawing but about her everyday activities. In these videos, she posts links to the real drawing videos or tells about them in advance. It’s awful. She is not alone. There are lots of people who seem to be doing this. There was this one guy whose electronics videos I watched a few times. I decided to check what else he had posted. Yikes! A whole lot of useless nothingness videos! I didn’t see them earlier because I always change the filter to “Most popular”.

If content creators stop making such videos, YouTube lets their earnings fall. This is because only the latest videos of subscribed channels are listed when people launch the YouTube app. If a content creator does not produce at least two or three videos per week, it is easy to get hidden by other channels when he/she does release a new video after a long break.

I use bookmarks and the hidden RSS feeds of YouTube. I don’t login and I don’t watch them live. Because of unexplained lag issues, I download the videos and watch them offline on my WDTV device.

When I check the videos pages, only some video thumbnails are listed there. There is a “Load More” button, which needs to be clicked several times to get the full listing. Sometimes the Net connection breaks during this interval and the expansion of the page stops. I need to then refresh the page and then click the button a few times to get to down to where I was. So, I wrote this Greasemonkey script to that for me. I load the video page and the script automatically clicks the button several times, waiting for sometime between each click to let the videos thumbnails.

With this script, I open the videos page to let it roll out. Meanwhile, I browse some other page. By the time I come back to the video page, all the thumbnails are listed.

Greasemonkey JavaScript-based YouTube adblocker and annoyances remover

Watching YouTube online is still impossible for me – the Net connection is still flaky and there are disturbances in the electricity supply. Downloading the videos and playing them offline is still the only option for me. Even then, the YouTube comes with a great deal of annoyances – ads (text and video), autoplay, “Recommended for you” video list, lack of RSS feeds, half-hidden description, YouTube-curated (or censored) “Top Comments”.

I have created several Greasemonkey scripts to deal with YouTube. Recently, I added a few more. Here they are:

The last one is new. It does several things – disables video ads, hides text ads, disables autoplay, deletes “recommended for you” ads.

Disabling video ads was tricky. The current implementation opens the same video URL in another tab and closes the current tab. This is repeated until YouTube relents and loads the original video. This can range anywhere from 2 to 10 reloads, probably. The code also finds the mute button and mutes the ad.

NOTE: I use an old version of Firefox and I spoof a newer but still old version in it. YouTube and other Google sites serve different styles of pages for different browser versions. The above code works with Firefox 42. To make the code work, you can spoof version 42 using the UserAgent Switcher add-on with this UA string.

Mozilla/5.0 (Windows NT 6.2; rv:42) Gecko/20100101 Firefox/42.0

Of course, I will not be publishing the ad-blocking code. YouTube apocalypse is on now. Ad agencies have done to YouTube what they had been doing for decades to newspaper and TV journalism – interfering in content. After CNN decided to launch a crusade against Alex Jones’ YouTube channels, ad agencies are now telling YouTube that their ads should not be playing on “controversial” content. The bottomline now is that videos from big music labels and stars can have all kind of crude/vulgar/unsuitable content but ordinary folk stepping out of the line will have to be immediately “demonetized.” I found one retired nurse, who publishes makeup tutorials, complaining that she never said a bad word or anything controversial but all her videos were demonetized.

Until the said apocalypse, YouTube content creators seem to have been generously paid. When the times were good, YouTube went all over the world asking people to make videos and make tons of money. Now, YouTube’s revenues are down and the first victims are the small and independent content creators who took YouTube’s bait. A million page views earns the creators very little. It is only with off-YouTube marketing deals and paid-promotion that YouTube content creators can make money. I am surprised that that many seemingly intelligent people left their day jobs and became “Youtubers” full time. Even more sad are the legion of retired folks whose savings have been destroyed by Bush and Obama’s zero-interest monetary regime and free-trade policies, and Wall Street’s looting of pension funds and local government funds. There can be no economy without local manufacturing. Selfies and cat videos are not what an advanced economy runs on.

Anyway, I can tolerate text ads. The videos ads are horrible. The “recommended for you” videos are downright creepy. Why are they recommended for me?

Greasemonkey script to display newer comments on YouTube – bypass censorship

Changes comments filter to “Newest first” from “Top comments”

YouTube has been raining on the parade of its content creators with demonetization, censorship and unexplained notifications disablement. Youtube comments are also being censored. The default filter is not “Newest first” or “Oldest first” but “Top comments”. Trolls will eventually game the system. I would rather see unfiltered comments. So, here it is: