Get anime licensor.

@param \simplehtmldom_1_5\simple_html_dom $each_anime

@return string|array
975985
private function getAnimeLicensor($each_anime)
    {
        if ($this->_type == 'anime') {
            $licensor = $each_anime->find('div[class="synopsis js-synopsis"] .licensors', 0)->getAttribute('data-licensors');
            $licensor = explode(',', $licensor);

            return array_filter($licensor);
        } else {
            $serialization = $each_anime->find('div[class="synopsis js-synopsis"] .serialization a', 0);

            return $serialization ? $serialization->plaintext : '';
        }
    }
1258382
private function getSynopsis($each_anime)
    {
        $synopsis = $each_anime->find('div[class="synopsis js-synopsis"]', 0)->plaintext;
        preg_match('/(No synopsis)/', $synopsis, $temp_synopsis);
        if (!$temp_synopsis) {
            $synopsis = trim(preg_replace("/([\s])+/", ' ', $synopsis));
        } else {
            $synopsis = '';
        }

        return $synopsis;
    }
1288382
public function getSubtitleUrls(array $subtitles, $all = false)
    {
        $subtitlesUrls = array();

        if (!empty($subtitles['data'])) {
            foreach ($subtitles['data'] as $sub) {
                if (!empty($sub['SubDownloadLink'])) {
                    $subtitlesUrls[] = $sub['SubDownloadLink'];
                    if ($all === false) {
                        return $subtitlesUrls;
                    }
                }
            }
        }

        return $subtitlesUrls;
    }
1265820
protected function getLicenseAttribution( $html ) {
		$meta = [];

		// get license attribution statement if it exists
		preg_match( '/(?:<div class="license-attribution[^>]*>)(.*)(<\/div>)/isU', $html, $matches );

		if ( ! empty( $matches[1] ) ) {
			$html5 = new HtmlParser();
			$dom = $html5->loadHTML( $matches[1] );
			$meta = $this->scrapeAndKneadMeta( $dom );
		}
		return $meta;
	}
274165
private function getEpisode()
    {
        $episode = [];
        $episode_area = $this->_parser->find('.episode-video', 0);
        if ($episode_area) {
            foreach ($episode_area->find('.video-list-outer') as $v) {
                $temp = [];

                $link_area = $v->find('a', 0);
                $temp['episode'] = $this->getEpisodeTitle($link_area, 0);
                $temp['title'] = $this->getEpisodeTitle($link_area, 1);
                $temp['link'] = $link_area->href;

                $episode[] = $temp;
            }
        }

        return $episode;
    }
395400
private function getLicenseAsComment()
    {
        $license = explode(PHP_EOL, $this->licenseHeader);

        // if there are a bunch of new lines at the end of the license file
        // then we want to remove these
        while (end($license) === '') {
            array_pop($license);
        }
        reset($license);

        $license = array_map(function ($licenseLine) {
            return rtrim(' * ' . $licenseLine);
        }, $license);

        $license = implode(PHP_EOL, $license);
        $license = '/*' . PHP_EOL . $license . PHP_EOL . ' */';

        return $license;
    }
1240542
public function Anime(int $id): Model\Anime\Anime
    {
        return $this->myanimelist->getAnime(
            new Request\Anime\AnimeRequest($id)
        );
    }
1096881
private function getMedia($type = 'anime')
    {
        $mediaography = [];
        $mediaography_index = 0;

        $html = $this->_parser->find('#content table tr', 0)->find('td', 0);
        $mediaography_area = $type == 'anime' ? $html->find('table', 0) : $html->find('table', 1);
        if ($mediaography_area) {
            $mediaography_area = $mediaography_area->find('tr');
            foreach ($mediaography_area as $each_media) {
                $media_image = $each_media->find('td', 0);
                $media_area = $each_media->find('td', 1);

                $mediaography[$mediaography_index]['image'] = $this->getVaImage($media_image);
                $mediaography[$mediaography_index]['id'] = $this->getVaId($media_area);
                $mediaography[$mediaography_index]['title'] = $this->getVaName($media_area);
                $mediaography[$mediaography_index]['role'] = $this->getVaRole($media_area);

                $mediaography_index++;
            }
        }

        return $mediaography;
    }
525121
def request_anime(client, aid: int) -> 'Anime':
    """"""
    response = api.httpapi_request(client, request='anime', aid=aid)
    etree = api.unpack_xml(response.text)
    return _unpack_anime(etree.getroot())
1148663
protected function getStub()
    {
        if ($this->proxyStub == null) {
            $this->proxyStub = file_get_contents($this->stubPath().'/proxy.stub');
        }

        return $this->proxyStub;
    }
666981
private function getRecommendation()
    {
        $recommendation = [];
        $recommendation_area = $this->_type == 'anime' ? $this->_parser->find('#anime_recommendation', 0) : $this->_parser->find('#manga_recommendation', 0);
        if ($recommendation_area) {
            foreach ($recommendation_area->find('li.btn-anime') as $each_recom) {
                $tmp = [];

                $tmp['id'] = $this->getRecomId($each_recom);
                $tmp['title'] = $this->getRecomTitle($each_recom);
                $tmp['image'] = $this->getRecomImage($each_recom);
                $tmp['user'] = $this->getRecomUser($each_recom);

                $recommendation[] = $tmp;
            }
        }

        return $recommendation;
    }
148046
public function getBrowser()
    {
        foreach ($this::$browsers as $browser => $UA) {
            $is_browser = 'is'.$browser;
            if ($this->$is_browser()) {
                return $browser;
            }
        }
        return '';
    }
