Page 2 of 3

Re: View Youtube without ads

Posted: Sat Mar 20, 2021 6:22 am
by amethyst
MochiMoppel wrote: Sat Mar 20, 2021 6:01 am
amethyst wrote:

You can easily play all your youtube videos (unless youtube restricts to only playing the video on the youtube site only, which happens sometimes) directly from a search engine site like DuckDuckGo without ads and without going to the youtube site.

If it were that easy I would do it, but IIRC DuckDuckGo does technically what my script does, only less flexible.
I can't test it again because I don't know how to enforce this mode. I remember that DuckDuckGo proposes to play YT videos in DDG for security/privacy reasons, but once I declined this offer and chose to go directly to YT I was never able to play in DDG again. There must be a setting for this option somewhere. Where is it?

If you are talking about your initial embedded script, no that's very limited and quite frankly inadequate as I could not play most of my files. About that setting - not sure, Idon't think I have had that problem before using Palemoon. I've always been able to switch back. Don't know if it's a setting stored in your browser config. Have you tried to clear cookies? Also - when you select the video to play, you can select the video url for playing on the youtube site directly.


Re: View Youtube without ads

Posted: Sat Mar 20, 2021 7:32 am
by Grey

Come on, why grumble. MochiMoppel made a good script, it is clearly useful to many. Since he did it, then it was necessary.


Re: View Youtube without ads

Posted: Sat Mar 20, 2021 8:22 am
by amethyst
Grey wrote: Sat Mar 20, 2021 7:32 am

Come on, why grumble. MochiMoppel made a good script, it is clearly useful to many. Since he did it, then it was necessary.

There's nothing wrong with the script but the embedding feature has serious limitations and inadequate for my personal use. If it plays all (well at least most of) the videos you want to play, then good for you.


Re: View Youtube without ads

Posted: Sat Mar 20, 2021 11:51 am
by MochiMoppel

Never mind, I figured it out and now find the "Always play on DuckDuckGo" option even less appealing than before.

1) Does not work from a YouTube page showing search result thumbnails
2) Works only on Palemoon's "Videos" tab. This tab shows a lot of Microsoft News and Dailymotion videos, not necessarily YT.
3) Display mode can be changed from this tab. There is a link to https://duckduckgo.com/settings Despite setting the option to "Prompt me" this option often fails and I end up with the last used mode, no prompt.
4) The video size is too small for me. I do not need and want fullscreen, I just want the video to fill the window
5) Even when playing in DuckDuckGo, the thumbnails at the end of each YT video will not play in DDG, no matter what mode is selected.

My script helps me to avoid all these shortcomings. I understand that other users have other needs and I don't claim to provide a solution that can please everybody.

YoutubeWarning.png
YoutubeWarning.png (78.67 KiB) Viewed 1598 times

Re: View Youtube without ads

Posted: Sat Mar 20, 2021 12:07 pm
by amethyst

"This can be changed in settings"


Re: View Youtube without ads

Posted: Sat Mar 20, 2021 12:11 pm
by amethyst

The embedded script plays the minimum videos for me (useless actually). I can watch many more videos with this method. Each to his own I suppose. You just need to search correctly to see only youtube results. Default viewing window is bigger using Bing. ACTUALLY : Full screen works for me with DuckDuckGo, Bing, Yahoo.


Re: View Youtube without ads

Posted: Sat Mar 20, 2021 12:31 pm
by peppyy

I copy the link and use VLC. Media tab - Open location from clipboard. Flawless playback for me.


Re: View Youtube without ads

Posted: Sat Mar 20, 2021 12:35 pm
by MochiMoppel
amethyst wrote:

"This can be changed in settings"

My problem was that this dialog never appeared again after choosing "Watch on Youtube". "Remember my choice" means no more dialog = no more hint where to change the setting. I found the change option on the "Videos" tab, which I normally never use, and I explained this in point 3) of my post...


Re: View Youtube without ads

Posted: Sat Mar 20, 2021 12:41 pm
by amethyst

I normally use DuckDockGo not sure if that warning appears when using Bing, Yahoo. Maybe worth checking it out. As mentioned previously one can click the youtube site link to play on youtube site. Warning thus basically irrelevant to me once it's set.


Re: View Youtube without ads

