Chobbes / org-chef

A package for making a cookbook and managing recipes with org-mode.
MIT License
327 stars 33 forks source link

Some sites don't work #28

Closed Shurakai closed 5 years ago

Shurakai commented 5 years ago

Using org-chef with allrecipes works fine (https://allrecipes.com/recipe/85452/homemade-black-bean-veggie-burgers/) but using it with budgetbytes or seriouseats doesn't work. I only receive the message

Contacting host: www.seriouseats.com:443 Contacting host: www.budgetbytes.com:443

I'm not sure how to debug this. Any advice? The recipe I want to download is https://www.budgetbytes.com/kimchi-fried-rice. Org-chef-insert-recipe returns immediately with the template, but no values are filled in.

Chobbes commented 5 years ago

Hi there!

Thanks for pointing this out -- I appreciate it! I usually use the inspector in firefox/chrome to look at the recipe in the webpage and see what tags I need to match on to extract the right values. Sometimes it's a bit of a pain (no good identifiers), usually it's not too bad.

When debugging there's a lot of calling the org-chef-*-fetch functions manually and expecting the output.

With the contacting host thing... Does retrying work? I have noticed that occasionally the requests get "stuck" for some reason.

Chobbes commented 5 years ago

Hmmm, url-retrieve-synchronously seems to be having troubles talking to https://www.budgetbytes.com/kimchi-fried-rice/

Server: cloudflare
Date: Mon, 29 Apr 2019 16:19:33 GMT
Content-Type: text/html
Content-Length: 269
Connection: close
CF-RAY: -

) (title nil 400 The plain HTTP request was sent to HTTPS port) (center nil (h1 nil 400 Bad Request)) 
 (center nil The plain HTTP request was sent to HTTPS port) 
 (hr nil) (center nil cloudflare) 

))

That might be a clue.

Shurakai commented 5 years ago

As it says "Bad Request", I assume something is wrong with the url-retrieve-synchronously call.

egh commented 5 years ago

See https://github.com/magit/ghub/issues/81

This works around the issue for me:

(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")

Chobbes commented 5 years ago

Thanks for that suggestion @egh, that fixes the problem for me as well... I'm wondering what I should do about this for the package, since it's obviously no good that this isn't working, but it's also probably not so kosher to set this for people, haha. Suggestions (or pull requests) welcome :).

Chobbes commented 5 years ago

I think I got it. Should be all better now :).

Thanks for the help @Shurakai and @egh!