MPV
mpv is the best player for me.
Arabic subtitle
To enable Arabic subtitles, you need to add some configuration.
On Mac
vi ~/.mpv/config
slang=ar
sub-codepage = utf8:cp1256
On Windows
-
Download this font: http://www.fontsquirrel.com/fonts/DejaVu-Sans
-
create config file
C:/Users/[user]/AppData/Roaming/mpv/config
sub-codepage = utf8:cp1256 # Path to the font subfont=C:\Users\[user]\Downloads\player\fonts \DejaVuSans.ttf
Stream
# Video
mpv --ontop --no-border --geometry=100%:0% URL
# Only Audio
mpv --no-video URL
// or
mpv --ytdl-format "bestaudio" URL
Options
- --ytdl-format usually 18 means medium, and 22 means best. Best is the default settings. To list supported format by a video
youtube-dl --list-formats URL
- --no-video will try to download only audio, So it could save bandwidth.
- --ontop
- --no-border
- --geometry position of the window when open. Right and down –geometry=100%:0%
- --loop
Download playlist
sync
youtube-dl -f best URL
parallel
Get list of urls
youtube-dl -j --flat-playlist 'URL' | jq -r '"https://youtu.be/"+ .url' > urls.txt
cat urls.txt | xargs -n 1 -P 8 youtube-dl -f best
# -n 1 indicates one url for each youtube-dl call; -P 4 indicates 4 parallel youtube-dl calls
docker
docker run -d -v /Users/yaser/Downloads/youtube-dl:/downloads qmcgaw/youtube-dl-alpine URL -ciw --write-auto-sub -o "/downloads/%(title)s.%(ext)s"
Ref: