src/Service/Filler.php
public function getFrames($id, $type)
    {
        $dom = $this->browser->getDom('/'.$type.'/'.$type.'_photos.php?id='.$id);
        if (!$dom) {
            return [];
        }
        $images = (new \DOMXPath($dom))->query('//table//table//table//img');
        $frames = [];
        foreach ($images as $image) {
            $src = $this->getAttrAsArray($image)['src'];
            $entity = new Image();
            if ($type == self::ITEM_TYPE_ANIMATION) {
                $src = str_replace('optimize_b', 'optimize_d', $src);
                if (strpos($src, 'http://') === false) {
                    $src = $this->browser->getHost().'/'.$type.'/'.$src;
                }
                if (preg_match('/\-(?<image>\d+)\-optimize_d(?<ext>\.jpe?g|png|gif)/', $src, $mat)) {
                    $entity->setSource(self::NAME.'/'.$id.'/'.$mat['image'].$mat['ext']);
                    if ($this->uploadImage($src, $entity)) {
                        $frames[] = $entity;
                    }
                }
            } elseif (preg_match('/_(?<round>\d+)\/.+\/(?<id>\d+)-(?<image>\d+)-.+(?<ext>\.jpe?g|png|gif)/', $src, $mat)) {
                $src = $this->browser->getHost().'/'.$type.'/img/'.$mat['round'].'/'.$mat['id'].'/'.$mat['image'].$mat['ext'];
                $entity->setSource(self::NAME.'/'.$id.'/'.$mat['image'].$mat['ext']);
                if ($this->uploadImage($src, $entity)) {
                    $frames[] = $entity;
                }
            }
        }

        return $frames;
    }
public function getFrames($id, $type)
    {
        $dom = $this->browser->getDom('/'.$type.'/'.$type.'_photos.php?id='.$id);
        if (!$dom) {
            return [];
        }
        $images = (new \DOMXPath($dom))->query('//table//table//table//img');
        $frames = [];
        foreach ($images as $image) {
            $src = $this->getAttrAsArray($image)['src'];
            $entity = new Image();
            if ($type == self::ITEM_TYPE_ANIMATION) {
                $src = str_replace('optimize_b', 'optimize_d', $src);
                if (strpos($src, 'http://') === false) {
                    $src = $this->browser->getHost().'/'.$type.'/'.$src;
                }
                if (preg_match('/\-(?<image>\d+)\-optimize_d(?<ext>\.jpe?g|png|gif)/', $src, $mat)) {
                    $entity->setSource(self::NAME.'/'.$id.'/'.$mat['image'].$mat['ext']);
                    if ($this->uploadImage($src, $entity)) {
                        $frames[] = $entity;
                    }
                }
            } elseif (preg_match('/_(?<round>\d+)\/.+\/(?<id>\d+)-(?<image>\d+)-.+(?<ext>\.jpe?g|png|gif)/', $src, $mat)) {
                $src = $this->browser->getHost().'/'.$type.'/img/'.$mat['round'].'/'.$mat['id'].'/'.$mat['image'].$mat['ext'];
                $entity->setSource(self::NAME.'/'.$id.'/'.$mat['image'].$mat['ext']);
                if ($this->uploadImage($src, $entity)) {
                    $frames[] = $entity;
                }
            }
        }

        return $frames;
    }
public function getFrames ( $ id , $ type ) { $ dom = $ this -> browser -> getDom ( '/' . $ type . '/' . $ type . '_photos.php?id=' . $ id ) ; if ( ! $ dom ) { return [ ] ; } $ images = ( new \ DOMXPath ( $ dom ) ) -> query ( '//table//table//table//img' ) ; $ frames = [ ] ; foreach ( $ images as $ image ) { $ src = $ this -> getAttrAsArray ( $ image ) [ 'src' ] ; $ entity = new Image ( ) ; if ( $ type == self :: ITEM_TYPE_ANIMATION ) { $ src = str_replace ( 'optimize_b' , 'optimize_d' , $ src ) ; if ( strpos ( $ src , 'http://' ) === false ) { $ src = $ this -> browser -> getHost ( ) . '/' . $ type . '/' . $ src ; } if ( preg_match ( '/\-(?<image>\d+)\-optimize_d(?<ext>\.jpe?g|png|gif)/' , $ src , $ mat ) ) { $ entity -> setSource ( self :: NAME . '/' . $ id . '/' . $ mat [ 'image' ] . $ mat [ 'ext' ] ) ; if ( $ this -> uploadImage ( $ src , $ entity ) ) { $ frames [ ] = $ entity ; } } } elseif ( preg_match ( '/_(?<round>\d+)\/.+\/(?<id>\d+)-(?<image>\d+)-.+(?<ext>\.jpe?g|png|gif)/' , $ src , $ mat ) ) { $ src = $ this -> browser -> getHost ( ) . '/' . $ type . '/img/' . $ mat [ 'round' ] . '/' . $ mat [ 'id' ] . '/' . $ mat [ 'image' ] . $ mat [ 'ext' ] ; $ entity -> setSource ( self :: NAME . '/' . $ id . '/' . $ mat [ 'image' ] . $ mat [ 'ext' ] ) ; if ( $ this -> uploadImage ( $ src , $ entity ) ) { $ frames [ ] = $ entity ; } } } return $ frames ; }
Get item frames.

@param int    $id
@param string $type

@return array
Get item frames .