Posted: Sat Mar 20, 2021 12:48 pm
by amethyst
peppyy wrote: Sat Mar 20, 2021 12:31 pm

I copy the link and use VLC. Media tab - Open location from clipboard. Flawless playback for me.

Interesting, I have great difficulty playing it with VLC. What version are you using? in past versions one had to update the youtube.lua file regularly otherwise zilts was happening


Re: View Youtube without ads

Posted: Sat Mar 20, 2021 1:14 pm
by peppyy

@amethyst I am using VLC 3.0.11 Vetinary according to the "About.


Re: View Youtube without ads

Posted: Sat Mar 20, 2021 1:25 pm
by amethyst
peppyy wrote: Sat Mar 20, 2021 1:14 pm

@amethyst I am using VLC 3.0.11 Vetinary according to the "About.

Okay, thanks.


Re: View Youtube without ads

Posted: Sat Mar 20, 2021 8:36 pm
by wanthinker

I usually use this javascript bookmarklet to remove youtube ads:

Code: Select all

javascript:var st = confirm("strict adblocker?"); if(st){var invisible = document.createElement("style"); invisible.innerHTML = "iframe{display:none} embed{display:none} object{display:none} frame{display:none}"; document.body.appendChild(invisible); setInterval(function(){var embeds = document.querySelectorAll("iframe, embed, frame, object"); for(i = 0; i < embeds.length; i++){embeds[i].remove()}}, 500)} else{var adblock = document.createElement("style"); adblock.innerHTML = "[src*=adserver] {display: none; } [src*=adlinks] {display: none;} [src*=adtech] {display:none;} [id*=google_ads] { display: none; } [src*=doubleclick.net] { display:none;} [src*=googlead] { display: none; } [href*=googlead] { display:none;} [src*=googlesyndication] { display: none;} [src*=ads.] { display: none; } [src*=.ad] {display: none; } [src*=ad.] {display:none;} [src*=adsmart] { display:none;}"; document.body.appendChild(adblock)} if(st){var elements = document.body.querySelectorAll("*"); for(i2 = 0; i2 < elements.length; i2++){if(elements[i2].id.includes("google_ads_iframe")){elements[i2].remove()}}} var x = document.getElementsByClassName("video-stream html5-main-video")[0]; function videoblock() { if(x.src.includes("pltype=adhost")) { x.currentTime = 999999999; }} setInterval(videoblock, 10)

Works great!


Re: View Youtube without ads

Posted: Sat Mar 20, 2021 8:42 pm
by wanthinker
amethyst wrote: Sat Mar 20, 2021 12:48 pm
peppyy wrote: Sat Mar 20, 2021 12:31 pm

I copy the link and use VLC. Media tab - Open location from clipboard. Flawless playback for me.

Interesting, I have great difficulty playing it with VLC. What version are you using? in past versions one had to update the youtube.lua file regularly otherwise zilts was happening

you could try mpv with youtube-dl installed instead, works better afaik


Re: View Youtube without ads

Posted: Sun Mar 21, 2021 3:15 am
by Grey

The Russian versions of Puppy contains ready-made solutions using yad for GUI/wrapper. A modified youtube-vlc is used as a "workhorse". In the case of mpv, the commands are given directly from another script. Fragment of Main>>Multimedia menu:

youtube_puppyrus_0.png
youtube_puppyrus_0.png (4.85 KiB) Viewed 1693 times

GUI in my loose translation(be attentive, there are non-standard commands, for example sfs-get-dep):

Code: Select all

#!/bin/sh

ico=youtube-vlc
msg1="YouTube 1080p in VLC"
msg2="Watch YouTube in VLC at 1080"
msg3="The higher the resolution, the greater the load on CPU and channel.
To reduce the load, use VDPAU (requires mesa * .pfs). It is less resource intensive and ad-free compared to browser:
Tools - Settings - Video - Output - VDPAU
View the resolution and other parameters of the media file in VLC : Ctrl+j"

if [ ! "`which youtube-dl`" ] ;then
    ntf -q "$msg2 " "only possible with youtube-dl.
Without it, it will be 720. You can reduce it in the VLC settings: 
<i>Tools - Settings - All - Input\codecs - Video resolution</i>
Connect it?" || exit 1
    sfs-get-dep youtube-dl
fi

