diff options
author | Thanos Apollo <[email protected]> | 2023-07-08 11:32:11 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-07-08 11:32:11 +0300 |
commit | 496ca6a8fdac8e66d25f2547b649ee0094b74e92 (patch) | |
tree | 8a078c1e2f2a79ca05f14375be771d8c99fd7d0e | |
parent | d006e10bd7068d26ff3e4013da8c09191ac1fc7f (diff) |
yeetube-search: make yeetube-results limit only be a limiting factor
Previously the while loop would run until there are enough video-ids
to satisfy yeetube-results-limit(which was a stupid design by me).
Change to run loop while video-ids < limit & if search-forward
VIDEO-ID succeeds.
This also makes the previous error messages unnecessary.
-rw-r--r-- | yeetube.el | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -192,16 +192,10 @@ PREFIX [[URL/watch?v=VIDEOID][VIDEOTITLE ]]" t t) (goto-char (point-min)) (toggle-enable-multibyte-characters) - (while (< (length video-ids) yeetube-results-limit) - (condition-case err - (if is-youtube? - (search-forward "videoId") - (search-forward "watch?v")) - (error - (display-warning 'yeetube - (format - "Unable to find enough results, reduce yeetube-results-limit (%s)" - (error-message-string err))))) + (while (and (< (length video-ids) yeetube-results-limit) + (if is-youtube? + (search-forward "videoId" nil t) + (search-forward "watch?v" nil t))) (let* ((start (point)) (end (if is-youtube? (search-forward ",") |