252780
private function getAllInfo()
    {
        $data = [];
        $data_index = 0;
        $top_table = $this->_parser->find('.characters-favorites-ranking-table', 0);
        foreach ($top_table->find('tr[class=ranking-list]') as $each_char) {
            $name_area = $each_char->find('.people', 0);

            $data[$data_index]['rank'] = $this->getRank($each_char);
            $data[$data_index]['id'] = $this->getId($name_area);
            $data[$data_index]['name'] = $this->getName($name_area);
            $data[$data_index]['japanese_name'] = $this->getJapaneseName($name_area);
            $data[$data_index]['image'] = $this->getImage($name_area);
            $data[$data_index]['animeography'] = $this->getRole($each_char, '.animeography');
            $data[$data_index]['mangaography'] = $this->getRole($each_char, '.mangaography');
            $data[$data_index]['favorite'] = $this->getFavorite($each_char);

            $data_index++;
        }

        return $data;
    }
602389
public function AnimeSearch(
        ?string $query,
        int $page = 1,
        ?Request\Search\AnimeSearchRequest $request = null
    ): Model\Search\AnimeSearch {
        return $this->myanimelist->getAnimeSearch(
            null !== $request
                ? $request
                ->setQuery($query)
                ->setPage($page)
                : new Request\Search\AnimeSearchRequest($query, $page)
        );
    }
616158
public function getLicenseUris()
    {
        $result             = array();
        $mapper             = $this->getMapper();
        $licenseUrlPatterns = array(
            '/^cc-(by-sa|by-nd|by-nc|by-nc-sa|by-nc-nd)-(\d+\.\d+)$/i' => function ( $matches ) {
                return 'http://creativecommons.org/licenses/' . strtolower( $matches[1] ) . '/' . $matches[2];
            },
            '/^cc0-(\d+\.\d+)$/i'           => 'http://creativecommons.org/publicdomain/zero/$1',
            '/^Apache-(\d+\.\d+)$/i'        => 'http://www.apache.org/licenses/LICENSE-$1',
            '/^Artistic-(\d+)\.(\d+)$/i'    => 'http://www.perlfoundation.org/artistic_license_$1_$2',
            '/^GPL-(\d+\.\d+)\+?$/i'        => 'http://www.gnu.org/licenses/gpl-$1-standalone.html',
            '/^LGPL-(\d+\.\d+)\+?$/i'       => 'http://www.gnu.org/licenses/lgpl-$1-standalone.html',
            '/^MIT$/i'                      => 'http://opensource.org/licenses/MIT',
            '/^proprietary/i'               => '',
            '/^([^\(].*)$/i'                => function ( $matches ) use ( $mapper ) {
                static $uris = array(
                    'http://opensource.org/licenses/%s',
                    'http://spdx.org/licenses/%s'
                );

                if ( empty( $mapper ) )
                {
                    return '';
                }

                foreach ( $uris as $uriPattern )
                {
                    $uri = vsprintf( $uriPattern, $matches );

                    if ( $mapper->getHttpClient( $uri )
                                ->send()
                                ->isOk() )
                    {
                        return $uri;
                    }
                }

                return '';
            },
        );

        foreach ( $this->license as $license )
        {
            foreach ( $licenseUrlPatterns as $pattern => $replacement )
            {
                $count  = 0;
                $method = is_callable( $replacement ) ? 'preg_replace_callback' : 'preg_replace';
                $uri    = $method( $pattern, $replacement, $license, 1, $count );

                if ( $count && $uri )
                {
                    $result[$license] = $uri;
                    continue 2;
                }
            }

            $result[$license] = '';
        }

        return $result;
    }
992926
public function getCatalogItem(array $item)
    {
        $sources = [$this->browser->getHost().$item['url']];
        if (!empty($item['world_art_id'])) {
            $sources[] = str_replace('#ID#', $item['world_art_id'], self::WORLD_ART_URL);
        }
        if (!empty($item['myanimelist_id'])) {
            $sources[] = str_replace('#ID#', $item['myanimelist_id'], self::MY_ANIME_LIST_URL);
        }
        if (!empty($item['ani_db_id'])) {
            $sources[] = str_replace('#ID#', $item['ani_db_id'], self::ANI_DB_URL);
        }
        /* @var $source \AnimeDb\Bundle\CatalogBundle\Entity\Source|null */
        $source = $this->repository->findOneBy(['url' => $sources]);
        if ($source instanceof Source) {
            return $source->getItem();
        }
        return null;
    }
1173834
private function getStaff($manga = false)
    {
        $staff = [];
        $staff_index = 0;
        $html = $this->_parser->find('#content table tr', 0)->find('td', 0)->next_sibling();
        if ($manga) {
            $staff_area = $html->find('.normal_header', 2)->next_sibling();
        } else {
            $staff_area = $html->find('.normal_header', 1)->next_sibling();
        }
        if ($staff_area->tag == 'table') {
            foreach ($staff_area->find('tr') as $each_staff) {
                $anime_image_area = $each_staff->find('td', 0);
                $staff_area = $each_staff->find('td', 1);

                $staff[$staff_index]['image'] = $this->getAnimeImage($anime_image_area);
                $staff[$staff_index]['id'] = $this->getAnimeId($staff_area);
                $staff[$staff_index]['title'] = $this->getAnimeTitle($staff_area);
                $staff[$staff_index]['role'] = $this->getAnimeRole($staff_area, true);

                $staff_index++;
            }
        }

        return $staff;
    }