action=$(yad --width=800 --window-icon=/usr/share/pixmaps/$ico.svg --center --title="$msg1" --image="$ico" \
       --entry --entry-label=URL: --text "<b><big><big>$msg2</big></big></b> 
$msg3" --button="YouTube в VLC"!gtk-help:4 --button=gtk-cancel --button=gtk-ok:0 ) #|| exit 1
x="$?"
echo $x
[ "$x" = 4 ] && { defaultbrowser "https://forum.puppylinux.com/viewtopic.php?p=20422#p20422"  ; $0 ; }
if [ "$x" = 0 ];then
    paste=$(echo $action)
    youtube-vlc "$paste" &
fi
yt_in_vlc.png
yt_in_vlc.png (38.95 KiB) Viewed 1693 times

Re: View Youtube without ads

Posted: Sun Mar 21, 2021 6:49 am
by amethyst

I don't want to have anything to do with youtube-dl. Once upon I time I tried to use it but it only worked for a few days and then had to get updated again. It's rubbish.


Re: View Youtube without ads

Posted: Sun Mar 21, 2021 7:54 am
by Grey
amethyst wrote: Sun Mar 21, 2021 6:49 am

I don't want to have anything to do with youtube-dl. Once upon I time I tried to use it but it only worked for a few days and then had to get updated again. It's rubbish.

Now it works stably. And constant updates... Well, it's not the program that is to blame, but the attempts of services like youtube to prohibit downloading content. How it happens - they(services) conduct the orchestra, and we(users) adapt.


Re: View Youtube without ads

Posted: Sun Mar 21, 2021 8:01 am
by amethyst
Grey wrote: Sun Mar 21, 2021 7:54 am
amethyst wrote: Sun Mar 21, 2021 6:49 am

I don't want to have anything to do with youtube-dl. Once upon I time I tried to use it but it only worked for a few days and then had to get updated again. It's rubbish.

Now it works stably. And constant updates... Well, it's not the program that is to blame, but the attempts of services like youtube to prohibit downloading content. How it happens - they(services) conduct the orchestra, and we(users) adapt.

That's why I just use a download site like 9xbuddy.com (which contantly do the necessary adaptions if needed). Perfect.


Re: View Youtube without ads

Posted: Sun Mar 21, 2021 8:11 am
by Grey
amethyst wrote: Sun Mar 21, 2021 8:01 am

That's why I just use a download site like 9xbuddy.com (which contantly do the necessary adaptions if needed). Perfect.

To be honest, this is the first time I've heard about this site :) Thanks, I will take a look.


Re: View Youtube without ads

Posted: Sun Mar 21, 2021 8:35 am
by amethyst
Grey wrote: Sun Mar 21, 2021 8:11 am
amethyst wrote: Sun Mar 21, 2021 8:01 am

That's why I just use a download site like 9xbuddy.com (which contantly do the necessary adaptions if needed). Perfect.

To be honest, this is the first time I've heard about this site :) Thanks, I will take a look.

Right-click on a download link and choose open in new tab otherwise you may (will) get unwanted advertisements.


Re: View Youtube without ads

Posted: Sun Apr 11, 2021 9:32 am
by watchdog

I have not read the thread but I have a tip to play youtube blocked videos in firefox. The video can be blocked because of ad-blocker or other reasons. Change the address of the video from www.youtube.com/xyz to nsfwyoutube.com/xyz .


Re: View Youtube without ads

Posted: Sun Apr 25, 2021 12:19 pm
by ThruHammer

Necessity is the mother of invention. Crazy good sh!t, Mochi.


Re: View Youtube without ads

Posted: Sun Apr 25, 2021 1:29 pm
by wiak
Zuzia wrote: Tue Feb 23, 2021 2:49 pm

Just install firefox + ublock plugin :) No adds at all.

I wouldn't normally post here nowadays, but wouldn't want anyone using anything possibly dodgy. Be careful, I think the one you want is Ublock Origin: https://github.com/gorhill/uBlock
which seems to be well-known, created/maintained by a Raymond Hill, and open-source GLP3.

I'm not sure about the one called ublock (only) - far less downloads. Certainly, the "Ublock Origin" site has warning:

BEWARE! uBlock Origin is (and has always been) COMPLETELY UNRELATED to the web site ublock.org

