获得永久素材的信息、只获取信息、不进行下载
@param mediaId
@return
321094
public DownloadMaterialResponse getMaterial(String mediaId) {
		DownloadMaterialResponse materialresponse = null;
        String url = BASE_API_URL + "cgi-bin/material/get_material?access_token=#";
        Map<String, String> param = new HashMap<String, String>();
        param.put("media_id", mediaId);
        BaseResponse r = executePost(url, JSONUtil.toJson(param));
        String resultJson = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
        materialresponse = JSONUtil.toBean(resultJson, DownloadMaterialResponse.class);
        return materialresponse;
	}
1122740
public function fetchPermanentAudio ($mediaID, $into = null)
    {
        return new Downloaded\Audio($mediaID, $this->doPermanentFetchToStream($mediaID, $into));
    }
195356
public DownloadMediaResponse download(String mediaId){
        DownloadMediaResponse response = new DownloadMediaResponse();
        String url = BASE_API_URL + "cgi-bin/media/get?access_token=" + config.getAccessToken() + "&media_id=" + mediaId;
        RequestConfig config = RequestConfig.custom().setConnectionRequestTimeout(NetWorkCenter.CONNECT_TIMEOUT).setConnectTimeout(NetWorkCenter.CONNECT_TIMEOUT).setSocketTimeout(NetWorkCenter.CONNECT_TIMEOUT).build();
        CloseableHttpClient client = HttpClientBuilder.create().setDefaultRequestConfig(config).build();
        HttpGet get = new HttpGet(url);
        try{
            CloseableHttpResponse r = client.execute(get);
            if(HttpStatus.SC_OK == r.getStatusLine().getStatusCode()){
                InputStream inputStream = r.getEntity().getContent();
                Header[] headers = r.getHeaders("Content-disposition");
                if (null != headers && 0 != headers.length) {
                    Header length = r.getHeaders("Content-Length")[0];
                    response.setContent(inputStream, Integer.valueOf(length.getValue()));
                    response.setFileName(headers[0].getElements()[0].getParameterByName("filename").getValue());
                } else {
                    ByteArrayOutputStream out = new ByteArrayOutputStream();
                    StreamUtil.copy(inputStream, out);
                    String json = out.toString();
                    response = JSONUtil.toBean(json, DownloadMediaResponse.class);
                }
            }
        } catch (Exception e) {
            LOG.error("异常", e);
        }finally {
            try{
                client.close();
            }catch (IOException e){
                LOG.error("异常", e);
            }
        }
        return response;
    }
934082
public static MaterialGetResult get_material(String access_token,String media_id){
		HttpUriRequest httpUriRequest = RequestBuilder.post()
					.setHeader(jsonHeader)
					.setUri(BASE_URI+"/cgi-bin/material/get_material")
					.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token))
					.setEntity(new StringEntity("{\"media_id\":\""+media_id+"\"}",Charset.forName("utf-8")))
					.build();
		return LocalHttpClient.execute(httpUriRequest,BytesOrJsonResponseHandler.createResponseHandler(MaterialGetResult.class));
	}
62220
public function get($mediaId)
    {
        $node     = 'get';
        $queryStr = ['media_id' => $mediaId];

        $res = $this->_get($node, $queryStr);

        return $res;
    }
666574
public function getUsage($mediaId)
    {
        $this->mediaId = $mediaId;

        $this->getLogger()->info('Getting media usage report ' . $mediaId . ' for Displays');
        $response = $this->doGet('/library/usage/' . $mediaId );

        $this->getLogger()->debug('Passing the response to Hydrate');
        return $this->hydrate($response);
    }
850849
public void delete(String mediaId) {
        String url = WxEndpoint.get("url.material.delete");
        String body = String.format("{\"media_id\":\"%s\"}", mediaId);
        logger.debug("material delete: {}", body);
        wxClient.post(url, body);
    }
