nextcloud / nextcloud/contacts

Profile picture download from Instagram

Open
#5,702 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug feature: contacts
Dominant language
JavaScript
Stars
642
Forks
220
Avg merge
14h 39m
Merged PRs (30d)
51

Description

Describe the bug

The download of profile pictures from Instagram is not working for my setup.
While testing the code locally, I discovered that the Instagram page does not fit to the code and has probably changed. But the link to the profile picture is still present on the page.
The easiest way to get it is the regex: /"profile_pic_url":\s?"(.*)",/U
With that I was able to extract the URL and get the image.

Steps to reproduce

Download page

$url = "https://www.instagram.com/{username}/\?__a\=1";
$options = array('http' => array('user_agent' => 'Googlebot / 2.1'));
$context = stream_context_create($options);
$result = file_get_contents($url,false, $context);

extract URL with preg_match
Check URL in browser

Expected behavior

The profile picture gets extracted.

Actual behavior

The profile picture is not extracted.

Contact version

8.8.0 / main branch

Operating system

Ubuntu Server

PHP engine version

PHP 8.3

Web server

Nginx

Database

MySQL

Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Instagram profile-picture download and URL-extraction entry point, then reproduce the request described with the provided PHP snippet against the current Instagram page. Verify how the existing extraction handles the page response and use the reported profile_pic_url pattern as a reference. Done means the profile picture URL is extracted and the image downloads successfully on Contacts 8.8.0 and main.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.