Download a user\'s playlists by id.
11976
def user(netease, name, id):
    """"""
    if name:
        netease.download_user_playlists_by_search(name)

    if id:
        netease.download_user_playlists_by_id(id)
200276
def download_playlist_by_id(self, playlist_id, playlist_name):
        

        try:
            songs = self.crawler.get_playlist_songs(
                playlist_id)
        except RequestException as exception:
            click.echo(exception)
        else:
            folder = os.path.join(self.folder, playlist_name)
            for song in songs:
                self.download_song_by_id(song.song_id, song.song_name, folder)
701745
def createPlaylist(self, title, items=None, section=None, limit=None, smart=None, **kwargs):
        
        return Playlist.create(self, title, items=items, limit=limit, section=section, smart=smart, **kwargs)
1012842
def play(self):
        """"""
        self._response['shouldEndSession'] = True
        self._response['action']['audio']['interface'] = 'play'
        self._response['action']['audio']['sources'] = []
        return self
1008975
public GetPlaylistsTracksRequest.Builder getPlaylistsTracks(String playlist_id) {
    return new GetPlaylistsTracksRequest.Builder(accessToken)
            .setDefaults(httpManager, scheme, host, port)
            .playlist_id(playlist_id);
  }
1183713
def download_user_playlists_by_search(self, user_name):
        

        try:
            user = self.crawler.search_user(user_name, self.quiet)
        except RequestException as exception:
            click.echo(exception)
        else:
            self.download_user_playlists_by_id(user.user_id)
876607
def _find_playlist(self):
        
        data = None
        if self.id:
            data = self.connection.get_item(
                'find_playlist_by_id', playlist_id=self.id)
        elif self.reference_id:
            data = self.connection.get_item(
                'find_playlist_by_reference_id',
                reference_id=self.reference_id)

        if data:
            self._load(data)
425224
def get_song(self, id_):
        """"""
        endpoint = "songs/{id}".format(id=id_)
        return self._make_request(endpoint)
537136
def get_playlist(id)
      result = playlists.select { |p| p.id == id }
      result.nil? ? nil : result.first
    end
511789
def find_by_reference_ids(reference_ids, connection=None, page_size=100,
        page_number=0, sort_by=DEFAULT_SORT_BY, sort_order=DEFAULT_SORT_ORDER):
        
        reference_ids = ','.join([str(i) for i in reference_ids])
        return pybrightcove.connection.ItemResultSet(
            "find_playlists_by_reference_ids", Playlist, connection, page_size,
            page_number, sort_by, sort_order, reference_ids=reference_ids)
646005
def file_download(self, item_id: str, item_name: str, dir_name: str) -> bool:
        
        service = self.__get_service()
        request = service.files().get_media(fileId=item_id)
        self.__create_download_dir(dir_name)
        fh = io.FileIO(os.path.join(dir_name, item_name), mode='wb')
        downloader = MediaIoBaseDownload(fh, request)
        done = False
        while done is False:
            status, done = downloader.next_chunk()

        return done
1164750
def download(self, directory='~/Music', song_name='%a - %s - %A'):
        
        formatted = self.format(song_name)
        path = os.path.expanduser(directory) + os.path.sep + formatted + '.mp3'
        try:
            raw = self.safe_download()
            with open(path, 'wb') as f:
                f.write(raw)
        except:
            raise
        return formatted
749205
async def add_items(self, *items):
    '''
    '''
    items = [item.id for item in await self.process(items)]
    if not items:
      return

    await self.connector.post('Playlists/{Id}/Items'.format(Id=self.id),
      data={'Ids': ','.join(items)}, remote=False
    )
195769
def library(page = 0)
      songs = []
      resp = @client.request('userGetSongsInLibrary',
                             userID: @id,
                             page: page.to_s)
      songs = resp['songs'].map do |song|
        Song.new song
      end if resp.key?('songs')
      songs
    end
952616
def playlist(self, playlist_id, *, include_songs=False):
		

		playlist_info = next(
			(
				playlist
				for playlist in self.playlists(include_songs=include_songs)
				if playlist['id'] == playlist_id
			),
			None
		)

		return playlist_info
905639
def music_url(ids=[]):
    
    if not isinstance(ids, list):
        raise ParamsError()
    r = NCloudBot()
    r.method = 'MUSIC_URL'
    r.data = {'ids': ids, 'br': 999000, "csrf_token": ""}
    r.send()

    return r.response
321562
def get_user(self, user_id):
		""""""
		content = self._fetch("/user/%s" % user_id)
		return FastlyUser(self, content)