DsgnWrks-Instagram-Importer icon indicating copy to clipboard operation
DsgnWrks-Instagram-Importer copied to clipboard

Issue importing all photos of a post

Open srazi opened this issue 5 years ago • 2 comments

I have an strange problem. With two account (personal) it correctly imports all photo of a post. But with my another account (business) it imports just import first photo multiple times.

Maybe the type of account is the problem here?

srazi avatar Apr 16 '19 06:04 srazi

May this helps you: As debug purpose I added the following line of code:

$import['post_title'].=($index. '- '.$img_item->images->standard_resolution->url);

to:

protected function save_img_post() {
    ...
    switch ( $this->pic->type ) {
        ...
        case 'carousel':
        ...
            foreach ( $p->carousel_media as $img_item ) {
                ...
                switch ( $img_item->type ) {
                    ...
                    default:
                    ...
                        $sub_items[] = $this->upload_img_media( $img_item, wp_trim_words( $import['post_title'], 5, '...' ) . ' - ' . ++$index );
                        // added by me
                        $import['post_title'].=($index. '- '.$img_item->images->standard_resolution->url);
                        
                        break;
                }
            }
    }

And the title correctly contains URLs of all photos.

srazi avatar Apr 16 '19 07:04 srazi

Removing this hack fixed it for me. So I suggest to add an option to enable/disable hacks.

srazi avatar Apr 16 '19 09:04 srazi