jsanahuja / InstagramFeed

Vanilla JavaScript Instagram Feed without access token. Not using the Instagram API
MIT License
318 stars 128 forks source link

images are not showing on all feed #61

Open Anmartawfik opened 3 years ago

Anmartawfik commented 3 years ago

Looks like images are not showing in any feed , seems like same CORS issue

Many thanks A

nguyenhc-bitvn commented 3 years ago

Same issue. Waiting for fixing...

SpbSprut commented 3 years ago

Same issue. Even examples on plugin's site don't show images but only texts. https://www.sowecms.com/demos/InstagramFeed/#examples https://prnt.sc/124z128

ghost commented 3 years ago

@jsanahuja, any suggestions about this issue? Attempts to access images via direct links return 403 with "URL signature expired" message:

403: image

The message: image

Also as far as I concerned, the issue with CORS and image access can be reproduced while your computer connects to some internet-endpoints (e.g. Wi-Fi).

A1exMoody commented 3 years ago

Yep.. Look like this image The problem is also shown in the examples

xchopin commented 3 years ago

ugh I thought the problem was due to my apache cache thing; good to know I am not alone

Nicolas-Cargo commented 3 years ago

I hope @jsanahuja will come soon :/ I'm using it on so many websites..

A1exMoody commented 3 years ago

Me too... I have to pass the order, but it all comes down to Instagram. I don't want used Insta API...

CobeSean commented 3 years ago

Adding myself on here, to follow for (hopefully) a solution soon...

NosovN commented 3 years ago

@jsanahuja, help us)

Eugene1984 commented 3 years ago

@jsanahuja Adding myself here.

igoluciano commented 3 years ago

@jsanahuja Adding myself here.

NoOneDesign commented 3 years ago

same problem on all website where i use it. @jsanahuja if you fix it give me your paypal, you need a donation for this.

nrayann commented 3 years ago

@jsanahuja is the repo alive?

evaleries commented 3 years ago

If you have Cloudflare account you can fix this issue using Cloudflare workers by following these steps https://gist.github.com/restyler/6c51e3ad20d7596e799d76e87cf93236

I've tried and it works.

vgavrilovikj commented 3 years ago

Was someone able to fix this issue..?

ghost commented 3 years ago

As mentioned here we can use rapidapi as proxy. But there're limitations: 100 requests/month with free plan. There're a bunch of API's, but they have even harder limit: 20 requests/month or 20 requests/day.

ribeiroeder commented 3 years ago

Hello, not wanting to be negative, but I believe that it will be very unlikely to find a solution since instagram is very strict in unauthenticated access.

As I have several sites that depend on a smilar script, I searched and improved two scripts that use the new official method via the graph.instagram API.

The first uses javascript and the second PHP cURL, I am still testing it but the results have been great.

ribeiroeder commented 3 years ago

jQuery Ajax for feed Instagram Graph API https://github.com/ribeiroeder/jquery-feed-instagram-graph

PHP cURL for feed Instagram Graph API https://github.com/ribeiroeder/php-curl-instagram-graph

@jsanahuja Sorry for posting another third party solution here, your script is incredible, much more complex and well developed than the scripts above and it helped me for a long time. But either way I need to be generating alternatives because customers keep asking about a solution :(

A1exMoody commented 3 years ago

If you have Cloudflare account you can fix this issue using Cloudflare workers by following these steps https://gist.github.com/restyler/6c51e3ad20d7596e799d76e87cf93236

I've tried and it works.

This is a good solution to the problem, but what if I have a hosting that is already optimized for everything you need, and I don't need to use Cloudflare?

evaleries commented 3 years ago

If you have Cloudflare account you can fix this issue using Cloudflare workers by following these steps https://gist.github.com/restyler/6c51e3ad20d7596e799d76e87cf93236 I've tried and it works.

This is a good solution to the problem, but what if I have a hosting that is already optimized for everything you need, and I don't need to use Cloudflare?

Good question. You can create Cloudflare workers for free (100k requests/daily) and then you need modify a little bit of the library (See #62). Let's say you have created Cloudflare workers, you can use my modified version of this library. Then, you need customize the instance of InstagramFeed a little bit, e.g

new InstagramFeed({
    'username': 'travisci',
    'container': document.getElementById("instagram-feed5"),
    'display_profile': true,
    'cdnUrlResolver': function(url) {
        return 'https://your-cloudflare.workers.dev/' + url;
    }
});

Check my live demo: Main Site - Check Latest Instagram section https://pemro.id/plugins/insta-feed/insta-feed.js https://pemro.id/plugins/insta-feed/InstagramFeed.min.js - This uses my modified version of this library

A1exMoody commented 3 years ago

Если у вас есть учетная запись Cloudflare, вы можете решить эту проблему с помощью работников Cloudflare, выполнив следующие действия: https://gist.github.com/restyler/6c51e3ad20d7596e799d76e87cf93236 Я пробовал, и он работает.

Это хорошее решение проблемы, но что, если у меня есть хостинг, который уже оптимизирован для всего, что вам нужно, и мне не нужно использовать Cloudflare?

Хороший вопрос. Вы можете создать воркеров Cloudflare бесплатно (100 тыс. Запросов в день), а затем вам нужно будет немного изменить библиотеку (см. № 62 ). Допустим, вы создали воркеров Cloudflare, вы можете использовать мою модифицированную версию этой библиотеки . Затем вам нужно немного настроить экземпляр InstagramFeed, например

новый  InstagramFeed ( { 
    'username' : 'travisci' , 
    'container' : document . getElementById ( "instagram-feed5" ) , 
    'display_profile' : true , 
    'cdnUrlResolver' : function ( url )  { 
        return  'https: // your- cloudflare.workers.dev/ '  +  url ; 
    } 
} ) ;

Проверьте мою живую демонстрацию: Основной сайт - проверьте последний раздел Instagram https://pemro.id/plugins/insta-feed/insta-feed.js https://pemro.id/plugins/insta-feed/InstagramFeed.min.js - Здесь используется моя модифицированная версия этой библиотеки

Yes, but if I understand correctly, will I still need to migrate my domain's dns to cloudflare?

evaleries commented 3 years ago

Yes, but if I understand correctly, will I still need to migrate my domain's dns to cloudflare?

No, You don't need to do that. Migrate your domain to Cloudflare is optional. But, If you need your cdn to be customized to your domain, then you need migrate your domain to Cloudflare (e.g: cdn.your-domain.com) as pointed No 1 on tutorial.

A1exMoody commented 3 years ago

Yes, but if I understand correctly, will I still need to migrate my domain's dns to cloudflare?

No, You don't need to do that. Migrate your domain to Cloudflare is optional. But, If you need your cdn to be customized to your domain, then you need migrate your domain to Cloudflare (e.g: cdn.your-domain.com) as pointed No 1 on tutorial.

awesome! Thx for ur solution )

ribeiroeder commented 3 years ago

@evaleries great solution! Could you share the configuration inserted in your cloudflare worker?

I tested it here just by creating one, and the default settings return me the 404 error.

evaleries commented 3 years ago

@evaleries great solution! Could you share the configuration inserted in your cloudflare worker?

I tested it here just by creating one, and the default settings return me the 404 error.

@ribeiroeder First of all, I don't know your default settings. As far as I know if you copy the whole script on tutorial, you can't directly access the workers (It will says 404 Bad url). The workers require Instagram's post url. So the final example would be: https://your.workers.dev/Instagram_post_url e.g Check this link structure

ribeiroeder commented 3 years ago

Yes, the script is assembling the url correctly, see here

Similar to your worker, but it seems to be missing some configuration within the cloudflare worker to not return the 404