tajnymag / tinder-deblur

Simple script using the official Tinder API to get clean photos of the users who liked you
MIT License
293 stars 29 forks source link

[Bug] script isn't working anymore #13

Closed m7amad-nem closed 1 year ago

powext commented 1 year ago

I just added the first IF and the script got back to work

                const teaser = teasers[i];
        const teaserEl = teaserEls[i];
        const teaserImage = teaser.user.photos[0].url;

        let unblurredImage = teaserImage;

                if (teaserImage.includes('unknown')) continue; // THIS

        if (teaserImage.includes('images-ssl')) {
            const userId = teaserImage.slice(32, 56);
            const user = await fetchUser(userId);

            unblurredImage = user.photos[0].url;
        }

When APIs return some unknown user, maybe that just deleted his account, the image fetch fails and all the script break.

tajnymag commented 1 year ago

@powext, does the url attribute truly have 'undefined' as its substring? If that's the case, Netflix has a very strange way of dealing with things.

Could you, please, share the photos array returned by the API?

powext commented 1 year ago

Here you are:

{
  "meta": {
    "status": 200
  },
  "data": {
    "results": [
      "user": {
          "_id": "f21d1dd4-8042-4929-bf72-f1288d900b6c",
          "recently_active": true,
          "pre_blur": false,
          "photos": [
            {
              "id": "fd7c4584-03b9-4f91-97dc-c8bda30aeda1",
              "crop_info": {
                "processed_by_bullseye": true,
                "user_customized": false
              },
              "url": "https://preview.gotinder.com/f21d1dd4-8042-4929-bf72-f1288d900b6c/original_fd7c4584-03b9-4f91-97dc-c8bda30aeda1.jpeg",
              "processedFiles": [
                {
                  "url": "https://preview.gotinder.com/f21d1dd4-8042-4929-bf72-f1288d900b6c/640x800_fd7c4584-03b9-4f91-97dc-c8bda30aeda1.jpg",
                  "height": 800,
                  "width": 640
                },
                {
                  "url": "https://preview.gotinder.com/f21d1dd4-8042-4929-bf72-f1288d900b6c/320x400_fd7c4584-03b9-4f91-97dc-c8bda30aeda1.jpg",
                  "height": 400,
                  "width": 320
                },
                {
                  "url": "https://preview.gotinder.com/f21d1dd4-8042-4929-bf72-f1288d900b6c/172x216_fd7c4584-03b9-4f91-97dc-c8bda30aeda1.jpg",
                  "height": 216,
                  "width": 172
                },
                {
                  "url": "https://preview.gotinder.com/f21d1dd4-8042-4929-bf72-f1288d900b6c/84x106_fd7c4584-03b9-4f91-97dc-c8bda30aeda1.jpg",
                  "height": 106,
                  "width": 84
                }
              ],
              "processedVideos": [

              ],
              "fileName": "fd7c4584-03b9-4f91-97dc-c8bda30aeda1.jpg",
              "extension": "jpg,webp",
              "media_type": "image"
            }
          ]
        },
        {
        "user": {
          "_id": "42926328-4709-48d8-9d50-b8dd235af900",
          "recently_active": true,
          "pre_blur": false,
          "photos": [
            {
              "id": "unknown",
              "url": "https://images-ssl.gotinder.com/0001unknown/unknown.jpg",
              "processedFiles": [
                {
                  "url": "https://images-ssl.gotinder.com/0001unknown/640x640_pct_0_0_100_100_unknown.jpg",
                  "height": 640,
                  "width": 640
                },
                {
                  "url": "https://images-ssl.gotinder.com/0001unknown/320x320_pct_0_0_100_100_unknown.jpg",
                  "height": 320,
                  "width": 320
                },
                {
                  "url": "https://images-ssl.gotinder.com/0001unknown/172x172_pct_0_0_100_100_unknown.jpg",
                  "height": 172,
                  "width": 172
                },
                {
                  "url": "https://images-ssl.gotinder.com/0001unknown/84x84_pct_0_0_100_100_unknown.jpg",
                  "height": 84,
                  "width": 84
                }
              ],
              "processedVideos": [

              ],
              "fileName": "unknown.jpg",
              "extension": "jpg"
            }
          ]
        }
      }
...and more
tajnymag commented 1 year ago

@powext, damn, thank you. Working on it :+1:

tajnymag commented 1 year ago

Pushed the changes. Thank you once more. Let me know if the pushed version works so I can close the issue

m7amad-nem commented 1 year ago

Still not working for some reason

tajnymag commented 1 year ago

Still not working for some reason

Well, you didn't post any further details than "it doesn't work".

Do you get any errors in the console?

m7amad-nem commented 1 year ago

Yea i did

[TINDER DEBLUR]: Deblurring likes Load failed Load failed Response served by service worker is opaque

powext commented 1 year ago

Pushed the changes. Thank you once more. Let me know if the pushed version works so I can close the issue

For me it's working. You're welcome!

tajnymag commented 1 year ago

Yea i did

[TINDER DEBLUR]: Deblurring likes Load failed Load failed Response served by service worker is opaque

This is strange. Only the [TINDER DEBLUR] line is ours. The rest comes from Tinder itself.

m7amad-nem commented 1 year ago

Yea i did

[TINDER DEBLUR]: Deblurring likes Load failed Load failed Response served by service worker is opaque

This is strange. Only the [TINDER DEBLUR] line is ours. The rest comes from Tinder itself.

I tried it on my other account and it works But for some reason it doesn't work on my main account