From f9e86efdaae673ad82a07518b97f868940e1eb9c Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 6 Jul 2023 07:54:31 +0300 Subject: fix: Adjust titles Add "duck-tape" function to fix titles that keep "unicode" ='= and ="= --- yeetube.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/yeetube.el b/yeetube.el index b109b70..592faa9 100644 --- a/yeetube.el +++ b/yeetube.el @@ -120,6 +120,15 @@ Example Usage: (format "%s %s" yeetube-player url) nil 0) (message "Opening with %s" yeetube-player)))) +;; we should use something like +;; (decode-coding-region (point-min) (point-max) 'utf-8 +;; (get-buffer-create "decoded")) +;; in yeetube-search to make sure titles are always correct +;; this is a quick "duck-tape" fix. +(defun yeetube-fix-title (title) + "Adjust TITLE." + (replace-regexp-in-string "'" "'" + (replace-regexp-in-string """ "\"" title))) (defun yeetube-insert-content (prefix url videoTitles videoIds) "Insert video links with titles into the buffer. @@ -135,7 +144,8 @@ PREFIX [[URL/watch?v=VIDEOID][VIDEOTITLE ]]" (cl-loop for (videoId . videoTitle) in (cl-mapcar #'cons (reverse videoIds) (reverse videoTitles)) do (insert (format "%s [[%s/watch?v=%s][%s ]]\n" - prefix url videoId videoTitle)))) + prefix url videoId + (yeetube-fix-title videoTitle))))) (defun yeetube-search (query) "Search for QUERY." -- cgit v1.2.3