මේ කියන්න යන්නේ ඕනෑම video එකක් download කර ගන්න හැටි!
video එක විතරක් නෙවේ එකේ audio එකත් වෙනම ගන්න පුළුවන්!
මම මුලිකවම කියලා දෙන්නේ GNU/Linux වල කරන හැටි.. නමුත් පහල මම Windows සහ macOS සඳහා YouTube links දාලා තියනවා.
මේ GNU/Linux commands ඒ විදිහටම Windows සහ macOS සහ වෙනත් OS සඳහා වැඩ කරනවා කියලා මම හිතනවා.
tool එකේ / package එකේ නම තමයි youtube-dl.
මේකෙන් YouTube විතරක් නෙවේ පහත ලින්ක් එකේ දාලා තියන විදිහට websites 1000 කට වැඩි ප්රමාණයක video/audio download කර ගන්න පුළුවන්.
https://github.com/ytdl-org/youtube-dl/blob/master/docs/supportedsites.md
මම මෙතන පහල දාන්නේ youtube-dl වල ගොඩක් ම ප්රයෝජනවත් වෙන commands ටිකක්.
මම මේවා සාරාංශ කර ගත්තේ මෙන්න මේ පහල web එකෙන්.
https://ostechnix.com/youtube-dl-tutorial-with-examples-for-beginners/
මම සාරාංශ කර ගත්ත note එකක් පහල දානවා. ඒක තේරුම් අරගෙන පාවිච්චි කරලා බලන්න.
Windows වල කරන විදිහ.
----------------------------------
macOS වල කරන විදිහ.
--------------------------------
Note එක මම text file එකක් විදිහට මෙතන attach කරලා තියනවා. එක අරගෙන තියාගන්නත් පුළුවන්.
comment එකක් දාගෙන යන්න... අවුල් තියන ඒවා කියන්න. අපිඋ බලමු කොහොමද මොනවද කරන්න පුළුවන් කියලා පසුව...
PS:
--------------------------
මට කියන්න අමතක උනා.. GNU/Linux භාවිතා කරන්නන්ට ගොඩක්ම වැදගත් වෙන තව දෙයක්..
මේ හෙන දිග commands කෙටි කර ගන්නේ කොහොමද?
මේක මේ thread එකට නෙවේ හැම දේටම ගොඩක්ම වැදගත් වෙන දෙයක්..
ඒක කරන්නේ මෙහෙම.. මේ මගේ වෙන note එකක්.
මේකත් attach කරලා තියනවා අරගන්න..
video එක විතරක් නෙවේ එකේ audio එකත් වෙනම ගන්න පුළුවන්!
මම මුලිකවම කියලා දෙන්නේ GNU/Linux වල කරන හැටි.. නමුත් පහල මම Windows සහ macOS සඳහා YouTube links දාලා තියනවා.
මේ GNU/Linux commands ඒ විදිහටම Windows සහ macOS සහ වෙනත් OS සඳහා වැඩ කරනවා කියලා මම හිතනවා.
tool එකේ / package එකේ නම තමයි youtube-dl.
මේකෙන් YouTube විතරක් නෙවේ පහත ලින්ක් එකේ දාලා තියන විදිහට websites 1000 කට වැඩි ප්රමාණයක video/audio download කර ගන්න පුළුවන්.
https://github.com/ytdl-org/youtube-dl/blob/master/docs/supportedsites.md
මම මෙතන පහල දාන්නේ youtube-dl වල ගොඩක් ම ප්රයෝජනවත් වෙන commands ටිකක්.
මම මේවා සාරාංශ කර ගත්තේ මෙන්න මේ පහල web එකෙන්.
https://ostechnix.com/youtube-dl-tutorial-with-examples-for-beginners/
මම සාරාංශ කර ගත්ත note එකක් පහල දානවා. ඒක තේරුම් අරගෙන පාවිච්චි කරලා බලන්න.
Code:
-------------------------
youtube-dl
-------------------------
https://youtube-dl.org/
https://wiki.archlinux.org/index.php/Youtube-dl
Suppoerted Websites
--------------------
https://github.com/ytdl-org/youtube-dl/blob/master/docs/supportedsites.mdyoutube-dl/blob/master/docs/supportedsites.md
Install
-------------
$ sudo pacman -S youtube-dl ffmpeg (for Arch family)
$ sudo apt install youtube-dl ffmpeg (for Debian faniliy)
.... .... .... etc
youtube-dl
----------
youtube-dl is a command-line program that lets you easily download videos and audio from more than a thousand websites.
ffmpeg
-----
FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video
Config(optional)
---------------
$ sudo nano ~/.config/youtube-dl/config
# Default download location
-o ~/Downloads/%(title)s.%(ext)s
Getting help
------------
$ youtube-dl --help
Get/Check Available formats
-------------
$ youtube-dl -F <url>
$ youtube-dl --list-formats <url>
Download video/audio or playlist
--------------------------
video
-----
$ youtube-dl <url>
$ youtube-dl <url-1> <url-2> <url-3>
audio (default Ogg (opus) extension)
-----
$ youtube-dl -x <url>
$ youtube-dl -x <url-1> <url-2> <url-3>
Download given format
----------------------
given extension
---------------
$ youtube-dl -f mp4 <url>
$ youtube-dl -x --audio-format mp3 <url>
given format code
-----------------
$ youtube-dl -f 160 <url>
Download with given path/to/filename
------------------------------------
$ youtube-dl -x --audio-format mp3 -o '~/Music/%(title)s.%(ext)s' <url>
Filename - title/uploader name/channel name/upload date
--------------------------------------------------------
$ youtube-dl -o '%(title)s by %(uploader)s on %(upload_date)s in %(playlist)s.%(ext)s' <url>
Download all URLs in a text file
-------------------------------
~/Music/youtube-urls.txt :-
<url-1>
<url-2>
<url-3>
<url-4>
<url-5>
$ youtube-dl -a ~/Music/youtube-urls.txt
Download videos in certain quality and/or format
------------------------------------------------
[#] best - Select the best quality format of the given file with video and audio.
[#] worst - Select the worst quality format (both video and audio).
[#] bestvideo - Select the best quality video-only format (e.g. DASH video). Please note that it may not be available.
[#] worstvideo - Select the worst quality video-only format. May not be available.
[#] bestaudio - Select the best quality audio only-format. May not be available.
[#] worstaudio - Select the worst quality audio only-format. May not be available.
audio-only with best quality.
--------------
$ youtube-dl -f bestaudio <url>
1 file with 2 different qualities combined
--------------
$ youtube-dl -f bestvideo+bestaudio <url>
2 files with 2 differnat qualities
--------------
$ youtube-dl -f 'bestvideo,bestaudio' <url>
given quality with specific resolution
--------------------------------------
$ youtube-dl -f 'bestvideo[height<=720]' <url>
$ youtube-dl -f 'bestvideo[height<=720]+bestaudio[height<=720]' <url>
$ youtube-dl -f 'bestvideo[height<=720],bestaudio[height<=720]' <url>
given quality with given format/extention
------------------------------------------
$ youtube-dl -f 'bestvideo[ext=mp4],bestaudio[ext=m4a]' <url>
if not available, go for the next
---------------------------------
$ youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' <url>
Set size limit for videos
-------------------------
$ youtube-dl --min-filesize 100M <playlist_url>
$ youtube-dl --max-filesize 500M <playlist_url>
$ youtube-dl -f 'bestvideo[filesize<200M]' <url>
Download videos by date-wise
----------------------------
download videos uploaded at an exact date - October 01, 2018
------------------------------------------------------------
$ youtube-dl --date 20181001 <URL>
Download videos uploaded on or before October 01, 2018
------------------------------------------------------
$ youtube-dl --datebefore 20180101 <URL>
Download videos uploaded on or after October 01, 2018
------------------------------------------------------
$ youtube-dl --dateafter 20180101 <URL>
Download only the videos uploaded in the last 6 months
------------------------------------------------------
$ youtube-dl --dateafter now-6months <URL>
Download videos between January 01, 2018 and January 01, 2019
--------------------------------------------------------------
$ youtube-dl --dateafter 20180101 --datebefore 20190101 <URL>
Download specific videos from playlist
-------------------------------------
Download the 10th file from a playlist
-------------------------------------
$ youtube-dl --playlist-items 10 <playlist_url>
Download multiple random files
-----------------------------
$ youtube-dl --playlist-items 2,3,7,10 <playlist_url>
Download a video playlist starting from 10 to end
-------------------------------------------------
$ youtube-dl --playlist-start 10 <playlist_url>
Download only the files starting from 2nd to 5th in a playlist
-------------------------------------------------------------
$ youtube-dl --playlist-start 2 --playlist-end 5 <playlist_url>
Download only videos suitable for specific age
---------------------------------------------
$ youtube-dl --match-title "let's play" --age-limit 7 --reject-title "nsfw" <playlist_url>
Set download speed limit
------------------------
$ youtube-dl -r 50K <URL>
Resume downloads
----------------
$ youtube-dl -c <URL>
Windows වල කරන විදිහ.
----------------------------------
macOS වල කරන විදිහ.
--------------------------------
Note එක මම text file එකක් විදිහට මෙතන attach කරලා තියනවා. එක අරගෙන තියාගන්නත් පුළුවන්.
comment එකක් දාගෙන යන්න... අවුල් තියන ඒවා කියන්න. අපිඋ බලමු කොහොමද මොනවද කරන්න පුළුවන් කියලා පසුව...

PS:
--------------------------
මට කියන්න අමතක උනා.. GNU/Linux භාවිතා කරන්නන්ට ගොඩක්ම වැදගත් වෙන තව දෙයක්..
මේ හෙන දිග commands කෙටි කර ගන්නේ කොහොමද?
මේක මේ thread එකට නෙවේ හැම දේටම ගොඩක්ම වැදගත් වෙන දෙයක්..
ඒක කරන්නේ මෙහෙම.. මේ මගේ වෙන note එකක්.
Code:
Create .bashrc file in your home directory if it's not there
-----------------------------------------------------------
/home/<username>/.bashrc
Comment line
------------
Comments begin with #
# this is a comment line
Edit bashrc file
----------------
$ sudo nano /home/<username>/.bashrc
save .bashrc
Load/Reload bashrc config
-------------------------
$ . /home/<username>/.bashrc
Create aliases for Linux terminal commands
------------------------------------------
#-------------
# youtube-dl = ydl
#-------------
alias ydl-chk='youtube-dl -F
alias ydl-mp3='youtube-dl -x --audio-format mp3
alias ydl-ba='youtube-dl -f bestaudio
alias ydl-bv='youtube-dl -f bestvideo
usage
-----
$ ydl-chk <URL>
$ ydl-mp3 <URL>
$ ydl-ba <URL>
$ ydl-bv <URL>
මේකත් attach කරලා තියනවා අරගන්න..
Attachments
Last edited:

habai dan apahu thiyanawa..