yourealwaysbe / forkyz

Forkyz Crosswords
GNU General Public License v3.0
39 stars 5 forks source link

LA TImes not fetching #40

Closed gkuenning closed 2 years ago

gkuenning commented 2 years ago

Los Angeles Times is listed as a supported puzzle source; however LA Times puzzles can't be fetched. That appears to be because the URL in the code is for the subscriptions page, not for the puzzle. Unfortunately I wasn't able to figure out the correct URL; the best I came up with was https://www.latimes.com/games/daily-crossword, which is a mess of Javascript and (obviously) doesn't contain the appropriate date.

yourealwaysbe commented 2 years ago

Confirmed on my end. Thanks.

The puzzle url you're looking at might be the url for supporting the puzzle source (used in the menu when playing the puzzle). Probably the download url has changed recently though. I'll have a look later today or tomorrow.

yourealwaysbe commented 2 years ago

It looks like a layer of security was added to puzzles that use AmuseLabs as a backend. See this issue on xword-dl.

It's not great security -- you just need to fetch a token from the main crossword picker page -- but it feels a bit too much like breaking in to me. My initial feeling is that i'll drop LA Times and Washington Post support (they both use AmuseLabs).

It's always possible to use xword-dl to get the puz file then import it into Forkyz.

gkuenning commented 2 years ago

Thanks; that seems like a sensible solution. May I suggest a tiny amount of documentation? I"m an LA Times subscriber (but prefer the Forkyz interface to the paper copy), so as a hacker it was easy to grab today's puzzle and drop it into /data/data/.../crosswords, renamed as 2022-3-6-LATimes. But that caused it to show up with that ugly name rather than the nice one. (And my approach wouldn't be friendly for most users.)

Anyway, I"m off to solve puzzles. And thanks for the super-quick response!

yourealwaysbe commented 2 years ago

Yep, i can add to the readme/help.

Btw, you can use "import puzzle" from the + menu on the puzzle list to add any puz (or other formats) file without having to copy into the data directory. It makes no difference at the moment (afaik) but ipuz is now the main backend file format. The import will do the conversion, and possibly give a better name.

yourealwaysbe commented 2 years ago

Could i ask a favour? Could you open an LA Times crossword on the webpage, then click the "play together" button (a person icon with a + next to it on the top bar), then send me the join URL? Also, could you print it as a PDF from the same site and send me that too? It might be possible to import from one of these.

I can't access LA Times crosswords from a browser here. I guess they have regional restrictions (though xword-dl works...).

You can email them to matthewhague@zoho.com to avoid publishing them here.

yourealwaysbe commented 2 years ago

Thanks for these, no luck. I was hoping either to be able to import the PDF, or download with the share link.

PDF isn't a great file format for parsing, but i was hoping the generated PDFs would be quite regular. Playing with the PuzzleMe webapp in the Washington Post i discovered that sometimes "print" gives you a PDF, but other times it gives you an HTML page and pops open the browser print dialog. Parsing PDF in multiple format is probably a fool's errand.

For the share link, it adds a playId parameter, and an "nt" one. I was hoping either of these might allow downloads from AmuseLabs. Unfortunately not.

I've removed the LA Times and the Washington Post Classic for now. The Washington Post Sunday still works though -- i guess they didn't want to lock that one off..?

gkuenning commented 2 years ago

Well, thanks for trying.

Since I'm writing (or should I just open an issue?) it would be nice if the "Import Puzzle" function allowed multi-select. Then I could browse to the puzzles just once no matter how many I'd downloaded with xword-dl.

Thanks for these, no luck. I was hoping either to be able to import the PDF, or download with the share link.

PDF isn't a great file format for parsing, but i was hoping the generated PDFs would be quite regular. Playing with the PuzzleMe webapp in the Washington Post i discovered that sometimes "print" gives you a PDF, but other times it gives you an HTML page and pops open the browser print dialog. Parsing PDF in multiple format is probably a fool's errand.

For the share link, it adds a playId parameter, and an "nt" one. I was hoping either of these might allow downloads from AmuseLabs. Unfortunately not.

I've removed the LA Times and the Washington Post Classic for now. The Washington Post Sunday still works though -- i guess they didn't want to lock that one off..?

-- Reply to this email directly or view it on GitHub: https://github.com/yourealwaysbe/forkyz/issues/40#issuecomment-1062266851 You are receiving this because you authored the thread.

Message ID: @.***>

-- Geoff Kuenning @.*** http://www.cs.hmc.edu/~geoff/

A programmer who can't write readable prose is as incompetent as one who can't produce working code.

yourealwaysbe commented 2 years ago

Since I'm writing (or should I just open an issue?) it would be nice if the "Import Puzzle" function allowed multi-select.

This is a nice idea, i'll add that. I expect it will be fairly straightforward (but we'll see).

yourealwaysbe commented 2 years ago

I think this is now handled, reopen if i forgot something.