unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: A way to watch (some) videos about Emacs with wget and mpv
Date: Sat, 31 Dec 2022 21:49:13 +0100	[thread overview]
Message-ID: <875ydrcn92.fsf@dataswamp.org> (raw)
In-Reply-To: CADs++6gK7aLRpDSSnqLtmyUahQgQ-ZfiCEz3hnKfjhN7106Gzg@mail.gmail.com

Eduardo Ochs wrote:

>   dl-video () {
>       local urls=${1:-$(<$DL_FILE)}
>       yt-dlp $dlp_opts -f 'bestvideo' ${=urls}
>   }
>   dl-720 () {
>       local urls=${1:-$(<$DL_FILE)}
>       yt-dlp $dlp_opts -f 'bestvideo[height=720]+bestaudio' ${=urls}
>   }
>
>   rm -Rv /tmp/dl-test/
>   mkdir  /tmp/dl-test/
>   cd     /tmp/dl-test/
>   dl-video 'http://www.youtube.com/watch?v=vs3-HGB6iEw'
>   # dl-720 'http://www.youtube.com/watch?v=vs3-HGB6iEw'
>
> I commented out the one with "dl-720" because it produces
> a file with the same name as the one with "dl-video" - this
> one:
>
>   How to Read a Greek Play [vs3-HGB6iEw].webm

Yes, because it's the same file. dl-video, with the
'bestvideo' setting without the additional qualifier, could in
theory have retrieved say a 1080p file, which I take it is
considered better, but apparently the best it could find was
the 720p one (and in practice, the 720p files are often just
as good), and that's also the one you get with dl-720 since
then it is even specified explicitely.

> Emanuel, do you have tricks to convert a youtube URL to the
> filename of the saved file

The URL?

The filename is, by default, the title of the YouTube page as
well as a video ID, this is probably used, among other things,
to separate the same material - but in different formats, i.e.
files - from each other.

> or to make yt-dlp save the name in a place that is easy
> to retrieve?

I'm not following? Name, place - what do you mean?

But you can configure the filename of a downloaded file, see
youtube-dl(1) line 679, "OUTPUT TEMPLATE".

  The current default template is %(title)s-%(id)s.%(ext)s.

So you use that with -o. The 's' is for string, probably.

https://dataswamp.org/~incal/data/MM

-- 
underground experts united
https://dataswamp.org/~incal




  reply	other threads:[~2022-12-31 20:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27 11:55 A way to watch (some) videos about Emacs with wget and mpv Eduardo Ochs
2022-12-27 12:00 ` Philip Kaludercic
2022-12-27 12:08   ` Eduardo Ochs
2022-12-27 12:13     ` Emanuel Berg
2022-12-28  1:56       ` Eduardo Ochs
2022-12-28  2:03         ` Emanuel Berg
2022-12-29 22:47           ` Eduardo Ochs
2022-12-31 20:49             ` Emanuel Berg [this message]
2022-12-27 12:44     ` Philip Kaludercic
2022-12-27 14:13       ` Emanuel Berg
2022-12-28  0:43       ` Eduardo Ochs
2022-12-28  1:03         ` Emanuel Berg
2022-12-28  5:46         ` Yuri Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875ydrcn92.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).