Tiny Core Linux

Tiny Core Base => Corepure64 => Topic started by: aus9 on May 02, 2023, 07:58:41 AM

Title: youtube downloader discussion
Post by: aus9 on May 02, 2023, 07:58:41 AM
Hi

recently I looked at youtube-dl and altho it has update compared to our version in Apps, its still old at 17 Dec 2021.
also my skills in python are not great.
AND the web says its often throttled

However I just tested yt-dlp from my $HOME/.local/bin and its a beauty.

Also gadget42 mentions it http://forum.tinycorelinux.net/index.php/topic,25474.msg163402.html#msg163402 (http://forum.tinycorelinux.net/index.php/topic,25474.msg163402.html#msg163402)

It has a similar NO licence to youtube-dl so I think I will package it.

But is there something better?

2) if its a video download  result is a webm....visuals appear for me in vlc but only plays in qmplay2. Only tested 2 players sorry
if I use -x to download audio only....result is opus and plays well in both players YMMV

3) you can download it and load python3(something) ...stick it in $HOME/.local/bin and run it like this
Code: [Select]
cd Downloads
python3  yt-dlp https://youtu.be/fS4Jd9nhj7U

or put -x between yt-dlp and url to download the audio only

YMMV
Title: Re: youtube downloader discussion
Post by: vinceASPECT on May 02, 2023, 11:59:41 AM
Sir,

There could well be other Linux based apps as clients for youtube
and as clients for youtube downloading.

.......i did detail a simple way to do "youtube downloading and youtube searching" via a simple TEXT only web browser........ such as the "Links" web browser.....

Once found, you can then play the resulting  youtube movie or download it or  download it's audio...... you can then play it  using the free "FFPLAY" media player which is inside FFMPEG on Linux.

so.........

(a)
For doing an identical YOUTUBE search as happens on the YT native web site
you can go here ....
"www.tonvid.com" and search for any movie
 using  a "text only" web browser and a movie keyword

(b)
You can then COPY THE LINK of the video of choice from your searching in (a)
and paste it into this site...
www.genyt.net
and click search.
Click the resulting FOUND video.
Then click "generate download links"


(c)  RIGHT CLICK any download link that interests you from (b)
and go "SAVE or DOWNLOAD the movie file." giving it a name.


Should you just want to  DIRECTLY STREAM & WATCH the movie link from (b) in "FFPLAY" media player then.....
 
1) RIGHT CLICK the download link of (b) and go "DISPLAY"
and then....
2) Go to the menu of the "text only" web browser under BOOKMARKS
click  "ADD THE CURRENT PAGE" as a bookmark
3) Then Open the Tinycore text editior tool and under HOME
directory you should eventually  see the "LINKS" folder if you clicked "SHOW HIDDEN FILES"
4) click the LINKS FOLDER and you should see the "bookmarks" file.
5) Open that "bookmarks" file in the text editor and you will see your movie URL LINK ADDRESS of your interest ......
6) Copy that URL link using highlight and copy..... then MIDDLE CLICK to paste
the URL into an FFPLAY media player terminal........and then PLAY the movie

thanks
C


ps.........below is the FFPLAY media player command i would use to play stuff...

