summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahguzar <[email protected]>2024-03-16 08:57:44 +0100
committerThanos Apollo <[email protected]>2024-03-17 13:27:46 +0200
commit55e435fb7a3074cb756a41179d5c737ce2c69f3d (patch)
tree77a3b6fd0bb4011fcedb2d6fb038b202c499542b
parent7b7e2c36ace7eff561675ae9dfaa8582e6c99dec (diff)
Use url-retrieve for youtube urls (for headers)
-rw-r--r--yeetube.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/yeetube.el b/yeetube.el
index b3658c7..181dc66 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -344,11 +344,11 @@ WHERE indicates where in the buffer the update should happen."
(defun yeetube-display-content-from-url (url)
"Display the video results from URL."
- (let* ((url-request-extra-headers yeetube-request-headers))
+ (let ((url-request-extra-headers yeetube-request-headers))
(if yeetube-enable-tor
(yeetube-with-tor-socks
- (url-queue-retrieve url #'yeetube--callback nil 'silent 'inhibit-cookies))
- (url-queue-retrieve url #'yeetube--callback nil 'silent 'inhibit-cookies))))
+ (url-retrieve url #'yeetube--callback nil 'silent 'inhibit-cookies))
+ (url-retrieve url #'yeetube--callback nil 'silent 'inhibit-cookies))))
(defun yeetube--image-callback (status entry buffer)
"Yeetube callback for thumbnail images handling STATUS.
@@ -374,7 +374,7 @@ Image is inserted in BUFFER for ENTRY."
(defun yeetube--retrieve-thumnail (url str buffer)
"Retrieve thumbnail from URL and show it in place of STR in BUFFER."
- (let* ((url-request-extra-headers yeetube-request-headers))
+ (let ((url-request-extra-headers yeetube-request-headers))
(if yeetube-enable-tor
(yeetube-with-tor-socks
(url-queue-retrieve url #'yeetube--image-callback `(,str ,buffer)
@@ -394,8 +394,7 @@ Image is inserted in BUFFER for ENTRY."
(format "https://youtube.com/search?q=%s%s"
(url-hexify-string query)
(if yeetube-filter
- (format "&sp=%s" (yeetube-get-filter-code yeetube-filter))
- ""))))
+ (format "&sp=%s" (yeetube-get-filter-code yeetube-filter)) ""))))
(defun yeetube-channel-id-at-point ()
"Return the channel name for the video at point."