From 55e435fb7a3074cb756a41179d5c737ce2c69f3d Mon Sep 17 00:00:00 2001 From: Rahguzar Date: Sat, 16 Mar 2024 08:57:44 +0100 Subject: Use url-retrieve for youtube urls (for headers) --- yeetube.el | 11 +++++------ 1 file 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." -- cgit v1.2.3