diff options
author | Thanos Apollo <[email protected]> | 2023-07-20 14:30:57 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-07-20 14:30:57 +0300 |
commit | bd82655687325f159fcfc74e97ca854ee772aa65 (patch) | |
tree | 474cafcfb46dc4d3c9f6b6d14c3df2b754c63efc | |
parent | 18edc10a1aff1348d26c9d6b480f5f72940b78bf (diff) |
yeetube-fix-title: Adjustments
Since uusing decode-region 'utf-8 does not fix much, I guess
yeetube-fix-title is here to stay.
Rewrote this and added adjustments for u0026 - '&'
-rw-r--r-- | yeetube.el | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -159,12 +159,18 @@ It's recommended you keep it as the default value." (message "mpv play/pause")) (error "To use this function you need to have mpv installed & set yeetube-player to the default value"))) -;; this is a quick "duck-tape" fix. +;; Usually titles from youtube get messed up, +;; This should be fix some of the common issues. (defun yeetube-fix-title (title) "Adjust TITLE." - (replace-regexp-in-string "&" "&" - (replace-regexp-in-string """ "\"" - (replace-regexp-in-string "'" "'" title)))) + (let ((replacements '(("&" . "&") + (""" . "\"") + ("'" . "'") + ("u0026" . "&")))) + (mapc (lambda (replacement) + (setq title (replace-regexp-in-string (car replacement) (cdr replacement) title))) + replacements) + title)) (defun yeetube-insert-content (prefix url video-titles video-ids) "Insert video links with titles into the buffer. |