jaku / SnapCameraPreservation

MIT License
577 stars 77 forks source link

[Thought] Seems the web is exposing some lenses #30

Closed ctsstc closed 7 months ago

ctsstc commented 1 year ago

It seems you can search them, but not all of them have "try lens" on the web. https://lens.snapchat.com/924f374625604452a5d1273dad9d9726

I'm not sure if this is the endpoint you'd need that it fetches from that page after clicking the "try lens" https://api-kit.snapchat.com/com.snap.camerakit.v3.Lenses/groups/5823ca90-5e1a-44b4-a007-644cab5c6e64/lenses/59752180963 You cannot directly navigate there as there are authentication headers that are required.

It returns something like the following; I imagine the lnsUrl is the filter? https://bolt-gcdn.sc-cdn.net/3/4TrFy6k6nrG8zHOWHNtwY?bo=EhgaABoAMgF9OgEEQgYIw73ZmgZIAlASYAE%3D&uc=18

Ultimately it seems like they're still figuring out their rough web launch as not all lenses have the Try Lens on the web, and the current snap web seems to only have a small subset of lenses if I'm seeing it correctly?

{
  "lens": {
    "id": "59752180963",
    "name": "Crying",
    "vendorData": {},
    "content": {
      "lnsUrl": "https://bolt-gcdn.sc-cdn.net/3/4TrFy6k6nrG8zHOWHNtwY?bo=EhgaABoAMgF9OgEEQgYIw73ZmgZIAlASYAE%3D&uc=18",
      "lnsSha256": "27DF4AF94CFDEACA8FC6FAF5E76E419FB9DDA6C6D64800691DAEA10E022BC12E",
      "iconUrl": "https://cf-st.sc-cdn.net/aps/bolt/aHR0cHM6Ly9ib2x0LWdjZG4uc2MtY2RuLm5ldC8zL0dTbEg0ZVk0aFBuc01MbEYwUGNaOD9ibz1FaGdhQUJvQU1nRjlPZ0VFUWdZSXc3M1ptZ1pJQWxBU1lBRSUzRCZ1Yz0xOA._FMpng",
      "preview": {
        "imageUrl": "https://lens-preview-storage.storage.googleapis.com/previewmedia/preview_thumbnail/2237191d-e6df-432b-b222-cb9a4bceed2c_360_640.webp"
      },
      "assetManifest": [
        {
          "type": "DEVICE_DEPENDENT_ASSET_UNSET",
          "id": "LENSCORE_DEFAULT_RETOUCH_ASSET",
          "requestTiming": "REQUIRED",
          "assetUrl": "",
          "assetChecksum": ""
        },
        {
          "type": "DEVICE_DEPENDENT_ASSET_UNSET",
          "id": "LENSCORE_CAMEO_STATIC_EMOTION_CRYING_WEAKER",
          "requestTiming": "REQUIRED",
          "assetUrl": "",
          "assetChecksum": ""
        }
      ],
      "defaultHintId": "UNKNOWN_LENS_HINT",
      "hintTranslations": {},
      "lnsUrlBolt": "https://bolt-gcdn.sc-cdn.net/3/4TrFy6k6nrG8zHOWHNtwY?bo=EhgaABoAMgF9OgEEQgYIw73ZmgZIAlASYAE%3D&uc=18",
      "iconUrlBolt": "https://bolt-gcdn.sc-cdn.net/3/GSlH4eY4hPnsMLlF0PcZ8?bo=EhgaABoAMgF9OgEEQgYIw73ZmgZIAlASYAE%3D&uc=18"
    },
    "isThirdParty": false,
    "cameraFacingPreference": "CAMERA_FACING_UNSET",
    "featureMetadata": [],
    "lensCreator": { "displayName": "Snapchat" }
  }
}
jaku commented 1 year ago

I've already explored this option. That same data can be gotten directly from the page without trying the lens by checking the source as well, there is a JSON object inside a Githubissues.

  • Githubissues is a development platform for aggregating issues.