(at the terminal prompt)........
ffplay -fast -framedrop -cpuflags -sse+sse2+sse3+sse4.1+sse4.2+mmx+avx -threads auto -x 195 -y 158 -hide_banner -sync audio "the movie link.mp4"
(if it's just audio you are playing add the "-vn" and "-nodisp" flags

.....Also, your CPU flags may vary as it depends on your CPU type.....for example, a Raspberry Pi arm CPU may be

ffplay -fast -framedrop -cpuflags -armv6+something+somethin etc............bla bla bla

thx
C
Title: Re: youtube downloader discussion
Post by: patrikg on May 02, 2023, 01:18:23 PM
I think you can use youtube-dl and update it with just like this.
It will update it self.

Code: (bash) [Select]
youtube-dl -U

-U, --update      Update this program to latest version. Make sure that you have sufficient permissions (run with sudo if needed)
Title: Re: youtube downloader discussion
Post by: CNK on May 02, 2023, 04:26:25 PM
The last youtube-dl release broke with YouTube a while ago, but has been fixed in the development version. I just unziped the release file and applied the fix manually (as described in a GitHub issue thread) because it's just one line. There are also "nightly" type "build" of the executable zip file available.

The video format options for a video URL are shown with the "-F" option, then specified when downloading with "-f [format ID]". For YouTube I always use "-f 18" and get usable video+audio at a relolution that's good enough for me.
Title: Re: youtube downloader discussion
Post by: aus9 on May 02, 2023, 04:36:50 PM
hi
Quote
The last youtube-dl release broke with YouTube a while ago
that would explain a bit eh?

Quote
I think you can use youtube-dl  and update it
Yes I know this but my question was is there something better

Hi  vinceASPECT
I can search YT using qmplay2, and I am ex MS so prefer GUI over text browsers.

To anyone,
Code: [Select]
yt-dlp -h as a swag of options so I will wait a few more days for a better alternative and if there is nothing faster, easier etc to use....I think I will go with this, so anyone who wants to maintain youtube-dl be my guest.

thanks for reading

Title: Re: youtube downloader discussion
Post by: aus9 on May 02, 2023, 06:11:31 PM
Ok it looks like old youtube movies were mp4, while newer ones are webm format YMMV
 and I have rebooted to test no certificates so in $HOME/.local/bin  I do
Code: [Select]
python3 yt-dlp --no-check-certificate https://youtu.be/V-oquRLcmAM
# result is mp4 but
python3 yt-dlp --no-check-certificate https://youtu.be/L51wnCLOd4g
# result webm
# found on net converter command, ffmepg4 is a dep of qmplay2
ffmpeg -i aaron.webm  -c copy aaron.mp4

also the help needs python prefixed
Code: [Select]
python3 yt-dlp -honline help
https://github.com/yt-dlp/yt-dlp#readme

so this is interesting to me...find formats that you could download
Code: [Select]
python3 yt-dlp --no-check-certificate --list-formats https://youtu.be/V-oquRLcmAM
SNIP
ID  EXT   RESOLUTION FPS CH ���  FILESIZE  TBR PROTO ��� VCODEC       VBR ACODEC      ABR ASR MORE INFO
250 webm  audio only      2 ���   2.79MiB  71k dash  ��� audio only       opus        71k 48k low, webm_dash
140 m4a   audio only      2 ���   4.99MiB 127k dash  ��� audio only       mp4a.40.2  127k 44k medium, m4a_dash
SNIP to show only 2 audio

and then I do
Code: [Select]
python3 yt-dlp --no-check-certificate -f 140 https://youtu.be/V-oquRLcmAMresult is m4a format rather than choosing -f 250 to have opus....as TBR is higher for 140
Title: Re: youtube downloader discussion
Post by: CNK on May 02, 2023, 06:55:37 PM
so this is interesting to me...find formats that you could download
Code: [Select]
python3 yt-dlp --no-check-certificate --list-formats https://youtu.be/V-oquRLcmAM
SNIP
ID  EXT   RESOLUTION FPS CH ���  FILESIZE  TBR PROTO ��� VCODEC       VBR ACODEC      ABR ASR MORE INFO
250 webm  audio only      2 ���   2.79MiB  71k dash  ��� audio only       opus        71k 48k low, webm_dash
140 m4a   audio only      2 ���   4.99MiB 127k dash  ��� audio only       mp4a.40.2  127k 44k medium, m4a_dash
SNIP to show only 2 audio
Those are available from youtube-dl as well (this is the "-F" option that I mentioned before).

Anyway, I'm not sure what you think is better (I'm sticking with youtube-dl myself, and I'll think about submitting an updated TC extension for it if you're no longer maintaining that), but I guess that if you like GUIs then pipe-viewer (https://github.com/trizen/pipe-viewer) might be better for you. It has GTK3 GUI and terminal interfaces, and the YouTube downloader is built in. It's written in Perl instead of Python.
Title: Re: youtube downloader discussion
Post by: aus9 on May 02, 2023, 07:29:10 PM
playing further with formats be aware of mp4_dash format. This does not play natively in vlc or qmplay2
so if you found a high TBR but shows mp4_dash on right hand side eg
Quote
                                                                            TBR
137 mp4   1920x1080   25    ���  135.27MiB 3508k dash  ��� avc1.640028   3508k video only     1080p, mp4_dash

so you are better off IMHO just download it as a webm and convert it if your player does not know how to play that format.

Hi CNK
I will check it pipe-viewer
Yes please update youtube-dl if you are happy to.
Title: Re: youtube downloader discussion
Post by: vinceASPECT on May 03, 2023, 01:05:34 AM
HEllo,

it seems that even the free "youtube-dl" tool on MSoft is a 2021 version Latest.....2 years old and it does not seem to work

hmmm
thx
C
Title: Re: youtube downloader discussion
Post by: aus9 on May 03, 2023, 02:02:34 AM
Hi CNK

I started on the perl module make dependencies showing up
pipe-viewer (https://github.com/trizen/pipe-viewer)
and even tho I have not finished I have made up my mind after reading various build.logs on the actual run dependences,
that a perl based youtube downloader is not for me.
Actually the web site does not describe it as a downloader...rather it claims  for searching and playing videos from YouTube.
so far I have successfully used cpanm to get modules as per
Quote
# instmodsh -> input l for list gives
# Installed modules are:
# B::COW     # Clone     # Data::Dump     # Date::Parse    # Encode::Locale   # File::Listing
# HTML::Parser   # HTML::Tagset   # HTTP::Cookies   # HTTP::Daemon  # HTTP::Date   # HTTP::Message
# HTTP::Negotiate  # IO::HTML  # IO::Socket::SSL  # JSON. # LWP  # LWP::MediaTypes  # LWP::Protocol::https
# Mozilla::CA  # Net::HTTP  # Net::SSLeay  # Perl  # Test::Fatal  # Test::Needs  # Test::RequiresInternet
# Test::Warnings  # Try::Tiny  # URI   # WWW::RobotRules

at my skill level....and patience ...I think yt-dlp is much simpler to build and good enough for me.

2) I am not sure if I made myself clear in last post....movies that are mp4_dash -> output as file.mp4
but in qmplay2 or vlc....the video image displays but not audio out
Title: Re: youtube downloader discussion
Post by: aus9 on May 03, 2023, 02:12:11 AM
Hi vinceASPECT
yes that is an issue for MS users too.

I am more concerned that youtube-dl has in the past been throttled in speed making it unworkable for an impatient person.
I do not have that issue for my new toy.

If interested you can try the ELF stand alone or python dependency versions of yt-dlp

stand alone
https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux
move it to your $HOME/.local.bin ensure it executable and run it as
Code: [Select]
yt-dlp <url>
python dependency such as python3.9  needs loading
https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp
its a script does so no need to do anything other than load python3.9 and run it as above in my posts

for MS there is mention of a Win7 but not sure if that will work on say Win10/11

good luck
Title: Re: youtube downloader discussion
Post by: aus9 on May 03, 2023, 06:24:45 PM
Hi vinceASPECT
correction for
Quote
Its a script does so no need to do anything other than load python3.9 and run it as above in my posts

nope, make script executable and  below should work
Code: [Select]
$ yt-dlp --no-check-certificate <url>
or load ca-certificates and drop the --no-check-certificate string

I am sending a package submission off shortly so if you like, wait for that?
Title: Re: youtube downloader discussion
Post by: vinceASPECT on May 04, 2023, 02:08:06 AM
Aus 9

well it would always be useful to have an extension in the repo
that is a Youtube-DL alternative.

here this machine runs the Tinycore 64 build........so i don't know
if your extension would appear in that repo..

thanks
C
Title: Re: youtube downloader discussion
Post by: aus9 on May 05, 2023, 01:33:06 AM
Hi vinceASPECT
yes TC64 14x is what has been submitted
Title: Re: youtube downloader discussion
Post by: vinceASPECT on May 05, 2023, 07:14:18 AM
Yes, Sir,

......there are some minor "wrongs" in my post on  Youtube videos
via a text only web browser.   (reply #1 .......in this thread topic)
 

......some of the STEPS are "press enter" when a movie link is highlighted......not RIGHT CLICK

To grab the URL from the "bookmark.html" TEXT FILE you just "search" the file for the movie file extension.........for example.......".mp4" ........
Everything Back from the "mp4" to "HTTP" is the URL link for the movie of your choice.......
 ......... (at least a paragraph long URL )

you can just use common sense.

Also users can DROP the X -- Y flags for sizing the Video window in FFPLAY
media player.......just let it be  whatever size it will be

Thanks
C


Title: Re: youtube downloader discussion
Post by: CardealRusso on May 05, 2023, 08:27:37 PM
you posts looks ai generated (not from chatgpt, but some free model)
Title: Re: youtube downloader discussion
Post by: gadget42 on May 08, 2023, 11:49:48 PM
if we have a package for yt-dlp it should be like the one for firefox which fetches a "non-stale" version(reference firefox_getLatest.tcz)

this is especially important given the poor/failed performance of anything less that latest/current

20230509-0153am-cdt-usa-modified-added additional comment regarding poor/failed performance
Title: Re: youtube downloader discussion
Post by: aus9 on May 10, 2023, 07:34:04 AM
Hi gadget42

Are you referring to latest stable release or git release for yt-dlp version in that reply?
Title: Re: youtube downloader discussion
Post by: gadget42 on May 10, 2023, 11:24:57 PM
Hi gadget42
Are you referring to latest stable release or git release for yt-dlp version in that reply?
stable
Title: Re: youtube downloader discussion
Post by: aus9 on May 11, 2023, 01:43:27 AM
Hi gadget42

I run FF from $HOME also known as running FF from unpack. By doing so I break the pristine rule of TC but get automatic updates to latest version
yt-dlp is the latest stable AFAIK
Title: Re: youtube downloader discussion
Post by: CNK on May 26, 2023, 01:24:38 AM
Yes please update youtube-dl if you are happy to.

Looking into this deeper, the x86 repo has a get_youtube-dl.tcz extension (http://tinycorelinux.net/14.x/x86/tcz/get_youtube-dl.tcz.info) (announced here (http://forum.tinycorelinux.net/index.php/topic,20524.0.html)) which is probably a better way to go, except that because youtube-dl's latest release is so old it won't download a version that still works with YouTube today.

So what I think I'll try and do it to make a version of that script which also has the option of downloading the latest nightly build of youtube-dl (which I just tried making into an extension manually and it works well), and maybe yt-dlp as well. It might be a bit trickier downloading from GitHub instead of the yt-dl.org website though because GitHub don't put the release download links in plain HTML anymore (grumble grumble...).
Title: Re: youtube downloader discussion
Post by: aus9 on May 26, 2023, 07:00:19 AM
CNK

Quote
and maybe yt-dlp as well.

actually I have just realized that I did not compile (for the submission) ( I did do a compile but as per build its size was no better)
 so maybe my build is any arch, meaning TC64 could work on TC32
http://tinycorelinux.net/14.x/x86_64/tcz/src/yt-dlp/build-yt-dlp.sh

If you have time on TC32 use your web browser if interested click link and then load it with a python3 series to see what happens?
http://tinycorelinux.net/14.x/x86_64/tcz/yt-dlp.tcz

Hi Rich  IMHO its just a python script so my mistake in not calling it any arch
do you agree?

If so I will let Paul_123 know too
Title: Re: youtube downloader discussion
Post by: CNK on May 26, 2023, 07:57:53 AM
CNK
Quote
and maybe yt-dlp as well.

actually I have just realized that I did not compile (for the submission) ( I did do a compile but as per build its size was no better)
 so maybe my build is any arch, meaning TC64 could work on TC32
http://tinycorelinux.net/14.x/x86_64/tcz/src/yt-dlp/build-yt-dlp.sh

Yep, I haven't tested it but there's no reason why it shouldn't work on TC32. The only difference could be with the dependencies, and they look the same for python3.9.tcz on TC64 vs TC32. I also intend my version of the get_youtube-dl.sh script (which I just finished writing, but it's too late now for testing) to work on x86, x86_64, and PiCore.
Title: Re: youtube downloader discussion
Post by: CNK on May 26, 2023, 10:33:46 PM
I've posted in the original announcement thread (http://forum.tinycorelinux.net/index.php/topic,20524.msg169075.html#msg169075) my new version of the get_youtube-dl.sh script and a proposal to submit a new extension for the repos.
Title: Re: youtube downloader discussion
Post by: aus9 on May 27, 2023, 08:47:57 PM
I have found another mistake of mine. Wrong info in TC64 info file qmplay2. I have claimed it used yt-dl. It does not!
I only realized my mistake,today  when I went to source as I plan submitting qmplay2 for piCore64-14x
Quote
YouTube videos don't work without external "yt-dlp" software
ref
https://github.com/zaps166/QMPlay2#youtube

Code: [Select]
ls -al ~/.qmplay2/ | grep yt
-rwxr-xr-x    1 tc       staff      2747279 Mar 31 02:42 yt-dlp

no-one has complained hehe so I will leave it until an update maybe.
it needs python greater than 3.7 but I am using 3.9, if you search and play youtube within qmplay2.
Title: Re: youtube downloader discussion
Post by: jazzbiker on January 23, 2024, 06:43:32 AM
Hi!
Today I was in the mood to download the clip from youtube.com and was disappointed by youtube-dl fail. Thanks for pointing at the new youtube-dl home! yt-dlp accomplished the job successfully.
Of course I've
Code: [Select]
tc@box:~$ wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp instead of loading one extension in order to create another extension in order to wget the subject :-)
Today the version 2023-12-30 works.
Title: Re: youtube downloader discussion
Post by: gadget42 on January 24, 2024, 03:20:47 AM
thank you for this more-current advisory on the successful operation of yt-dlp!
Title: Re: youtube downloader discussion
Post by: CNK on January 24, 2024, 01:32:02 PM
FWIW the youtube-dl daily builds still work with YouTube as well. They're what I'm using. They can be downloaded with "get_youtube-dl.sh youtube-dl_daily", or for those who prefer to set things up manually:

(Sorry Rich, using code tags around (or any text under) this command causes a forum error (what exactly does it take to make CentralWare turn mod_security off, I wonder...)).

Code: [Select]
wget https://github.com/ytdl-patched/youtube-dl/releases/latest/download/youtube-dl
    [Edit]: Added code tags.  Rich
Title: Re: youtube downloader discussion
Post by: Rich on January 24, 2024, 01:52:22 PM
Hi CNK
It worked for me. Maybe the forum was just feeling cranky when you posted. ::)