Anyway, up to you, but I use "Ublock Origin" with my Chromium browser and it certainly seems to remove all youtube ads without effort.

EDIT: Seems "ublock" project was at some stage handed over to someone else and then forked by its original developer to "ublock origin" who wasn't happy with what was happening to the original, so maybe both okay, maybe not... your guess as good as mine: https://news.ycombinator.com/item?id=12487534

Ublock Origin working great at blocking Youtube Ads for me though.

wiak


Re: View Youtube without ads

Posted: Sun Apr 25, 2021 4:52 pm
by Grey

I agree with wiak, you only need to use uBlock Origin, not other plugins with a similar name. I had a chinese jersey that said "Abibas" - very similar to Adidas, but this is not it :)

uBlock Origin... I'll even give an example. One fine day(not very much) russian users visit the site pornhub.com... And there it checks the age through the social network "Vkontakte", that is, age data is taken from the social network. The code is like this on the page:

Code: Select all

<div id="age-verification-container"></div>
<div id="age-verification-wrapper">
	<div class="age-verification-modal clearfix">
		<div class="age-verification-left">
			<div class="logo age-verification-logo">
								<img src="https://bi.phncdn.com/www-static/images/pornhub_logo_straight.png?cache=2017072020" alt="Pornhub" width="150" height="40" />
			</div>
		</div>
		<div class="age-verification-right">
			<h1>ДЛЯ ПОДТВЕРЖДЕНИЯ, ЧТО ВЫ СТАРШЕ 18-ТИ, ПОЖАЛУЙСТА, АВТОРИЗИРУЙТЕСЬ ЧЕРЕЗ ВК</h1>
			<p>Данный сайт предназначен сугубо для лиц 18 лет и старше. Если вы моложе 18 лет, то, пожалуйста, покиньте этот сайт. Этот сайт содержит изображения, видео, аудио, текст для взрослых людей, занимающихся действиями сексуального характера. Если доступ и просмотр материалов для взрослых не законен для Вас, пожалуйста, покиньте сайт прямо сейчас.</p>
			
<p>Продолжая и подтверждая, что вам 18 лет и старше, вы самостоятельно подтверждаете доступ к просмотру сексуально откровенных материалов для взрослых, такиx, как фильмы для взрослых, хардкор фильмы для взрослых, XXX фильмы. Выбор за Вами, подчиняться ли местным законам, касающимся материалов для взрослых. Вашим выбором Вы берете на себя ответственность за любые Ваши действия на сайте, личные последствия от использования сайта и соблюдение общественных и социальных норм. Создатели этого сайта и поставщики услуг не несут никакой ответственности за Ваш выбор - продолжить использование этого сайта.</p>
		
	<p>Данный сайт не предназначен для совместного использования с лицами младше 18 лет и предназначен сугубо для персонального единоличного использования. Для согласия с вышеприведенной информацией, подтвердите свою дату рождения и нажмите кнопку ВОЙТИ.</p>
			<br/>
							<p>Эта мера только для подтверждения Вашего возраста, мы не используем и не сохраняем Вашу личную информацию</p>
				<div id="auth_button" class="age-verification-button">
					<button onclick="return show_vk_widget();" id="js-checkAge" class="age-verification-button-enter removeAdLink">
						<span>aвторизируйтесь через ВК</span>
					</button>
				</div>

Ha ha ha. On the same day, the "legendary russian hackers" came up with a solution. You just need to open the uBlock dashboard and add two filters:

Code: Select all

pornhub.com##div#age-verification-container
pornhub.com##div#age-verification-wrapper

That's it, there are no restrictions for entry. Why should a user have a social media account to relax after work :) ?


Re: View Youtube without ads

Posted: Sat May 22, 2021 11:58 am
by wiak

Just trying mpv to play youtube videos (after first installing youtube-dl in WDL_Arch64). So the following then works for me:

Code: Select all

mpv https://www.youtube.com/watch?v=gEQUi8hyRfY&list=RDgEQUi8hyRfY&start_radio=1

However, the resultant resolution is a bit too high for my internet bandwidth. So added the following to my ~/.config/mpv/mpv.conf:

Code: Select all

[1080p]
ytdl-format=bestvideo[height<=?1080]+bestaudio/best

[720p]
ytdl-format=bestvideo[height<=?720]+bestaudio/best

