summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-07-06 07:54:31 +0300
committerThanos Apollo <[email protected]>2023-07-06 07:54:31 +0300
commitf9e86efdaae673ad82a07518b97f868940e1eb9c (patch)
treefbfd97859c5d4cfca5cea1477b5e71e5de194d28
parent4c54d98f3c2357789baefabc4c2fc2a28c21a2a4 (diff)
fix: Adjust titles
Add "duck-tape" function to fix titles that keep "unicode" ='= and ="=
-rw-r--r--yeetube.el12
1 files changed, 11 insertions, 1 deletions
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 "&#39;" "'"
+ (replace-regexp-in-string "&quot;" "\"" 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."