NicklasWallgren / instagram-api

Instagram Private API
MIT License
145 stars 47 forks source link

getProfilePictureUrl #52

Closed xsinisa closed 2 years ago

xsinisa commented 2 years ago

Hi @NicklasWallgren ,

it seems that getProfilePictureUrl doesn't work..I mean anything related to profile pictures returns null even if profile is public. Is that some new Instagram restriction? If not I can try to fix it, just point me in right direction.

Thanks.

NicklasWallgren commented 2 years ago

Hey @xsinisa.

It seems like I introduced a bug in https://github.com/NicklasWallgren/instagram-api/commit/a5120c0b5fdc4b2c942d3f2013f043a58f77d141#diff-1e0027aa25ac8c0822cbd1d246a605b90eb26561e21d6045e082c3b36291f059L50. We need to re-add the @SerializedName annotation.

We could at the same time extend the Instagram\SDK\Response\DTO\General\User class with additional fields which is returned from the api.

hd_profile_pic_versions":[
         {
            "width":320,
            "height":320,
            "url":"https://scontent-arn2-1.cdninstagram.com/v/t51.2885-19/s320x320/14309835_352561411800072_2077673778_a.jpg?_nc_ht=scontent-arn2-1.cdninstagram.com\u0026_nc_ohc=xD135JEfEBQAX_c97WL\u0026edm=AKralEIBAAAA\u0026ccb=7-4\u0026oh=0ffeeca333dc5a888e50f937e2331e77\u0026oe=611247E2\u0026_nc_sid=5e3072"
         },
         {
            "width":640,
            "height":640,
            "url":"https://scontent-arn2-1.cdninstagram.com/v/t51.2885-19/s640x640/14309835_352561411800072_2077673778_a.jpg?_nc_ht=scontent-arn2-1.cdninstagram.com\u0026_nc_ohc=xD135JEfEBQAX_c97WL\u0026edm=AKralEIBAAAA\u0026ccb=7-4\u0026oh=8fe781009587f46d1de5a528144c6ca6\u0026oe=61139E47\u0026_nc_sid=5e3072"
         }
      ],
      "hd_profile_pic_url_info":{
         "url":"https://scontent-arn2-1.cdninstagram.com/v/t51.2885-19/14309835_352561411800072_2077673778_a.jpg?_nc_ht=scontent-arn2-1.cdninstagram.com\u0026_nc_ohc=xD135JEfEBQAX_c97WL\u0026edm=AKralEIBAAAA\u0026ccb=7-4\u0026oh=6cb9074bc351777eac4f2fdd96bc9f9e\u0026oe=6113F320\u0026_nc_sid=5e3072",
         "width":668,
         "height":668
      },

Are you up for a PR?

NicklasWallgren commented 2 years ago

Fixed via https://github.com/NicklasWallgren/instagram-api/pull/66.

Thanks @deegital