[480p]
ytdl-format=bestvideo[height<=?480]+bestaudio/best

[360p]
ytdl-format=bestvideo[height<=?360]+bestaudio/best

Instructions for which I found here (credit where credit is due...): https://www.funkyspacemonkey.com/mpv-yo ... -resources

and then, I can use best quality available in, for example, 480p using:

Code: Select all

mpv --profile=480p https://www.youtube.com/watch?v=gEQUi8hyRfY&list=RDgEQUi8hyRfY&start_radio=1

Re: View Youtube without ads

Posted: Sat May 22, 2021 9:53 pm
by mikewalsh

Nice one, Will. Thanks for the tip!

Interestingly, I know norgo's recent compiles of SMPlayer will play URLs OOTB, albeit with a "twist"; if it detects your version of yt-dl is not 'current', it offers to download & install the newest version for you. Which it will do.....except it installs it to /root/bin, for some odd reason..!

Replace /usr/bin/youtube-dl with the one just installed to /root/bin.....and Bob's yr uncle; off you go again.

All good stuff. :D

Mike. ;)


Re: View Youtube without ads

Posted: Sun May 23, 2021 1:46 am
by norgo

Hello Mike,
Smplayer place the youtube-dl to $HOME/bin
if you are user root the location is /root/bin you are absolutely right

Right now I patched SMplayer to place youtube-dl to /usr/bin
Yes it would be possible, but in my opinion youtube-dl should not be placed to /usr/bin.
Topic yt-dl update
As you said SMplayer is looking for the latest version of yt-dl and will perform an update if available. ;-)
This takes approx half a second in my case.

smplayer_yt_dl_update.mkv.tar
update youtube-dl via SMplayer in realtime, remove tar fake extension
(260.36 KiB) Downloaded 77 times

Re: View Youtube without ads

Posted: Sat Jan 29, 2022 2:01 pm
by gychang
MochiMoppel wrote: Wed Dec 02, 2020 3:03 am

Code: Select all

#!/bin/sh
BROWSER=defaultbrowser
YTURL=$(xclip -o -sel clip) || YTURL=$(xsel -b)
(($?)) && exec Xdialog -msg "xclip or xsel not installed" x
case $YTURL in
*youtube.com*v%3D*) VIDID=${YTURL#*v%3D};;
  *youtube.com*v=*) VIDID=${YTURL#*v=};;
  *youtu.be*      ) VIDID=${YTURL#*.be/};;
  *               ) exec Xdialog -msg "Not a recognized YouTube URL:\n\n${YTURL::50}" x;;
esac
VIDID=${VIDID::11}
exec $BROWSER "https://www.youtube.com/embed/$VIDID?autoplay=1"

- Copy the code into a file and make the file executable.
- Drag the file onto the desktop to create a desktop icon

This is sufficient to start the script with the mouse, but it's more convenient to use a keyboard shortcut when the desktop is covered, so
, right-click the created icon and select "Edit Item"
- Push the "(click to set)"button and enter a keyboard shortcut for the script. I use Ctrl+Shift+A

this is very useful, works great with invisible.svg (https://oldforum.puppylinux.com/search. ... isible.svg) to make the desktop icon invisible...


Re: View Youtube without ads

Posted: Wed Mar 16, 2022 8:23 pm
by user1111

Awesome. Thanks

Running cwm (within a container under Fatdog) where I have a set of regular bookmarks/programs I use, activated by alt-spacebar, and great enough to warrant inclusion :)

yt.png
yt.png (346.31 KiB) Viewed 1888 times

In chrome right click context to copy the youtube url. Alt-space space space y <enter> and it starts playing the video in a chrome full tab screen :)

Looks to also be light on resources :)

r.png
r.png (258.43 KiB) Viewed 1876 times

Re: View Youtube without ads

Posted: Fri Oct 07, 2022 1:04 pm
by MochiMoppel
gychang wrote: Sat Jan 29, 2022 2:01 pm

this is very useful, works great with invisible.svg (https://oldforum.puppylinux.com/search. ... isible.svg) to make the desktop icon invisible...

The link doesn't work.
You probably refer to this post: https://oldforum.puppylinux.com/viewtop ... 5#p1050605
I also have a lot of invisible icons on my desktops, consisting only of titles. I need them only for their keyboard shortcut functionality and seldom have to click them.