989849
public function postDelete($mediaId)
    {
        $media = Media::findOrFail($mediaId);
        $media->delete();

        return redirect($this->admin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The Media was successfully deleted.', 'dismissable' => false]]);
    }
1001492
protected static MediaType getSupportProduceMediaType(ContainerRequestContext containerRequestContext) {
        for (MediaType mediaType : containerRequestContext.getAcceptableMediaTypes()) {
            if (mediaType.isCompatible(TEXT_PLAIN_TYPE) ||
                    (mediaType.getType().equalsIgnoreCase("application")
                            && !mediaType.getSubtype().toLowerCase().contains("html"))
                    || mediaType.getSubtype().equalsIgnoreCase("json")
                    || mediaType.getSubtype().equalsIgnoreCase("xml")
                    || mediaType.getSubtype().toLowerCase().endsWith("+json")
                    || mediaType.getSubtype().toLowerCase().endsWith("+xml")) {
                return mediaType;
            }
        }
        return null;
    }
713545
@Deprecated
    public QYResultType create(QYAgent agent, String mediaId){
        String url = BASE_API_URL + "cgi-bin/agent/set?access_token=#";
        final Map<String, Object> params = new HashMap<String, Object>();
        params.put("agentid", agent.getAgentId());
        params.put("report_location_flag", String.valueOf(agent.getReportLocationFlag()));
        params.put("logo_mediaid", mediaId);
        params.put("name", agent.getName());
        params.put("description", agent.getDescription());
        params.put("redirect_domain", agent.getRedirectDomain());
        params.put("isreportuser", agent.getIsReportUser());
        params.put("isreportenter", agent.getIsReportEnter());
        BaseResponse response = executePost(url, JSONUtil.toJson(params));
        return QYResultType.get(response.getErrcode());
    }
503052
public function isMediaTypeOf($mediaId, $type)
    {
        $qb = $this->createQueryBuilder();
        $qb->field('id')->equals(new \MongoId($mediaId))
           ->field('mediaType')->equals($type);

        return $qb->getQuery()->count() !== 0;
    }
86463
def get_media_formats(self, media_id):
        
        url = (SCRAPER.API_URL + 'media-' + media_id).format(
            protocol=SCRAPER.PROTOCOL_INSECURE)
        format_pattern = re.compile(SCRAPER.VIDEO.FORMAT_PATTERN)
        formats = {}

        for format, param in iteritems(SCRAPER.VIDEO.FORMAT_PARAMS):
            resp = self._connector.get(url, params={param: '1'})
            if not resp.ok:
                continue
            try:
                match = format_pattern.search(resp.content)
            except TypeError:
                match = format_pattern.search(resp.text)
            if match:
                formats[format] = (int(match.group(1)), int(match.group(2)))
        return formats
132489
public function getItemStatus($id, $mediaId, array $parameters = [], array $headers = [])
    {
        return $this->getFactory()->createItemStatus(
            $this->getApi()->getItemStatus($id, $mediaId, $parameters, $headers)
        );
    }
553376
private function doPermanentFetchToStream ($mediaID, $into)
    {
        $body = $this->client->send(
            new Request(
                'POST',
                'https://api.weixin.qq.com/cgi-bin/material/get_material',
                [],
                json_encode([
                    'media_id' => $mediaID,
                ])
            ),
            [
                RequestOptions::SINK => $this->createWritableStream($into),
            ]
        )->getBody();

        if ($body->isSeekable()) {
            $body->seek(0);
        }

        return $body->detach();
    }
469618
public static MediaType parseMediaType(String mediaType) {
        MimeType type;
        try {
            type = MimeTypeUtils.parseMimeType(mediaType);
        } catch (InvalidMimeTypeException ex) {
            throw new InvalidMediaTypeException(ex);
        }
        try {
            return new MediaType(type.getType(), type.getSubtype(), type.getParameters());
        } catch (IllegalArgumentException ex) {
            throw new InvalidMediaTypeException(mediaType, ex.getMessage());
        }
    }
761117
public ReTranscodeResponse reTranscode(String mediaId) {
        ReTranscodeRequest request = new ReTranscodeRequest().withMediaId(mediaId);
        return reTranscode(request);
    }
1153213
public static MediaGetResult mediaGet(String access_token,String media_id){
		return mediaGet(access_token, media_id, false);
	}