-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathytmpv.1
112 lines (108 loc) · 2.57 KB
/
ytmpv.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
.TH ytmpv 1 2024-02-03 Linux
.SH NAME
ytmpv \- Download and play videos with
.BR dmenu (1)
and
.BR yt-dlp (1)
.SH SYNOPSIS
.SY ytmpv
.OP \-q
.OP \-p PLAYER
.OP \-d DIRECTORY
.OP \-g DOWNLOADER
.OP "\-a" SUBCOMMAND
.OP "\-s" SUBCOMMAND
.YS
[\fISUBCOMMAND\fR::]PROMPT
.SH DESCRIPTION
.B ytmpv
is a POSIX shell script that provides a interface through
.BR dmenu (1)
to download videos with
.BR yt-dlp (1)
or play them using
.BR mpv (1).
Subcommands can be specified at the start of the prompt and are separated from the
URL with "::". These subcommands will handle the URL in different ways.
.SH OPTIONS
.TP
.B \-q
Do not notify using
.BR notify-send (1)
when the video is done playing or downloading.
.TP
.BI \-p " PLAYER"
Set the video player from
.BR mpv (1)
to PLAYER.
.TP
.BI \-d " DIRECTORY"
Set the music directory from "$HOME/Music" to DIRECTORY.
.TP
.BI "\-a, \-s" " SUBCOMMAND"
Set the subcommand from PLAY to SUBCOMMAND.
.SH SUBCOMMANDS
.TP
.B PLAY
Play video with
.BR mpv (1)
or the player specified with the \-p option
the URL is passed directly to mpv as the first argument.
.TP
.B DOWN
Download the video using
.BR yt-dlp (1)
the video is not converted or saved to any specific directory.
.TP
.B XAUD
The user is prompted to select from the subdirectories of the specified Music
directory. Then prompted for a filename. The video's is downloaded and saved
to the specified filename and directory.
.PP
.B ytmpv
can also work in conjunction with
.BR ytfzf (1)
To scrape youtube search results and allow the user to select through
top search results. In this case, the prompt, normally treated as a URL is
treated as a search term. The 2 subcommands that allow this are SADA, which
downloads audio from videos (Like XAUD). And SAP, which plays videos (PLAY)
.TP
.B SADA
Get a video URL from the provided search term with
.BR ytfzf (1),
then preform the XAUD subcommand on it (Download Audio to Music Directory).
.TP
.B SAP
Get a video URL from the provided search term with
.BR ytfzf (1),
then preform the PLAY subcommand on it (Play with
.BR mpv (1)).
.SH EXAMPLES
.TP
.EX
.BR ytmpv " -q -p curl"
PROMPT: "https://www.foo.bar/1234"
.EE
Will download the video at "https://www.foo.bar/1234" with
.BR curl (1)
Will not notify the user if it fails.
.TP
.EX
.BR ytmpv " -a SAP"
PROMPT: "Linux"
.EE
Will show a menu of the top youtube search results for "Linux",
then play whatever one the user selects with
.BR mpv (1)
.SH AUTHOR
Written by Oliver Webb
.ME
Project page at
.UR https://www.github.com/oliverkwebb/ytmpv
.UE
.SH SEE ALSO
.BR yt-dlp (1)
.BR mpv (1)
.BR ytfzf (1)
.BR dmenu (1)