[emacs-w3m:13849] emacs-w3m and youtu.be
Boruch Baum <[email protected]> Sun, 19 Sep 2021 10:10:08 -0400
| Newsgroups | gmane.emacs.w3m |
|---|---|
| Message-ID | <[email protected]> |
You are all probably are familiar with the existence of youtu.be as a
shortened version of youtube.com. I just now tried downloading such a
URL and found that it wasn't resolving properly. It seems that the URL
requires some modification in order to be recognized. This is done
automatically by the google/youtube servers when the sender's user-agent
is "supported" but emacs-w3m isn't one of those.
Thus, there are two solutions:
1) Change the user-agent for emacs-w3m (temporarily or permanently).
This can be done on the command-line via M-x w3m-user-agent-change,
or by modifying variable w3m-user-agent.
2) Have emacs-w3m auto-magically convert the URL by adding an entry to
variable w3m-uri-replace-alist. For example:
(push '("\\`https?://youtube.be/\\(.*\\)"
w3m-pattern-uri-replace "http://youtube,com/watch?v=3D\\1")
w3m-uri-replace-alist)
I've tested both techniques with my w3m-download.el PR that uses wget
and youtube-dl as the download back-ends.
If solution #2 is desirable to the project, I'd be happy to prepare a PR
separate from the w3m-download.el PR.
=2D-
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0
=2D-
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0