qsniyg / maxurl

Finds larger/original versions of images and videos
https://qsniyg.github.io/maxurl/
Apache License 2.0
1.11k stars 69 forks source link

Improve/add google rules #394

Closed liamengland1 closed 4 years ago

liamengland1 commented 4 years ago

https://www.google.com/search?q=white+house map img:

https://www.google.com/maps/vt/data=Leddz2aqp_Mk825wP5mcK9LgV2vB9rrZ-gvvKK-Ugecwh1qQHGzTEEgosor4epP7N6Pe3z-RrkL5-HRw0yd3pLvxHB-MYAVoZKvZosa5pcpSuLl6tGPm3VCJy5EXcUWkIrJoWRteRk88o0FHcAJJA0bT43kNr6lDe8EFLf-zCe8GnQdHl1pCqIOP5FFttLmsi_qxdTEdIf3iW8Q4846B7Ll3d_wt&w=226&h=160

larger:

https://www.google.com/maps/vt/data=Leddz2aqp_Mk825wP5mcK9LgV2vB9rrZ-gvvKK-Ugecwh1qQHGzTEEgosor4epP7N6Pe3z-RrkL5-HRw0yd3pLvxHB-MYAVoZKvZosa5pcpSuLl6tGPm3VCJy5EXcUWkIrJoWRteRk88o0FHcAJJA0bT43kNr6lDe8EFLf-zCe8GnQdHl1pCqIOP5FFttLmsi_qxdTEdIf3iW8Q4846B7Ll3d_wt&w=1000&h=1000

Bug:

https://lh5.googleusercontent.com/p/AF1QipO6icCir3anUv5DaIZ_BnxDPPH68UY-MOaFsX7p=w203-h135-k-no is correctly converted into https://lh5.googleusercontent.com/p/AF1QipO6icCir3anUv5DaIZ_BnxDPPH68UY-MOaFsX7p=s0?imgmax=0

But the userscript converts https://lh6.googleusercontent.com/-mDUUR7fmn88/AAAAAAAAAAI/AAAAAAAAAAA/QPAzsKvhSI8/w60-h60-p-rp-mo-ba4-br100/photo.jpg into https://lh6.googleusercontent.com/-mDUUR7fmn88/AAAAAAAAAAI/AAAAAAAAAAA/QPAzsKvhSI8/s0/photo.jpg=s0?imgmax=0? The =s0?imgmax=0 is not needed and could cause issues. You should perhaps test if the url ends with an filetype. Another URL where this happens: https://yt3.ggpht.com/-_hLOuXOzYjo/AAAAAAAAAAI/AAAAAAAAAAA/v_Jxw0Hb3g0/s100-c-k-no/photo.jpg

Add rule:

https://geo1.ggpht.com/cbk?panoid=G27yBPFPohgfkiutzyysbg&output=thumbnail&cb_client=search.gws-prod.gps&thumb=2&w=408&h=240&yaw=108.68918&pitch=0&thumbfov=100
http://geo1.ggpht.com/cbk?panoid=d40wlmjGrvogT9sMM2qtbQ&output=thumbnail&cb_client=search.LOCAL_UNIVERSAL.gps&thumb=2&w=226&h=79&yaw=275.8587&pitch=0&thumbfov=100
http://geo2.ggpht.com/cbk?panoid=O18JgRVAodL2YIY25fKQMA&output=thumbnail&cb_client=maps_sv.tactile.gps&thumb=2&w=203&h=100&yaw=308.62723&pitch=0&thumbfov=100
https://geo0.ggpht.com/cbk?cb_client=unknown_client.imagery_viewer&output=thumbnail&thumb=2&panoid=cGW-aVnLXlz5XJ5uwSkghA&w=203&h=100&yaw=0&pitch=0&thumbfov=114&ll=40.761252,-73.983148
https://geo1.ggpht.com/cbk?panoid=A4CFdXUsSPNH3MJ8fTKewQ&output=thumbnail&cb_client=unknown_client.imagery_viewer.gps&thumb=2&w=203&h=100&yaw=12.454683&pitch=0&thumbfov=100
https://geo0.ggpht.com/cbk?panoid=kMPqJ2aE74HIkcdPzxrrSQ&output=thumbnail&cb_client=maps_sv.tactile.gps&thumb=2&w=224&h=298&yaw=146.99554&pitch=0&thumbfov=100
http://geo1.ggpht.com/cbk?panoid=E4d18oYQKj_Q2pT241ZGQA&output=thumbnail&cb_client=maps_sv.tactile.gps&thumb=2&w=203&h=100&yaw=5.8799515&pitch=0&thumbfov=100
https://geo1.ggpht.com/cbk?panoid=O18JgRVAodL2YIY25fKQMA&output=thumbnail&cb_client=maps_sv.tactile.gps&thumb=2&w=203&h=100&yaw=158.44202&pitch=0&thumbfov=100

all of these ggpht.com/cbk urls are currently mishandled.

qsniyg commented 4 years ago

Thank you very much for all the examples and the detailed explanation!! I've implemented them now.

However, re: =s0?imgmax=0, ?imgmax=0 is required for some images:

https://lh4.ggpht.com/__zoKJ77EvEc/TO-9wdVTcwI/AAAAAAAAJEA/SbyR-4a03S0/dekotora%20%289%29%5B2%5D.jpg=s0

https://lh4.ggpht.com/__zoKJ77EvEc/TO-9wdVTcwI/AAAAAAAAJEA/SbyR-4a03S0/dekotora%20%289%29%5B2%5D.jpg=s0?imgmax=0

IIRC there was also an example where =s0 wasn't needed, but I forgot to write it down.

As for =s0, it might be unnecessary, but I also haven't find any examples where it causes issues, and it doesn't appear to affect the filename either. For now, I'd prefer to keep it, in case removing it will cause some URLs to not be sent to their maximum size (even though I doubt it, but google is pretty weird haha). If you find any URLs where it causes a problem though, please let me know!! :)

liamengland1 commented 4 years ago

Thanks! I'll close this now :)