autopkg / hansen-m-recipes

My recipes for Autopkg - https://github.com/autopkg
26 stars 49 forks source link

Rhinoceros download methodolgy has changed on server. #5

Closed jps3 closed 9 years ago

jps3 commented 9 years ago

I noted today that the Rhinoceros.download recipe was raising an error: Error in com.github.jps3.munki.Rhinoceros: Processor: URLTextSearcher: Error: No match found on URL: http://www.rhino3d.com/download/wenatchee/5.0/wip?current_page=download_new

I dug around a little bit, and I thought some of the following could save you some time updating the recipe file. Note I have not actually downloaded the resultant *.dmg and checked to see how or where this new license key code is used, as my Internet connection at home today is very slow and with frequent lags and dropouts. (Otherwise I would have been happy to go further with this.)

That URL now forwards to http://www.rhino3d.com/download/rhino-for-mac/5.0/wip which contains a form asking for an email address. The form appears to accept pretty much any input of the form x@y.z (even 1@2.3 worked). When the Next button is clicked, the next page displays a license key (of form XXXX-XXXX-XXXX-XXXX-XXXX-XXXX) and a link to the *.dmg file.

Using curl, I could post a request of the initial form:

curl -sLf -d 'email=x%40y.z&direction_next=Next+%3E&current_page=license_info' http://www.rhino3d.com/download/rhino-for-mac/5.0/wip

The returned HTML contains:

<div style='text-align:center'>
<p style="border:1px solid #ddd; background-color:#ffffcc; padding:10px;">Use the following Rhino For Mac 5.0 license key to install<br/><b><nobr>XXXX-XXXX-XXXX-XXXX-XXXX-XXXX</nobr></b></p><p>This license key has been emailed to <b>x@y.z</b></p>
<a class='btn download_link' style='display:inline-block;text-align:center;'  href="http://files.mcneel.com/Releases/Rhino/5.0/Mac/rhinoceros_wip_5A683.dmg">Download  Now</a>

I've forked your repo here and have started to work on a RhinocerosUrlProvider but I am not finished yet. (Python’s urllib and etree libraries drive me crazy, I wish the requests and BeautifulSoup ones was standard!).

Alternatively, Since I have recipes based off of your Rhinoceros.download (.pkg and .munki), I can just make a new, updates .download and place it in my repo. I do not wish to make any assumptions, step on toes, etc. It's been great leveraging off of the .download recipe you'd made.

-Jason

jps3 commented 9 years ago

Found that it uses a Sparkle update routine. Unfortunately that just takes one to the form listed above here. Looks like a custom Processor will be necessary...

hansen-m commented 9 years ago

Thanks for looking into this and feel free to add the .download recipe into your repo and I'll remove mine. It sounds like you've got a good handle on it but let me know if you you'd like a second set of eyes on the code or anything.

jps3 commented 9 years ago

I've worked on updating and moving everything to my autopkg repo. I currently am working in a branch at: https://github.com/autopkg/jps3-recipes/tree/move_updates_from_hansen_m/Rhinoceros if you care to glance a second pair of eyes that way. I still have to do some cleanup and debugging. Also, I've not yet had a chance to see what Rhinoceros.app does with the licensing information. Does it create or modify a plist? If so, could that be put in MCX, or /Library/Preferences or elsewhere such that it's available to all users of a computer?

jps3 commented 9 years ago

I've pushed my updates, and merged them into master. It is at https://github.com/autopkg/jps3-recipes/tree/master/Rhinoceros [https://github.com/autopkg/jps3-recipes/tree/master/Rhinoceros] for those who may be following or using this.

Downloads are fine. Rhinoceros now has licensing, even if (for now) free. That part can't really be automated as far as I can tell. There is a GUI on the first launch of the app, which requires admin privs at one point. However, as far as AutoPkg goes, the new recipes should work fine. At least, they seem without any major issues I've noticed.