Page 1 of 3
Re: View Youtube without ads
Posted: Thu Dec 03, 2020 10:45 am
by mikewalsh
JASpup wrote: ↑Wed Dec 02, 2020 11:54 amI'm in a puplet with Light instead of Pale Moon. It's not easy to switch default browsers. I chose a portable Firefox and it defaulted to Chrome instead. I went to Firefox because I couldn't choose Chrome.
@JASpup :-
One thing you learn in Puppy, very early on, is NOT to try setting the default browser FROM the browser's own settings page. This never, EVER works in Puppy.....something to do with Puppy's implementation of the xdg protocols, I believe. Instead, you use the 'Default Applications Chooser', under Menu->Setup.
And don't worry if the browser you want doesn't appear in the appropriate drop-down box. Just manually edit the entry, and set the $PATH yourself to the browser's launcher. The other way this can be done - same thing, different method - is to go into /usr/local/bin, open the 'defaultbrowser' entry with Geany, then change the $PATH there, instead.
You almost always need to do this with any of the portables, unless you've linked the launcher into one of your 'bins' and re-named it to one of the 'standard' names.
Mike.
View Youtube without ads
Posted: Thu Dec 03, 2020 11:51 am
by MochiMoppel
greengeek wrote: ↑Thu Dec 03, 2020 8:09 am
I'm testing on Tahr32 at the moment and get a message saying "xclip or xsel not installed".
Which of these would you recommend best?
cheers!
EDIT : Ahhh, ok i see it needs both.
No, it needs only one of them. I checked Tahr6.0.6 and found xclip documentation but no trace of the binary, According to /root/.packages/builtin_files/xclip the binary is not in the list of installed files. Very strange. So I assume that it worked for you after installing xsel, right?
Re: View Youtube without ads
Posted: Thu Dec 03, 2020 12:32 pm
by JASpup
mikewalsh wrote: ↑Thu Dec 03, 2020 10:45 am
set the $PATH yourself to the browser's launcher. The other way this can be done - same thing, different method - is to go into /usr/local/bin, open the 'defaultbrowser' entry with Geany, then change the $PATH there, instead.
Not sure the specifics there, but it looks like it could be useful, thanks.
The default chooser was finicky but seemed redeemable (hopeful).
The late 32bit Chrome (in my last screenshot), won't even let you make it default in its settings. There might be an option first run but I never choose it.
Re: View Youtube without ads
Posted: Thu Dec 03, 2020 5:43 pm
by greengeek
MochiMoppel wrote: ↑Thu Dec 03, 2020 11:51 am
No, it needs only one of them. I checked Tahr6.0.6 and found xclip documentation but no trace of the binary, According to /root/.packages/builtin_files/xclip the binary is not in the list of installed files. Very strange. So I assume that it worked for you after installing xsel, right?
Yes, xsel from PPM did the trick perfectly thank you.
Strange thing though - when I first saw the dependencies error message I tried to run xclip and xsel from cli to confirm functionality but found neither available in my system yet when I tried to install xclip the ppm indicated xclip is already installed.
Some minor weirdness within my Tahr.
Very handy way to play videos thanks.
View Youtube without ads
Posted: Fri Dec 04, 2020 1:45 am
by MochiMoppel
greengeek wrote: ↑Thu Dec 03, 2020 5:43 pmStrange thing though - when I first saw the dependencies error message I tried to run xclip and xsel from cli to confirm functionality but found neither available in my system yet when I tried to install xclip the ppm indicated xclip is already installed.
Some minor weirdness within my Tahr.
xclip is installed in Tahr6.0.5. It got lost in Tahr6.0.6. Newer is not always better.
Hang on to your trusted Slacko5.6
Re: View Youtube without ads
Posted: Thu Dec 10, 2020 6:30 pm
by fredx181
Here's a little variation of MochiMoppel's script, attached script "yt-dnd", depends on having yad installed.
I thought it'd be nice to have a little box to drag n' drop any youtube link onto, running the attached script, there will appear an icon in upper left corner, example usage:
- Drag n' drop youtube links
- yt-dnd.gif (452.07 KiB) Viewed 3294 times
Fred
Youtube without ads
Posted: Fri Dec 18, 2020 5:49 am
by MochiMoppel
@fredx181 Thanks. Works with my old yad version. Could be handy when keyboard is not accessible or when using a tablet (no idea if this would be feasible). Drag n' drop can be a bit tricky when dragging linked preview images as YT preview images are bigger than the drop icon, making it hard to get visual feedback.
Re: View Youtube without ads
Posted: Sat Dec 26, 2020 2:11 pm
by josejp2424
MochiMoppel thank you very much, for this simple script that works very well.
Re: View Youtube without ads
Posted: Sat Dec 26, 2020 11:55 pm
by amethyst
Just a mention. I installed the Adblock Latitude add-on in Palemoon. Blocks youtube ads nicely. Too many videos not playing with the embedded method. Another trick to block ads in youtube is to add a rest sign [.] after com in the video url (so you have .com. in the url). Unfortunately the last mentioned method does not always work. And another suggestion. When searching for youtube videos use microsoft bing/DuckDuckGo/Yahoo search engines instead. Click on the videos tab and search for your video, eg: youtube tina turner concerts. Results will display. Now the nice - clicking a link will play the video in the same window (without the ads even if you don't have an ad blocker), it does not go to the youtube page with all its crap loadings.
Re: View Youtube without ads in defaultmediaplayer
Posted: Sat Feb 20, 2021 11:30 am
by foxpup
I got the idea to put defaultmediaplayer in for the BROWSER.
In Fossapup the defaultmediaplayer is mpv.
mpv needs youtube-dl to play url's and that was not in my Fossapup, so downloaded that and put it in /usr/bin.
And then this nice script works with mpv as well
Re: View Youtube without ads
Posted: Sat Feb 20, 2021 8:00 pm
by williams2
I disable the mpv youtube-dl hook by putting
ytdl=no
in the file /root/.config/mpv/mpv.conf
so that mpv will play a streaming file directly and will not try to download it first using youtube-dl, so youtube-dl does not need to be installed.
Or you can use the mpv command line option --ytdl=no
This might break something that expects the mpv youtube hook to be enabled by default.
Re: View Youtube without ads
Posted: Mon Feb 22, 2021 9:21 am
by fredx181
williams2 wrote: ↑Sat Feb 20, 2021 8:00 pm
I disable the mpv youtube-dl hook by putting
ytdl=no
in the file /root/.config/mpv/mpv.conf
so that mpv will play a streaming file directly and will not try to download it first using youtube-dl, so youtube-dl does not need to be installed.
Or you can use the mpv command line option --ytdl=no
This might break something that expects the mpv youtube hook to be enabled by default.
For me there are many videos that won't play this way.
Running mpv with youtube-dl enabled, I can play almost all.
Re: View Youtube without ads
Posted: Mon Feb 22, 2021 4:53 pm
by foxpup
fredx181 wrote: ↑Mon Feb 22, 2021 9:21 amFor me there are many videos that won't play this way.
Running mpv with youtube-dl enabled, I can play almost all.
I second your findings @fredx181
@williams2 It does not work for me with ytdl=no
Re: View Youtube without ads
Posted: Mon Feb 22, 2021 6:42 pm
by williams2
ytdl=no is just convenient when mpv can play directly, by itself, an online stream, and does not need youtube-dl.
By default, mpv will try to download the URL first using youtube-dl and then it will try to play the URL directly.
For example,
mpv http://simplexstream.com:8058/
mpv --no-ytdl http://simplexstream.com:8058/
If mpv can not play a URL directly, but youtube-dl can, then the youtube-dl hook should work (if it is enabled.)
Personally, I tend to download a media file first, using wget or youtube-dl, then play it with mpv.
And you can usually watch/listen to the the file while it is still downloading.
Re: View Youtube without ads
Posted: Tue Feb 23, 2021 2:49 pm
by Zuzia
Just install firefox + ublock plugin No adds at all.
Re: View Youtube without ads
Posted: Fri Mar 19, 2021 5:02 pm
by Grey
When using mpv, you can shorten the script to this:
Code: Select all
#!/bin/sh
PLAYER=defaultmediaplayer
YTURL=$(xclip -o -sel clip) || YTURL=$(xsel -b)
(($?)) && exec Xdialog -msg "xclip or xsel not installed" x
exec $PLAYER "$YTURL"
In this case, links work not only from youtube, but also from other well-known sites, for example xvideos, spankbang, etc. Don't laugh, it was just necessary to check somewhere
Re: View Youtube without ads
Posted: Fri Mar 19, 2021 5:33 pm
by foxpup
Thanks Grey! Works well on lbry.tv or odysee.com as well.
(Not laughing, just smiling )
Re: View Youtube without ads
Posted: Fri Mar 19, 2021 6:01 pm
by amethyst
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. In cases where youtube forces you to stream from their site only, install an adblock plugin. To actually download a file, a site like 9xbuddy.com works great.
Re: View Youtube without ads
Posted: Fri Mar 19, 2021 7:33 pm
by Grey
amethyst wrote: ↑Fri Mar 19, 2021 6:01 pm
You can easily play all your youtube videos
Yes we can . But specifically mpv is needed for what the arrow points to:
- mpv_hwdec.jpg (157.73 KiB) Viewed 3128 times
Re: View Youtube without ads
Posted: Sat Mar 20, 2021 6:01 am
by MochiMoppel
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?
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 (78.67 KiB) Viewed 2261 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