[Instagram] fix: add ds_user_id (#2881)

Fix #2876
This commit is contained in:
Tokariew 2022-07-07 12:08:21 +02:00 committed by GitHub
parent d107f8ed30
commit ea45717a28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -14,6 +14,9 @@ class InstagramBridge extends BridgeAbstract
'cache_timeout' => [ 'cache_timeout' => [
'required' => false, 'required' => false,
], ],
'ds_user_id' => [
'required' => false,
],
]; ];
const PARAMETERS = [ const PARAMETERS = [
@ -82,8 +85,9 @@ class InstagramBridge extends BridgeAbstract
{ {
$headers = []; $headers = [];
$sessionId = $this->getOption('session_id'); $sessionId = $this->getOption('session_id');
if ($sessionId) { $dsUserId = $this->getOption('ds_user_id');
$headers[] = 'cookie: sessionid=' . $sessionId; if ($sessionId and $dsUserId) {
$headers[] = 'cookie: sessionid=' . $sessionId . '; ds_user_id=' . $dsUserId;
} }
return getContents($uri, $headers); return getContents($uri, $headers);
} }

View File

@ -7,8 +7,8 @@ it is suggested to deploy a private RSS-Bridge instance that uses a working Inst
Configuration Configuration
------------- -------------
1. Retreiving session id. 1. Retreiving `session id` and `ds_user_id`.
The following steps describe how to get the session id using a Chromium-based browser. The following steps describe how to get the `session id` and `ds user id` using a Chromium-based browser.
- Create an Instagram account, that you will use for your RSS-Bridge instance. - Create an Instagram account, that you will use for your RSS-Bridge instance.
It is NOT recommended to use your existing account that is used for common interaction with Instagram services. It is NOT recommended to use your existing account that is used for common interaction with Instagram services.
@ -29,7 +29,7 @@ It is NOT recommended to use your existing account that is used for common inter
- In the new frame open the "Headers" tab and scroll to "Request Headers" - In the new frame open the "Headers" tab and scroll to "Request Headers"
- There will be a cookie param will lots of `<key>=<value>;` text. You need the value of the "sessionid" key. Copy it. - There will be a cookie param will lots of `<key>=<value>;` text. You need the value of the "sessionid" and "ds_user_id" keys. Copy them.
2. Configuring RSS-Bridge 2. Configuring RSS-Bridge
@ -38,6 +38,7 @@ It is NOT recommended to use your existing account that is used for common inter
``` ```
[InstagramBridge] [InstagramBridge]
session_id = %sessionid from step 1% session_id = %sessionid from step 1%
ds_user_id = %ds_user_id from step 1%
cache_timeout = %cache timeout in seconds% cache_timeout = %cache timeout in seconds%
``` ```