From 9d1430c90b21b4ada69af9ec29d199546205c148 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 9 Feb 2024 08:44:35 +0200 Subject: Add yeetube-request-headers Rewrite yeetube-search to use yeetube-request-headers as well. --- yeetube.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/yeetube.el b/yeetube.el index e4e9225..5c28324 100644 --- a/yeetube.el +++ b/yeetube.el @@ -268,7 +268,14 @@ This is used to download thumbnails from `yeetube-content', within '(("Relevance" . "EgIQAQ%253D%253D") ("Date" . "CAISAhAB") ("Views" . "CAMSAhAB") - ("Rating" . "CAESAhAB"))) + ("Rating" . "CAESAhAB")) + "Filter codes.") + +(defvar yeetube-request-headers + '(("Accept-Language" . "Accept-Language: en-US,en;q=0.9") + ("Accept" . "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8") + ("User-Agent" . "Mozilla/5.0 (Windows NT 10.0; rv:122.0) Gecko/20100101 Firefox/122.0")) + "HTTP Request extra headers") (defun yeetube-get-filter-code (filter) "Get filter code for sorting search results." @@ -278,8 +285,7 @@ This is used to download thumbnails from `yeetube-content', within (defun yeetube-search (query) "Search for QUERY." (interactive "sYeetube Search: ") - (let ((url-request-extra-headers - '(("Accept-Language" . "Accept-Language: en-US,en;q=0.9")))) + (let ((url-request-extra-headers yeetube-request-headers)) (with-current-buffer (url-retrieve-synchronously (concat "https://youtube.com/search?q=" -- cgit v1.2.3