Rss-bridge: InstagramBridge : PHP warnings due to empty structures

Created on 18 Nov 2020  Â·  2Comments  Â·  Source: RSS-Bridge/rss-bridge

Describe the bug
Instagram Bridges do some PHP warnings when fetching content.
PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in ***/rss-bridge/bridges/InstagramBridge.php on line 206
PHP message: PHP Warning: Invalid argument supplied for foreach() in ***/rss-bridge/bridges/InstagramBridge.php on line 170

To Reproduce
Steps to reproduce the behavior:

  1. Set an instance of Instagram Bridge, e.g. 'https://bridge.punkapoule.fr/?action=display&bridge=Instagram&context=Username&u=natoogram&media_type=all&direct_links=on&format=Html'
  2. Request it, via wget for example
  3. See Apache/Nginx/PHP error log

Expected behavior
Do not have these warnings. Maybe, by testing the value before using it in foreach or count(), or diagnose why the structure is empty here (parsing problem?)

Desktop (please complete the following information):

  • OS: Std LAMP (Std Linux + Apache 2.4 + PHP 7.4 with PHP-FPM)
  • RSS-Bridge version is up-to-date (HEAD commit is e6c73a1)
Bug-Report

Most helpful comment

As mentionned in https://github.com/RSS-Bridge/rss-bridge/issues/1863#issuecomment-731585313, Instagram now ask time-to-time to supply the login form when accessing profiles via the API.

Some API parameters are hard-coded values in the bridge (a.k.a. USER_QUERY_HASH, TAG_QUERY_HASH, SHORTCODE_QUERY_HASH) and subsequently shared among all InstagramBridge users.
So… maybe a possible workaround is to obtain personnal IDs, and do not share them with other people ?

All 2 comments

As mentionned in https://github.com/RSS-Bridge/rss-bridge/issues/1863#issuecomment-731585313, Instagram now ask time-to-time to supply the login form when accessing profiles via the API.

Some API parameters are hard-coded values in the bridge (a.k.a. USER_QUERY_HASH, TAG_QUERY_HASH, SHORTCODE_QUERY_HASH) and subsequently shared among all InstagramBridge users.
So… maybe a possible workaround is to obtain personnal IDs, and do not share them with other people ?

So… maybe a possible workaround is to obtain personnal IDs, and do not share them with other people ?

Probably yes. I haven't checked it myself and I don't know how to get them.

Anyway, I also mentioned about private credentials feature in pinned issue https://github.com/RSS-Bridge/rss-bridge/issues/1891

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theScrabi picture theScrabi  Â·  7Comments

WebworkrNet picture WebworkrNet  Â·  8Comments

AntoineTurmel picture AntoineTurmel  Â·  7Comments

OmkAR2013 picture OmkAR2013  Â·  8Comments

TwizzyDizzy picture TwizzyDizzy  Â·  4Comments