iamtheyammer / fetch-ford-service-manuals

Downloads HTML and PDF versions of Ford Service Manuals from PTS
GNU General Public License v3.0
32 stars 12 forks source link

General Issues #1

Closed cfazzini closed 3 months ago

cfazzini commented 2 years ago

Hi, this tool is great! Downloading the Workshop manual worked great, but I'm having an issue with the Cookie for the wiring diagrams. Which part of it should be in the CookieString text file?

I've tried seemingly every variation of the cookie:

value bm_sv=value bm_sv=value; bm_sv=value; Domain=.fordservicecontent.com; Path=/; Max-Age=6943; bm_sv=value; Domain=.fordservicecontent.com; Path=/; Max-Age=6943; HttpOnly

Nothing seems to work. :(

Any help would be greatly appreciated!

iamtheyammer commented 2 years ago

Dude-- crazy that you found this-- can I ask how?

Anyway, I had this issue too. I haven't done enough troubleshooting on it, personally. If you're on a Mac or a linux machine with a GUI running (gnome, etc), you can change some of the code to get Playwright to not be headless. Then, you can insert a page.pause() event before it downloads the wiring diagrams, sign in manually to PTS, make sure a wiring diagram works, then resume the Playwright debugger. I'm sorry I can't offer a better solution right now.

Thanks for using this project!

cfazzini commented 2 years ago

Haha, Github search, looking for tools for this. :D

Also, from the code it didn't seem to be an issue, but I commented out fetching the workshop manual in index.ts, so I didn't have to download that part again. Is there any cookies/session data that gets set in that process?

iamtheyammer commented 2 years ago

There isn't. Funnily enough, you don't actually need the PTS subscription to download the service manuals-- no cookie is required to fetch the cover or pages. You just need the subscription to get the stuff for params.json.

You do, however, need the subscription and cookie for Wiring Diagrams, as you've found out.

cfazzini commented 2 years ago

Got it to work by hardcoding the token in index.ts as cookieStringData = "bm_sv=value". It did get a 404 when it got to section 150 Connector Views. Looks like that goes to a different style page with many more subpages. (2022 F-150)

cfazzini commented 2 years ago

So I realized that method didn't really work. Just took a screenshot with a login page. Doh.

I then tried your suggestion of headed mode for Playwright. This worked better, however I realized it's only grabbing the first page of the Wiring diagrams. There is a url that returns the number of pages for each cell number.

Ex. https://www.fordservicecontent.com/Ford_Content/PublicationRuntimeRefreshPTS//wiring/PageList?environment=prod_1_3_4162022&book=EO2&bookType=svg&contentmarket=US&contentlanguage=EN&cell=089&page=1

This returns: ["001","002","003","004","005","006","007","008","009","010","011"]

To fully capture these pages, this will be needed. I will attempt to hack something together, at least for my purpose. I only have the 3 day sub so would like to at least get what I need. I may possibly just hardcode for now. I'm not much of a TS/JS dev.

I also noticed it's not capturing the drop downs in the service manual. Not sure if those would even be possible, as they seem to be single drop down at a time. (if another section is open, opening a different section closes that one).

As this seems to be more of a general issues I'm finding. I'll change the issue title. :)

buckchoklit commented 5 months ago

I am also getting a 500 error when attempting to download the wiring diagram. This has happened to two different vehicles over the course of two different days. Here's the error its spitting out (cookie redacted):

https://pastebin.com/aepXe98t

iamtheyammer commented 3 months ago

Should be resolved with the merge of #22