Finds and returns all audio media associated with a place id.
@param place_id Id of associated place
@return A JSON object containing all audio media
@throws Exception
350978
public JSONObject getAudioMediaFromPlaceId(String place_id) throws Exception {

		List<SelectedColumn> selectFields = new Vector<SelectedColumn>();
		selectFields.add( new SelectedColumn(SelectedColumn.Type.INTEGER, "id") );
		selectFields.add( new SelectedColumn(SelectedColumn.Type.INTEGER, "place_id") );
		selectFields.add( new SelectedColumn(SelectedColumn.Type.STRING, "filename") );
		selectFields.add( new SelectedColumn(SelectedColumn.Type.STRING, "mimetype") );
		selectFields.add( new SelectedColumn(SelectedColumn.Type.STRING, "title") );
		
		PreparedStatement stmt = connection.prepareStatement(
				"SELECT id,place_id,filename,mimetype,title " +
				"FROM contributions " +
				"WHERE mimetype LIKE 'audio/%' AND place_id = ?;"
				);
		stmt.setInt(1, Integer.parseInt(place_id));
		
		JSONArray array = executeStatementToJson(stmt, selectFields);

		JSONObject result = new JSONObject();
		result.put("media", array);

		return result;
	}
232877
def get_hard_track_url(item_id):
    

    streams_url = "https://api.soundcloud.com/i1/tracks/%s/streams/?client_id=%s&app_version=%s" % (
    item_id, AGGRESSIVE_CLIENT_ID, APP_VERSION)
    response = requests.get(streams_url)
    json_response = response.json()

    if response.status_code == 200:
        hard_track_url = json_response['http_mp3_128_url']
        return hard_track_url
    else:
        return None
1121286
public static hanode[] get(nitro_service service, Long id[]) throws Exception{
		if (id !=null && id.length>0) {
			hanode response[] = new hanode[id.length];
			hanode obj[] = new hanode[id.length];
			for (int i=0;i<id.length;i++) {
				obj[i] = new hanode();
				obj[i].set_id(id[i]);
				response[i] = (hanode) obj[i].get_resource(service);
			}
			return response;
		}
		return null;
	}
182545
public function get($media_id)
    {
        if (!is_string($media_id)) {
            $this->setError('参数错误,媒体ID参数错误');

            return false;
        }

        $queryStr = [
            'media_id' => $media_id,
        ];

        $res = $this->_post('get_material', $queryStr);

        return $res;
    }
894360
public Obj get(String type, String id) throws Exception {
		return get(type, id, type);
	}
1016305
public List<Recording> getRecordings() throws Exception {
        final String recordingsPath = StringUtils.join(new String[]{
                getUri(),
                "recordings"
        }, '/');
        final JSONArray array = toJSONArray(client.get(recordingsPath, null));

        final List<Recording> list = new ArrayList<Recording>();
        for (final Object object : array) {
            list.add(new Recording(client, recordingsPath, (JSONObject) object));
        }
        return list;
    }
327162
def download_permanent_media(self, media_id):
        
        return requests.post(
            url="https://api.weixin.qq.com/cgi-bin/material/get_material",
            params={"access_token": self.token},
            data=_json.dumps({
                "media_id": media_id
            }, ensure_ascii=False).encode("utf-8")
        )
748615
public EventBase getEvent(final String eventId) throws Exception {
        final String eventPath = StringUtils.join(new String[]{
                getUri(),
                "events",
                eventId
        }, '/');
        final JSONObject jsonObject = toJSONObject(client.get(eventPath, null));
        return new EventBase(jsonObject);
    }
1153213
public static MediaGetResult mediaGet(String access_token,String media_id){
		return mediaGet(access_token, media_id, false);
	}
1042479
def info(self, media_id):
        
        dr = self.__app.native_api_call('media', 'i/' + media_id, {}, self.__options, False, None, False, http_path="/api/meta/v1/", http_method='GET')
        return json.loads(dr.text)
425224
def get_song(self, id_):
        """"""
        endpoint = "songs/{id}".format(id=id_)
        return self._make_request(endpoint)
1192176
function(id) {
      var self = this;

      // Loop through all sounds and find the one with this ID.
      for (var i=0; i<self._sounds.length; i++) {
        if (id === self._sounds[i]._id) {
          return self._sounds[i];
        }
      }

      return null;
    }
1021817
@Deprecated
    public Location resolvePlaceId(String placeId) throws FlickrException {
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("method", METHOD_RESOLVE_PLACE_ID);

        parameters.put("place_id", placeId);

        Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret);
        if (response.isError()) {
            throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
        }
        Element locationElement = response.getPayload();
        return parseLocation(locationElement);
    }
927077
async def download_media_by_id(self, media_id):
        
        try:
            msg = self.found_media[int(media_id)]
        except (ValueError, KeyError):
            # ValueError when parsing, KeyError when accessing dictionary
            print('Invalid media ID given or message not found!')
            return

        print('Downloading media to usermedia/...')
        os.makedirs('usermedia', exist_ok=True)
        output = await self.download_media(
            msg.media,
            file='usermedia/',
            progress_callback=self.download_progress_callback
        )
        print('Media downloaded to {}!'.format(output))
1005970
def get(self, resource_id=None):
        
        if request.path.endswith('meta'):
            return self._meta()

        if resource_id is None:
            error_message = is_valid_method(self.__model__)
            if error_message:
                raise BadRequestException(error_message)

            if 'export' in request.args: 
                return self._export(self._all_resources())

            return flask.jsonify({
                self.__json_collection_name__: self._all_resources()
                })
        else:
            resource = self._resource(resource_id)
            error_message = is_valid_method(self.__model__, resource)
            if error_message:
                raise BadRequestException(error_message)
            return jsonify(resource)
42088
public function getMediaContext($context_id = null)
    {

        if (is_null($context_id)) {
            $context_id = $this->getMediaContextId();
        }

        $context = $this->getClassificationContextManager()->find($context_id);

        if (is_null($context)) {
            $context = $this->getClassificationContextManager()->create();
            $context->setId($context_id);
            $context->setName($context_id);
            $context->setEnabled(true);
            $context->setCreatedAt(new \Datetime());
            $context->setUpdatedAt(new \Datetime());
            $this->getEntityManager()->persist($context);
            $this->getEntityManager()->flush($context);

            $defaultCategory = $this->getClassificationCategoryManager()->create();
            $defaultCategory->setContext($context);
            $defaultCategory->setName($context->getId() . '_default');
            $defaultCategory->setEnabled(true);
            $defaultCategory->setCreatedAt(new \Datetime());
            $defaultCategory->setUpdatedAt(new \Datetime());
            $defaultCategory->setSlug($context->getId() . '_default');
            $defaultCategory->setDescription($context->getId() . '_default');
            $this->getEntityManager()->persist($defaultCategory);
            $this->getEntityManager()->flush($defaultCategory);
        }

        return $context;
    }
135363
public DataMediaSource findById(Long dataMediaSourceId) {
        Assert.assertNotNull(dataMediaSourceId);
        List<DataMediaSource> dataMediaSources = listByIds(dataMediaSourceId);
        if (dataMediaSources.size() != 1) {
            String exceptionCause = "query dataMediaSourceId:" + dataMediaSourceId + " but return "
                                    + dataMediaSources.size() + " dataMediaSource.";
            logger.error("ERROR ## " + exceptionCause);
            throw new ManagerException(exceptionCause);
        }
        return dataMediaSources.get(0);

    }