Fetches a song track by given ID.

        :param track_id: the track ID.
        :type track_id: str
        :return: API response.
        :rtype: dict

        See `https://docs-en.kkbox.codes/v1.1/reference#tracks-track_id`.
327668
def fetch_track(self, track_id, terr=KKBOXTerritory.TAIWAN):
        '''
        
        '''
        url = 'https://api.kkbox.com/v1.1/tracks/%s' % track_id
        url += '?' + url_parse.urlencode({'territory': terr})
        return self.http._post_data(url, None, self.http._headers_with_access_token())
591842
def get(self, record_id):
        
        record_url = self.record_url(record_id)
        return self._get(record_url)
1248166
def get_song_lyric(self, song_id):
        

        url = 'http://music.163.com/api/song/lyric?os=osx&id={}&lv=-1&kv=-1&tv=-1'.format(  # NOQA
            song_id)
        result = self.get_request(url)
        if 'lrc' in result and result['lrc']['lyric'] is not None:
            lyric_info = result['lrc']['lyric']
        else:
            lyric_info = 'Lyric not found.'
        return lyric_info
950947
def song_detail(ids):
    
    if not isinstance(ids, list):
        raise ParamsError()
    c = []
    for id in ids:
        c.append({'id': id})
    r = NCloudBot()
    r.method = 'SONG_DETAIL'
    r.data = {'c': json.dumps(c), 'ids': c, "csrf_token": ""}
    r.send()

    return r.response
1050769
def request(self, id, **kwargs):
        
        data = self.get('requests', id, **kwargs)
        return data
1329158
function obtainInfo(action, id, cb) {
    request.post({
        url: action,
        form: {
            code: id,
            lng: 'en',
            type: 'update'
        },
        headers: {
            'Referer': 'https://track24.net',
            'Origin': 'https://track24.net'
        },
        timeout: 20000,
        maxAttempts: 2,
    }, function (error, response, body) {
        if (error || response.statusCode != 200) {
            cb(utils.errorDown())
            return
        }

        let data = null
        try {
            data = JSON.parse(body)
        } catch (error) {
            return cb(utils.errorParser(id, error.message))
        }

        if (data.status == undefined ||
            data.status != 'ok' ||
            (data.data.events.length == 1 &&
            data.data.events[0].operationAttributeTranslated == 'The track code is added to the database Track24.ru for automatic monitoring.')) {
            cb(utils.errorNoData())
            return
        }

        data.gearTrackID = id

        let entity = null
        try {
            entity = createTrackerEntity(data)
        } catch (error) {
            return cb(utils.errorParser(id, error.message))
        }

        if (entity != null) cb(null, entity)
    })
}
632005
def download_album_by_id(self, album_id, album_name):
        

        try:
            # use old api
            songs = self.crawler.get_album_songs(album_id)
        except RequestException as exception:
            click.echo(exception)
        else:
            folder = os.path.join(self.folder, album_name)
            for song in songs:
                self.download_song_by_id(song.song_id, song.song_name, folder)
1332596
protected function getProfileIdByTrackingId(&$analytics, $tracking_id)
	{
		$accounts = $analytics->management_accounts->listManagementAccounts();
		
		foreach ($accounts->getItems() as $item)
		{
			$account_id = $item->getId();
			if ($account_id != $tracking_id) continue;
			
			$properties = $analytics->management_webproperties->listManagementWebproperties($account_id);
			
			if (sizeof($properties->getItems()) > 0)
			{
				$items = $properties->getItems();
				$first_property_id = $items[0]->getId();
				
				$profiles = $analytics->management_profiles
					->listManagementProfiles($account_id, $first_property_id);
				
				if (sizeof($profiles->getItems()) > 0)
				{
					$items = $profiles->getItems();
					return $items[0]->getId();
				}
			}
		}
		
		return null;
	}
1092493
public static Trajectory getTrajectoryByID(List<? extends Trajectory> t, int id){
		Trajectory track = null;
		for(int i = 0; i < t.size() ; i++){
			if(t.get(i).getID()==id){
				track = t.get(i);
				break;
			}
		}
		return track;
	}
1118880
public Subtitle getSubtitle(int trackID) throws MusixMatchException {
        Subtitle subtitle = null;
        SubtitleGetMessage message = null;
        Map<String, Object> params = new HashMap<String, Object>();

        params.put(Constants.API_KEY, apiKey);
        params.put(Constants.TRACK_ID, new String("" + trackID));

        String response = null;

        response = MusixMatchRequest.sendRequest(Helper.getURLString(
				Methods.TRACK_SUBTITLE_GET, params));

        Gson gson = new Gson();

        try {
            message = gson.fromJson(response, SubtitleGetMessage.class);
        } catch (JsonParseException jpe) {
            jpe.printStackTrace();
            handleErrorResponse(response);
        }

        subtitle = message.getContainer().getBody().getSubtitle();

        return subtitle;
    }
612674
function getById(hypemId, callback) {
        var options = {
            method: 'HEAD',
            url: HYPEM_GO_URL + hypemId,
            followRedirect: false,
            timeout: FIVE_SECONDS_IN_MILLIS
        };

        request(options, function (error, response) {
            if (error || response.statusCode !== 302) {
                callback(error, null);
                return;
            }
            var songUrl = response.headers.location;
            if (isSoundcloudUrl(songUrl)) {
                var soundcloudUrl = getNormalizedSoundcloudUrl(songUrl);
                callback(null, soundcloudUrl);
            } else {
                requestHypemKey(hypemId, function (error, hypemKey) {
                    if (error) {
                        callback(error, null);
                        return;
                    }
                    requestMp3Url(hypemId, hypemKey, callback);
                });
            }
        });
    }
165689
def play_track(self, track_id=DEFAULT_TRACK_ID, position=0):
        """"""
        self.publish(
            action='playTrack',
            resource='audioPlayback/player',
            publish_response=False,
            properties={'trackId': track_id, 'position': position}
        )
784951
async def get_tracks(self, query) -> Tuple[Track, ...]:
        
        if not self._warned:
            log.warn("get_tracks() is now deprecated. Please switch to using load_tracks().")
            self._warned = True
        result = await self.load_tracks(query)
        return result.tracks
38407
def get(self, id):
        
        id = self.as_id(id)
        url = '%s/%s' % (self, id)
        response = self.http.get(url, auth=self.auth)
        response.raise_for_status()
        return response.json()
857531
def download_song_by_id(self, song_id, song_name, folder='.'):
        

        try:
            url = self.crawler.get_song_url(song_id)
            if self.lyric:
                # use old api
                lyric_info = self.crawler.get_song_lyric(song_id)
            else:
                lyric_info = None
            song_name = song_name.replace('/', '')
            song_name = song_name.replace('.', '')
            self.crawler.get_song_by_url(url, song_name, folder, lyric_info)
        except RequestException as exception:
            click.echo(exception)
435769
def get_file_by_id(self, file_id):
        
        return self._create_item_response(
            self.data_service.get_file(file_id),
            File
        )
1033673
def fetch_album_name(self):
        
        response = get_lastfm('track.getInfo', artist=self.artist,
                              track=self.title)
        if response:
            try:
                self.album = response['track']['album']['title']
                logger.debug('Found album %s from lastfm', self.album)
            except Exception:
                logger.warning('Could not fetch album name for %s', self)
        else:
            logger.warning('Could not fetch album name for %s', self)